Hello, I'm trying to encrypt an array of 16 of a plain text:
uint8 Data_au8[AES128_ECB_PLAIN_TEXT_SIZE] = {
0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
};
With the array initialized like this, this works fine since it gives the the following encrypted array:
But, this is not what I want my code to do, I want to change the values of the array in my main function, but If I do this:
uint8 Status_u8 = 0x01u;
uint8 Data_au8[AES128_ECB_PLAIN_TEXT_SIZE] = {
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
};
int main()
{
Data_au8[0] = Status_u8;
Data_au8[1] = Status_u8;
/* Encryption */
}
It doesn't encrypt properly:
What could be causing this?
Thank you in advance!
Solved! Go to Solution.
Hi @Rmpr
This sounds like data cache issue. All the data objects used for communication with HSE must be forced to non-cacheable memory. The data cache is usually configured to copy-back mode and HSE can't see the data cache on core(s), so this may cause coherency issues. HSE always accesses physical addresses only.
For quick test, you can try to disable the data cache completely. Either in your project settings or in your debugger:
Regards,
Lukas
Hi @Rmpr
This sounds like data cache issue. All the data objects used for communication with HSE must be forced to non-cacheable memory. The data cache is usually configured to copy-back mode and HSE can't see the data cache on core(s), so this may cause coherency issues. HSE always accesses physical addresses only.
For quick test, you can try to disable the data cache completely. Either in your project settings or in your debugger:
Regards,
Lukas