Hello, NXP
I recently tried to use the Crypto driver for the S32K312.
I successfully generated the elf file of Crypto_SymmetricPrimitives_S32K312 example provided by NXP and downloaded the elf file into the S32K312 project board I am currently using, but it does not perform the Crypto module functions properly.
The problem should be in the while loop of Wait for the HSE response in the Hse_Ip_ServiceRequest function, how should I solve this problem?
The following is the MCAL version I am using and the specific example path.
(C:\NXP\SW32K3_RTD_4.4_2.0.2\eclipse\plugins\Crypto_TS_T40D34M20I2R0\examples\EBT\Crypto_SymmetricPrimitives_S32K312)
Attached is the elf file I generated for Crypto_SymmetricPrimitives_S32K312.
Looking forward to your reply, thanks!
Hi @VaneB
Before running example, I have installed HSE FW.
Because if HSE FW is not installed, the elf file cannot be generated. But I found that the installation path of HSE FW and the HSE FW extraction path in project_parameters.mk are not consistent, the direction of the slash is reversed, will this have any effect?
Hi @Cppppy
Could you elaborate on the "extraction path in project_parameters.mk are not consistent"?
Could you also tell me how you installed the HSE FW?
Hi @VaneB
The installation path should be OK, the elf file has been generated and can be downloaded into the S32K12 project board.
I downloaded the HSE FW from the NXP website, the exact address is shown in the picture.
Hi @Cppppy
According to your first image posted, the code awaits the HSE's response. So it may not have been installed correctly.
Additionally, did you perform the following step when debugging?
"If the debug configuration is set to Debug_FLASH, go to the PEmicro Debugger Tab => click Advanced Options button => at the Flash Algorithm Selection => select nxp_s32k344_1x32x980k_hse_enabled => click OK button to close Advanced Options dialog."
Hi @VaneB
I reinstalled HSE and did what you suggested during DEBUG, but now the problem persists. Is there any other solution please?
Hi @Cppppy
Could you help me with one last check regarding the HSE FW installation?
The HSE Demo App has functions that verify if the HSE was correctly installed. See the below image:
Please help me with the result of this test.
Hi @VaneB
Which installation path can I find the code in this picture? I didn't find this code in C:\NXP\SW32K3_RTD_4.4_2.0.2\eclipse\plugins\Crypto_TS_T40D34M20I2R0\examples and C:\NXP\HSE_FW_S32K3XX_0_2_6_0 path.
Hi @Cppppy
These functions are in the HSE Demo App, which you will find where you downloaded the HSE FW.
Hi @VaneB
I downloaded the HSE Demo App from the NXP website and tried to open it in S32DS 3.4, but S32DS does not recognize the project. Do I need to do other operations to import the project into S32DS and generate the elf file?
Attached is the HSE Demo App I downloaded, and it doesn't match the code in your picture.
Hi @Cppppy
The code I share is another version, but the functionality is almost the same.
At the HSE_DEMOAPP_S32K3XX_0_2_6_0_ReadMe.pdf comes the guide on how to Import and Build the project using S32 Design Studio.
I ran S32KXX_demo_app in HSE_DEMOAPP_S32K3XX_0_2_6_0, but the program went into a loop in the WaitandSetFWEnablefeatureflag function, which seems to indicate that my S32K312 chip HSE FW usage flag is not already enabled.
Is this a hardware problem or is there something wrong with the program's runtime environment?
Another problem is that the HSE_DEMOAPP_S32K3XX_0_2_6_0y I downloaded should correspond to the S32K312, but the DEBUG configuration and program identification in S32DS identifies this program as S32K3X4, so I wonder if this will have any effect on the running of the program?
Hi @Cppppy
To change the debug configurations to the S32K3x2, right-click on the project and then select at Build Configurations -> Set Active -> 2 S32K3x2. Please refer below image.
Hi @VaneB
After I changed the DEBUG configuration to S32K3X2, the result of the program running did not change, still in WaitandSetFWEnablefeatureflag () into the while loop can not be broken out.
Do I need to enable HSE manually or does this mean that there is a problem with my hardware or software environment?
Hi @Cppppy
You still have no response from the HSE, so it remains in that loop.
From the image that you shared, I could see that the project was imported incorrectly since if you look at the following image, you can see that you must have the demo app and SecureBootApp.
Please review the steps listed in the HSE_DEMOAPP_S32K3XX_0_2_6_0_ReadMe file that you find in the following path:
C:\nxp\HSE_DEMOAPP_S32K3XX_0_2_6_0\HSE_DEMOAPP_S32K3XX_0_2_6_0_ReadMe.pdf
Hi @VaneB
The problem has been solved and the HSE Demo is now working properly. The reason for the problem is because the S32K312 chip I am using has not been installed with HSE.
Thank you very much for being very patient in answering my questions for so long!