OPTIGA Trust X Evaluation Kit initialization issue

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MaxMartin
Level 3
Level 3
First like received First like given 25 sign-ins

Hi everyone,

I recently started working with an OPTIGA Trust X Evaluation Kit in order to gain experience with OPTIGA Trust products. I followed every step described in the Get-Started guide, which I found here:

https://github.com/Infineon/getstarted-optiga-trust-x/wiki

Everything works fine, I am able to debug the program with DAVE, see the outputs with the UART etc.

I only seem to have an issue with the initialization. Indeed, the basic main function given in the GitHub repository is supposed to print several messages to show different uses of the Trust X, but I am only able to get the "Device closed" message at the end of the function.

After a bit of debugging, I found that I had an issue returning from the TransceiveAPDU function, being called by the GetMaxCommsBuffer function.

Indeed, I receive an error code 0x80010001 which according to the documentation is due to an invalid OID.

From what I can read in the code, the OID to read the maximum communication buffer size is 0xE0C6, which is consistent with the OPTIGA Trust X1 Solution Reference Manual. 

I haven't configured anything particular so do you have any idea of why this OID could be considered invalid ? I am fairly new to that platform and I can't figure out what is wrong with this OID.

I would be very grateful for your help !

Best regards,

Maxime MARTIN

0 Likes
26 Replies
Karishma_S
Moderator
Moderator
Moderator
50 solutions authored First comment on blog 250 sign-ins

Hi ,

Please add breakpoints at optiga_comms_transceive call and CmdLib_GetDeviceError call in CommandLib.c file and share the Status/error code returned by these functions (i4Status at corresponding lines).

Also please confirm if no other integration to the code example or setup have been done?

  

Regards,

Karishma

 

0 Likes

Hi Karishma,

Thank you for your answer. I put a break point at optiga_comms_transceive and the value I had returning from that function is 0, so i4status = 0.

With the breakpoint at CmbLib_GetDeviceError, I got i4status = 0x80010001 as previously stated in my first post.

This occurs when I try to read the maximum communication buffer size in Trust X. I see that the APDU sent has the right parameters and the right OID but for some reason the answer from Trust X is always the same, triggering that error code. I have PpsApduData->prgbRespBuffer[OFFSET_RESP_STATUS] = 255, which is the condition sending me into CmbLib_GetDeviceError. 

I haven't changed anything compared to what's available in the GitHub repository, and for the setup I only have a microUSB cable to power/flash/debug as well as a UART to see the output.

Do you have a clue of what could be the issue ?

Regards,

Maxime

EDIT: I went in dept with the operation of the APDUs, and instead of sending an APDU with the OID 0xE0C6 (OID_MAX_COMMS_SIZE) in the payload to get the Maximum Buffer Size, I tried with other OIDs (0xE0C0, 0xE0C1 etc...). With these OIDs, I obviously don't get the Maximum Buffer Size value, but I also don't get any "Invalid OID" error, which is an interesting result. With that test, it really seems that the issue is with the specific 0xE0C6 OID, either because it wasn't mapped properly or because there is an issue with a register or with memory on my Trust X.

Can you think of any other possible reason ? 

0 Likes
Karishma_S
Moderator
Moderator
Moderator
50 solutions authored First comment on blog 250 sign-ins

Hi @MaxMartin,

Your query is forwarded to the dedicated team, as it could not be reproduced on our side (the example executes without any error). We will get back to you once we get a response from them.

0 Likes

Hi @Karishma_S

Thank you very much for your answer. I'll wait for news about this topic.

Best regards

0 Likes
Karishma_S
Moderator
Moderator
Moderator
50 solutions authored First comment on blog 250 sign-ins

Please enable extra debugging at the following lines and share the logs displayed,

  1. https://github.com/Infineon/optiga-trust-x/blob/master/optiga/comms/ifx_i2c/ifx_i2c_data_link_layer....
  2. https://github.com/Infineon/optiga-trust-x/blob/master/optiga/comms/ifx_i2c/ifx_i2c_physical_layer.c...
  3. https://github.com/Infineon/optiga-trust-x/blob/master/optiga/comms/ifx_i2c/ifx_i2c_transport_layer....

