2020-06-03 08:57 AM
Hi I am using STM32CUBEIDE
I can read and write to BKPRAM this all works STM32F407.
I have Modified Linker Script to include a BKRAM area 4k, however I have a situation I cannot understand whereby my Build output file .bin changes size dramatically when I locate data in this area. during compilation.
My USB Bootloader uses a .bin file so this is a problem due to the massive file, the extra size is basically just padded with zero's when I examine the file.
The .hex file increase a small amount.
File Size with Structure located in RAM
Output .bin 165,676 bytes
Output.hex 466,084 bytes
File Size with same Structure located in BKPRAM area
Output .bin 939,624,408 bytes
Output.hex 471,755 bytes
The Build analyser show what looks like the correct amount of BKRAM 4K limit used.
Any ideas ?
Thanks
2020-06-03 08:59 AM
Exclude them from the .bin, see NOLOAD keyword; or in the postprocessing, when using objcopy, using -R switch (IIRC).
JW
2020-06-03 09:20 AM
Jan, many thanks, that appears to have done the trick :-
Snippet for anyone else that's had the same issue.
BKRAM (rw) : ORIGIN = 0x40024000, LENGTH = 4K
.backup (NOLOAD) :
{
. = ALIGN(4);
*(.backup);
*(.backup*);
. = ALIGN(4);
} >BKRAM
2020-06-03 10:04 AM
.HEX can describe sparse memory, .BIN can't
Some tools can separate different sections into multiple binaries