Question
Read one byte from Flash memory
Posted on May 29, 2014 at 15:46
Hi,
I am working with STM32F303, and I need a suggestion to directly read one byte, in particular, the most significant byte from a flash memory address.I have tried some code, like the one below but I pick every time the LSB.For example after a page erase operation I write at the address 0x08036000 the next 32bit value 0xDD0000EE.After this code:Address = 0x08036000 ; var8pointer = (uint8_t*)Address; var8 = *var8pointer;in the 8 bit variable var8 I find the value 0xEE, the LSB!The var8pointer should be a pointer to an 8bit unsigned so i was expected to read the value in the first address (should be 0xDD) and not the one in the first address+4...This behaviour is related to the endian organizzation of the core?Or, am I totally wrong?Is there a solution, excluding >> operation on a 32bit variable?Thanks