Also, share the hex bytes from the pal_i2c_write and pal_i2c_read functions. These logs will be helpful in finding the root cause.

 

Regards,

Karishma

0 Likes

I put IFX_I2C_LOG_DL = 1, IFX_I2C_LOG_PL = 1 and IFX_I2C_LOG_TL = 1 but it seems I don't have the common/Log_api.h file required. I can't find it in the GitHub repository either. Is there something I am missing ? I was using my debug session to display values, but I don't know how the logging system works for that project. Could you tell me where the log files are stored once logs are enabled ?

Thank you,

Maxime

0 Likes
Karishma_S
Moderator
Moderator
Moderator
50 solutions authored First comment on blog 250 sign-ins

You just have to uncomment the printf statements at the lines mentioned in my previous comment, don't change IFX_I2C_LOG_DL/IFX_I2C_LOG_PL/IFX_I2C_LOG_TL to 1.

You can continue using the debug session, the printf output will be displayed on terminal and hex bytes from the pal_i2c_write and pal_i2c_read functions can be tracked from debug window.

0 Likes

Uncommenting the printf statements doesn't show me any log in the DAVE terminal. First, printf in these files was an "implicite declaration" and even after including stdio.h, nothing related to these prints shows up in the Console or the Debugger Console. Is it the normal behavior ? Am I not supposed to use the functions in Source/Helper.h to see outputs with the UART ?

I can however see the disassembly of the code in DAVE so I don't have an issue with sending the hex bytes from pal_i2c_write and pal_i2c_read.

0 Likes
Karishma_S
Moderator
Moderator
Moderator
50 solutions authored First comment on blog 250 sign-ins

Please share the hex bytes from pal_i2c_write and pal_i2c_read.
I hope you are using an external USB to serial adapter for UART (as mentioned in GitHub repo). 

 

Regards,

Karishma

 

0 Likes
lock attach
Attachments are accessible only for community members.

Here are the hex bytes from pal_i2c_write and pal_i2c_read in the attached file (in a .zip because I am not allowed to upload .txt files), which I got from Debug/xmc_application.lst

I am indeed using an external USB serial adaptater for the UART, and I use the functions in Helper.h like Print_Stringline or PrintLine_ErrorCode to see some outputs in my PuTTy session. I am unable to see anything using the printf function for logging though, and that was my question. The console available in DAVE doesn't show these messages so I was wondering how the logging system was working in this project, because it doesn't seem to use the UART functions either. Is there a macro I need to enable in order to get the logs ?

Thank you very much,

Regards,

Maxime

EDIT: I was wondering if you could share with me the source code you run on your side, in a .zip file, so we could directly see if I had an issue while cloning the GitHub repository or if the problem is linked to something else. Would it be possible ?

0 Likes
Karishma_S
Moderator
Moderator
Moderator
50 solutions authored First comment on blog 250 sign-ins

I guess there is a miscommunication here, my hex bytes I mean the hex data that is present in read/write array. You can get it as i2c logs (with a logic analyser or an osciloscope) or a logging output during the function's execution.
And regarding the printf statements, I'll check it out.

0 Likes

I can't get any log because trying to use UART functions instead of debug function doesn't work. I guess that in order to find a solution, I first need to be able to print messages to the DAVE console, otherwise we won't be able to see any data related to the I2C.

Can you tell me what I need to do/configure in order to print debug messages to the DAVE console for this project ? I saw some topics about semihosting and I have tried some configurations but nothing seems to work at the moment, I don't know what else I can do. Is there a chapter in the GitHub wiki to explain that ?

0 Likes
lock attach
Attachments are accessible only for community members.
Karishma_S
Moderator
Moderator
Moderator
50 solutions authored First comment on blog 250 sign-ins

Hi @MaxMartin,

Please find my project in the attachments. Let me know if this works fine for you.

Regards,

Karishma

0 Likes
lock attach
Attachments are accessible only for community members.

Hi @Karishma_S

I tried using your project but it seems it was built with an older version of DAVE. I use DAVE version 4.5.0 so I am not allowed to use it as an active project, which means I can't flash it or debug it. Is there a workaround for this ?

Regards,

Maxime

