Problem: Failed to open gpio direction for writing!
filip-dahlberg opened this issue · 6 comments
Environment: Embedded Linux
I'm receiving following error no matter what program I'm invoking from CLI bin. It seems like the CLI programs cannot establish I2C communication to the optiga trust IC due to permission faults.
I know that the I2C connection to the optiga trust m is available from executing trustx_scan. See output of trustx_scan -b /dev/i2c-0:
Would very much appreciate any help that can point me in right direction.
Hello @MScMechatronics
just to quickly check, did you change the GPIO settings here according to your board?
Did you sucesfully compile the code with no problems on this board?
Thank you very much for your prompt response.
Yes I successfully compiled the code by executing the commands in the README:
make workaround_patch
make
sudo make install
Thanks for your advice on the PAL, I'll check that one out. It could also be some kind of driver issue on my side.
However, as the trustx_scan program finds the optiga chip through the I2C driver I was thinking that the Infineon/cli-optiga-trust-m bin program were also to work.
The trustx_scan tool is indeed a first tool to understand whether you have a proper communcation in general. It just uses a generic /dev/i2c-1
device to probe the connection. Whereas the cli uses also the Reset and Power Control Lines (GPIOs) to communication with the chip.
If you would like to skip this part and not use the GPIO (use e.g. software reset), you can just change the configuration (here for m1 or here for m3)
Thanks ayushev , I very much appreciate your help. I now think I have clear understanding of how to proceed.
I now manage to get response from the optiga IC by changing to /dev/i2c-0 here. I'm still experiencing the problem with "Problem: Failed to open gpio direction for writing!" which then seem to be a result of trying to write to reset/vdd GPIO, even if I configure it to not use the reset and vdd GPIOs by setting OPTIGA_COMMS_DEFAULT_RESET_TYPE to 1.