Hello,
We need to generate a Random number on S32K358
This post https://community.nxp.com/t5/S32K/random-number/m-p/1645343 help us a lot.
Now, we want to enable the DATA cache for the whole project so we try to force the data structure to non cacheable memory but without success.
We can't figure out which struct needed to be in non cachaeable memory and in which section add the strut ( .mcal_data_no_cacheable ? )
Does anyone have an working example ?
Hi @sobo
Any variable (hseSrvDescriptor, input/output length/size pointer , data pointer…) used in the interaction between the core and HSE need to be placed in a non-cacheable area (DTCM, non-cacheable SRAM…). You can take a look at Crypto examples in RTD. You will always see something like this - and that will do the job:
Regards,
Lukas
hello,
it works for a s32K344 with RTD version 1.0.0 but the same code doesn't works with a s32k358 with RTD v3.0.0 HF01.
In the first case we receive a Random number from the HSE, in the second case we have a error return by the HSE. The error is unknown from Crypto_Hse_TranslateHseResponse function(goes to default switch).
However, on the s32k358 we can get a random number, if before calling crypto/HSE function we clear the cache and disable it but It is not a good solution for us.
Do you have any idea why ?
Not all variables/structures are obviously forced to non-cacheable area. Could you share your code? Did you define the variables as shown on the screenshot above?
Regards,
Lukas
Hi @lukaszadrapa ,
Please find below the source code we use for generating the random number:
Can I ask you to submit this as a new ticket here?
https://support.nxp.com/s/?language=en_US
We will assign it directly to SW team.
Thanks,
Lukas