sshakuf wrote:I used the same code as before, I don't understand why was it not aligned ?
the same structure. same size.
Because its natural alignment is 1 byte: none of its fields needs bigger alignment. spi_flash_write apparently expects a buffer of uint32_t, and it must be aligned to 32 bits. So your structure may start at any byte, you was just lucky when it worked.
sshakuf wrote:Do you mean that the struct in the memory did not start in an aligned 4 bit address ?
4 byte. Yes.