This tool allow the user to flash data to a specific adress in the FLASH memory on the STM32F446 series.
You will need the following tools:
First, you will have to transform your data to an ada array in order to be compiled.
Example: python3 scripts/to_ada.py alire.toml src/adadata AdaData 0x08060000 --array-type Unsigned_8
Here, the script reads the entire file 'alire.tom' and place it to an ada array of Unsigned_8.
The array-type don't affect your data but is used to generate an .ads file to access your data.
Then, the data will be placed at the adress 0x08060000. According to the F446RE board, it is the last available sector of the flash.
For your usage, make sure the address is aligned to an available sector with enough space.
The script will generate two files:
- datablob.ads which contain your data.
- adadata.ads which define constants to access your data. You can copy this file into your project. Finally, the 'r' argument run the compilation and flash the program, or you can manually compile with:
make ADDR=0x08060000According to the compiler, the address can change during the linking phase. Sometime, the address has an offset due to alignment or metadata caused by the compiler. You can check the real address using this command:
./scripts/verify.shOr check that your data are in the board with:
st-flash read dump.bin 0x08060000 434
hexdump -C dump.bin Or od -f dump.bin to display float numbers.
We found out that we can just flash the board with any file.
Indeed, it appears that the command line st-flash write [file] [ADDR] support any file type to be transmitted. Whish we tried that sooner.
We added the script flash.sh that take files as input, concatenate them and flash to the board.
On the st-flash v1.8.0, st-flash --area=otp read dump is not implemented.
But st-flash --area=option read dump
and st-flash --area=system read dump 0x1FFF0000 30KB works.