EDIT: I downloaded DAVE3 but I can't compile your project because of multiple errors, which are listed in the attached file. Do you have the same issues ? 

0 Likes
lock attach
Attachments are accessible only for community members.

Using the attached project, I can enable semihosting and get debug messages.

However I have no clue how to make it work with the initial Trust X Evaluation Kit project. It tried several configurations but I can't see outputs in the DAVE console.

Is it what you use on your side ? I think we are using different DAVE versions, but have you tried using the last DAVE version with the last available code version in the GitHub repo ? Maybe there is an issue here.

0 Likes
lock attach
Attachments are accessible only for community members.
Karishma_S
Moderator
Moderator
Moderator
50 solutions authored First comment on blog 250 sign-ins

Hi @MaxMartin,

I have tried using both versions of DAVE (4.4.2 and 4.5.0) and did not encounter any problem. There are app version differences in 4.4.2 and 4.5.0 version, and sometimes these behaviors are expected. 

Try using the project attached here, I have built it using 4.5.0 version. Or use DAVE 4.4.2 version (not DAVE3) for the previous project I shared.

0 Likes

Hi @Karishma_S,

I still can import this project, DAVE 4.5.0 tells me it was created with a version of DAVE older than 4.0.0 so I can't even open it on my side.

What I did is using the first project I had (available on GitHub) and moving files from the project you sent me to this one. Thus I have a project created with a correct version of DAVE but using files from you version. I however have the same result as before: incorrect IOD and I can't see debug logs (with XMC_DEBUG or with uncommenting the printf you showed me).

Starting from the code available in the GitHub repository (https://github.com/Infineon/getstarted-optiga-trust-x), can you tell me precisely how you configured DAVE in order to see debug messages and logs ? I can't figure out what goes wrong on my side.

I am trying to set logs with UART, but it's not very efficient.

0 Likes
Karishma_S
Moderator
Moderator
Moderator
50 solutions authored First comment on blog 250 sign-ins

Hi @MaxMartin,

Can you use a logic analyzer or oscilloscope to get the i2c logs?

Regards,

Karishma

0 Likes
lock attach
Attachments are accessible only for community members.

Hi @Karishma_S

I share with you an analysis of the I2C bus. I hope this is enough for you to figure out if there is something wrong. I used a picoscope to get these results, the acquisition file is included in the archive.

Regards,

Maxime

0 Likes
Karishma_S
Moderator
Moderator
Moderator
50 solutions authored First comment on blog 250 sign-ins

We could not find any command failure in the I2C logs. Can you please share images of your kit and the entire hardware setup? 

0 Likes
lock attach
Attachments are accessible only for community members.

Hi @Karishma_S

Here are some pictures of my hardware setup and of the Trust X Evaluation Kit. As you can see, it is plugged-in via a micro-USB cable, and I also have a UART to see some messages (you can see the "Device closed" message on my laptop). My picoscope isn't connected on the pictures, but I connected it to the P0.5 and P0.11 pins to get the SDA and SCL signals.

0 Likes
Karishma_S
Moderator
Moderator
Moderator
50 solutions authored First comment on blog 250 sign-ins

Hi @MaxMartin,

We could not reproduce your error on our side. And also, could not find any flaw in the setup or I2C logs shared by you.

Is it possible for you to send your kit to us for analysis and we will send a new one while we are doing the analysis. The new one has two options, either it is the same Trust X Eval Kit, or it is one of the new OPTIGA Trust M IoT SDK Kits. Please contact CSSTechnicalSupport@infineon.com for shipment details.

 

0 Likes

Please let us know if your query was resolved.

We will wait for 3 days and then lock this thread. In case your problem is not resolved, please create a new thread and we will be happy to help. 

 

0 Likes

Hello @Karishma_S,

Sorry I didn't reply earlier, I was busy on another task. I haven't contacted the technical support for shipement details yet, but I'll do it soon and ask for a TrustM Evaluation Kit as it is the one I am going to use in projects. I'll create a new thread if I have any issue to ask for support.

Thank you once again,

Regards

0 Likes
Karishma_S
Moderator
Moderator
Moderator
50 solutions authored First comment on blog 250 sign-ins

So can we lock this thread now?

0 Likes

Yes you can

0 Likes