AnsweredAssumed Answered

Read one byte from Flash memory

Question asked by mangraviti.giova.001 on May 29, 2014
Latest reply on May 29, 2014 by sung.chen_chung

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?