* This bypasses the problem introduced when the .data section was moved
from RAM to DTCM_RAM.
* This also ensures that the hash in the .hex file will be valid when
the hex is flashed to a NAND chip as the hash is generated from the .bin
file content. If the hex contains gaps between sections and the gaps
are erased on the NAND flash then erased sectors are full of 0xFF, not
0x00, which will mean the computed hash won't match.
EXST - Add note regarding currently supported bootloader requirements
regarding the CODE_RAM address.
EXST - Fix make 'dirty' file issue.
When `make` is run twice, the TARGET_BIN is recreated incorrectly.
Root cause was that objcopy actually modifies the INPUT file when no
output file is specified, even when the operation is to extract a
section from the input file...
EXST - Improve messaging when generating EXST bin files.
This should help with understanding of the exact operations required for
EXST bin file generation.
Added warning about hard coded start address.
configurator.
Without the padding and length the HASH in the HEX will be invalid since
erased flash defaults to 0xFF but the hash is created on the binary file
which has a default of 0x00 for un-filled data.
The hex file must have the correct address in order for it to be
uploaded via flashing tools (configurator).
However, the objcopy tool only appears to support an INCREMENT address,
so the increment is determined by subtracting the load address from the
flash address.
For the current SPRacing H7 boards, the bootloader DFU descriptor string
has a start address of 0x9000000 for the external flash, the firmware
partition begins at offset 0x07CE0000, required resulting flash address
is 0x97CE0000.
- Initial
- Adjust load address of EXST firmware.
- Add helper script to pad an EXST binary to the expected size.
Padded firmware currently required due to a bug in the flash/dfu code
which causes anything less than a flash page size to be truncated when
uploading new firmware via the bootloader DFU.
- Minor linker script cleanups.
- STM32H7.mk change hardcoded TARGET_FLASH (384) to FIRMWARE_SIZE
- Delete unused configuration section entries from linker
scripts.
- Increase EXST firmware size to 448K.
It turns out 384K wasn't enough for a feature-complete firmware.
- Update pad-exst.sh to use 448K by default.
- Move the EXST file generation to the makefile.
[EXST] Embed firmware hash in ELF
- Add debug marker at end of CODE_RAM section.
It was found when transferring firmware to the H7 RAM via a BMP probe
using the 'gdb load' command, that the last few bytes were not
transferred, this debug marker is present to ensure all needed parts of
the firmware are present.
Example memory view of corrupted bytes at end of transfer:
0x2407DFAE DEB90000 DEB9DEB9 DEB9DEB9 DEB9DEB9 ..¹Þ¹Þ¹Þ¹Þ¹Þ¹Þ¹Þ
0x2407DFBE 000000B9 00000000 00000000 00000000 ¹...............
should be:
0x2407DFAE DEB9DEB9 DEB9DEB9 DEB9DEB9 DEB9DEB9 ¹Þ¹Þ¹Þ¹Þ¹Þ¹Þ¹Þ¹Þ
0x2407DFBE 00000000 00000000 00000000 00000000 ................
- Remove debug marker in EXST firmware.
STM32H750_EXST - Provide space for empty hash.
* Bootloader will run firmware if hash is empty, without re-verifying
RAM content against hash.
* CODE_RAM always shows as 100% usage.
STM32H750_EXST - Use a specific ELF section for a hash.
Two benefits:
1) CODE_RAM no-longer shows 100% full, since it is no-longer
padded/filled.
2) Prepares the code so that objcopy can be used to inject the hash
into the ELF.
STM32H750_EXST - Patch MD5 into ELF.
Process is now as follows.
* Binary generated (via make target dependency) so there is something to
hash.
* Binary copied (and padded).
* MD5 Hash computed.
* xxd patch file generated from hash.
* xxd hash patch applied to copy of binary at correct address.
* elf .exst_hash section dumped.
* hash injected into into dumped section.
* elf .exst_hash section updated with updated dumped section.
Replace EXST with USE_EXST.
Add documentation for the EXST firmware format.
Add table formatting to EXST documentation.
Update bootloader block.
Update H750 EXST linker script to use block format 0x00.
Use .exst.elf and .exst.bin on the exst files.
Add 'no checksum' to list of checksum hash methods.
Update EXST build system so it generates the following sets of files
obj/main/betaflight_TARGET.elf
obj/main/betaflight_TARGET.map
obj/main/betaflight_TARGET_EXST.elf
obj/betaflight_VERSION_TARGET.bin
obj/betaflight_VERSION_TARGET.bin.md5
obj/betaflight_VERSION_TARGET_EXST.bin
Update EXST build system to be more user-friendly.
* user-flashable files are generated in the normal place.
* Intermediate files are generated in `obj/main/...`
* Removes the `exst` goal.
* Adds .hex generation for EXST builds based on the patched .elf.
To build EXST targets, simply use `make TARGET=x` as normal and flash
the resulting `.hex/.bin` files rather than the .exst.bin file.
Developers can use either the `.elf` or patched `_EXST.elf` file as is
appropriate for their needs.
EXST documentation updated to match changes to build system.