2021-05-29 5:36 PM
I am reading 64bit values from flash
uint64_t DATA_read = *(__IO uint64_t *)0x0801E010;
Where THE FLASH ADDERSS 0x0801E010 contains 5A5A5A5A 00440040
DATA_read value afer this read is 0x400044005a5a5a5a
if I read
uint64_t DATA_read = *(__IO uint64_t *)0x0801E010;
Where THE FLASH ADDERSS 0x0801E010 contains 0F00A007 4342A17F DFFEF9B6 3783E0F6
DATA_read value afer this read is Hex:0x7fa1424307a0000f
if I read it in 8 bit chunks is works fine
uint32_t StartAddress=0x0801C000;
for (int i=0; i<16; i++)
{
Rx_Data[i]= *(uint8_t *)StartAddress++;
}
2021-05-29 6:15 PM
Clearly, you are displaying the 64-bit values and whatever THE FLASH ADDERSS is, in different endianity.
I guess, THE FLASH ADDERSS is something coming from a tool (debugger?) displaying in big endian. STM32 is little endian only.
JW
2021-05-29 6:37 PM
The issue is that it reads each uint8_t of the uint64_t but puts the most signnificant Byte at the least significant position so a number that starts with 0F00A007 ends up ending with 07A0000F reversing the bytes.
2021-05-29 6:38 PM
Im using CUBEIDE_1.3.0 downloaded from ST
2021-05-30 9:34 AM
> puts the most signnificant Byte at the least significant position
As JW says, that is what happens on a little endian system. You'll need to adjust how you interpret the value. There is no way to change the STM32 to store values in big endian format.
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.