2018-08-09 01:42 AM
Hey everyone,
I need to do some operations on Firmware, and i am asking on how to recover its size and store it ?
I am using STM32F401RE.
Simo
2018-08-23 05:13 AM
text data bss dec hex filename
34660 556 74860 110076 1adfc taskN_dev.elf
"text" represents the firmware ? its size is 34k, is that right ?
2018-08-23 06:35 AM
The size in flash is going to combine text+data
Depending on the linker script symbols, the end address will be
_sidata + (_edata - _sdata)
You could even add your own symbol beyond the end of the data packed in the FLASH
For the hash, you have 32768 bytes, not 8192, and you could hash in situ.
SHA256Reset(&ctx);
SHA256Input(&ctx, (const uint8_t *) BASE_ADDR_SECTOR_0, 32768); // 0x08000000..0x08007FFF
SHA256Result(&ctx, msg_digest);
SHA256Reset(&ctx);
SHA256Input(&ctx, (const uint8_t *) BASE_ADDR_SECTOR_0, 16384);
SHA256Input(&ctx, (const uint8_t *) BASE_ADDR_SECTOR_1, 16384);
SHA256Result(&ctx, msg_digest);
Not sure the point of the data_store variables, and adding things to it.