I have some tables, for example one declared as uint8_t keyLock[16];
, and I have saved contents of these tables in the flash memory of my MCU. In this memory its looks like below:
Address Data
00190008 - BA98B694
0019000C - E854B6E7
00190010 - 9200B2C9
00190014 - 42F8B048
When I copy the flash data into my table via the memcpy
function (memcpy(keyLock, 0x00190008, 32);
) the contents of table end up as if initialized this way:
keyLock = {
0xBA, 0x98, 0xB6, 0x94, 0xE8, 0x54, 0xB6, 0xE7,
0x92, 0x00, 0xB2, 0xC9, 0x42, 0xF8, 0xB0, 0x48
}
I want the contents to be as if the table were initialized like this:
keyLock = {
0x94, 0xB6, 0x98, 0xBA, 0xE7, 0xB6, 0x54, 0xE8,
0xC9, 0xB2, 0x00, 0x92, 0x48, 0xB0, 0xF8, 0x42
}
What is wrong with my memcpy()
call, and how should I write it to fill the table with the desired content, as above?