Commit Graph

636 Commits

Author SHA1 Message Date
mikeller 935a684765 Fixed use of 'abs()' for floats. 2019-11-30 10:33:12 +13:00
Michael Keller 9637aba9d0
Un-ignore 'address-of-packed-member' warning. (#9241)
Un-ignore 'address-of-packed-member' warning.
2019-11-30 10:30:51 +13:00
Michael Keller 112a0ce61e
Build unified target by default. (#9240)
Build unified target by default.
2019-11-30 10:30:39 +13:00
mikeller 25daf48d3d Un-ignore 'address-of-packed-member' warning. 2019-11-29 12:43:14 +13:00
mikeller 438a801eb8 Fixed 'cast-function-type' warnings, reworked CMS function pointer juggle. 2019-11-29 03:45:27 +13:00
Michael Keller cf86671997
Un-ignore the 'attribute' warning. (#9229)
Un-ignore the 'attribute' warning.
2019-11-29 03:40:57 +13:00
Michael Keller 42588bcfef
Added NUCLEOH743 to pre-push target. (#9238)
Added NUCLEOH743 to pre-push target.
2019-11-29 01:02:46 +13:00
Kenneth Mitchell b9cae56887
Build unified target by default. 2019-11-27 22:59:32 -05:00
mikeller fd12a13b86 Un-ignore the 'attribute' warning. 2019-11-28 12:01:08 +13:00
mikeller 74976f5e3a Added NUCLEOH743 to pre-push target. 2019-11-27 20:03:36 +13:00
Michael Keller 39c8d1851e Revert the workaround for the EXST linker script. 2019-11-27 18:14:12 +13:00
Michael Keller 75dda319fb Update gcc to 9.2.1. 2019-11-27 16:08:22 +13:00
mikeller fd87829aed Fixed and un-ignored the 'stringop-truncation' warning. 2019-11-26 07:45:33 +13:00
Michael Keller 365ecaae9c
Removed the outdated official target list. (#9220)
Removed the outdated official target list.
2019-11-25 19:02:48 +13:00
Michael Keller e9b94deee5
Changed '_flash' targets to only write used segments. (#9217)
Changed '_flash' targets to only write used segments.
2019-11-25 18:46:34 +13:00
mikeller a302b5bae2 Removed ATOMIC_BARRIER check, fixed ITCM_RAM overflow. 2019-11-25 01:16:08 +13:00
mikeller 1a2b9f422a Removed the outdated official target list. 2019-11-24 19:18:47 +13:00
mikeller cce94bbe31 Changed '_flash' targets to only write used segments. 2019-11-24 15:36:40 +13:00
Steffen Windoffer 1583cb8106 add another new warning to ignore until it is fixed 2019-11-24 13:58:07 +13:00
Steffen Windoffer d216e18530 ignoring new warnings util they get resolved 2019-11-24 13:58:07 +13:00
mikeller 971ded14e4 Removed legacy targets from the list of targets built in CI. 2019-10-17 02:36:25 +13:00
mikeller c964eba295 Fixed Unified Target configuration names, added check for correctness. 2019-08-13 21:42:08 +12:00
mikeller 2c8d197ccb Added support for custom defaults in sector 0. 2019-08-11 21:32:01 +12:00
mikeller 7518ec67f5 Experimental support for on-board custom defaults. 2019-08-11 21:32:01 +12:00
Dominic Clifton a76e0bccfc EXST - Use the .bin file as the source for the hex file.
* 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.
2019-08-10 13:36:03 +12:00
Dominic Clifton 577d57ea70 EXST - Ensure HEX files are suitable for flashing using the
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.
2019-08-08 02:05:36 +02:00
Dominic Clifton 871486527b EXST - Allow targets to specify VMA offset.
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.
2019-08-08 02:04:37 +02:00
mikeller 1c60776487 Added target variant NUCLEOH743_RAMCONFIG to get CI coverage of 'EXST' changes.
Changing over to be RAM based.

Changes required for MPU configuration service.

Added documentation.
2019-07-27 18:20:05 +12:00
mikeller e65bc6cb13 Properly add hex file building to '<target>_flash'. 2019-07-03 01:51:43 +12:00
mikeller 0cc448e2b2 Make 'make <target>_flash' build the hex file as well. 2019-06-29 18:39:17 +12:00
mikeller ccf3cb6fa6 Cleaned up 'make *_clean', 'make *_flash'. 2019-06-23 15:18:41 +12:00
Dominic Clifton cf1ce1a67b Support load/save configuration to external flash
Fixes to 6a3e7d8e6 as the flash partition code had changed during
the merge to master.
2019-06-13 09:16:29 +02:00
Dominic Clifton 0632eeb934 Support compilation of EXST (EXTERNAL STORAGE) targets
- 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.
2019-06-07 09:14:49 +12:00
mikeller e5f98efdfe Fixed 'flash' make rule, added support for DFU flashing (requires 'dfu-util'). 2019-05-14 07:56:54 +12:00
mikeller d529c2ca23 Removed legacy F3 target from 'pre-push' target. 2019-05-05 16:03:12 +12:00
blckmn 4e529e1c25 moved the linker files to the src directory head 2019-04-28 16:04:44 +10:00
Mikolaj Stawiski 51d11bdee8 Improved Makefile by taking out compile_file function for repeated statements. 2019-03-19 09:25:00 +11:00
Michael Keller 022d2708c8
Merge pull request #7623 from betaflight/bf-allow-per-file-compilation-without-optimization
Allow files to compiled without optimization.
2019-03-07 03:29:31 +13:00
Dominic Clifton e35d8a25d3 Allow files to compiled without optimization.
This is required when trying to see what the optimizer is doing to the
assembly or in aiding debugging CPU IMPRECISE bus fault errors.
2019-03-06 10:34:39 +01:00
mikeller d0cb95a7e1 Fix false positives in target independence check. 2019-03-03 03:18:48 +13:00
Michael Keller 337494e700
Merge pull request #7663 from hydra/rebuild-if-linker-script-changes
Rebuild ELF if linker script is changed.
2019-02-27 19:53:33 +13:00
mikeller 35bb19d6d4 Made PRE_PUSH_TARGET_LIST settable from 'make/local.mk'. 2019-02-26 21:02:45 +13:00
Dominic Clifton dbdb6d30fc Rebuild ELF if linker script is changed.
# Conflicts:
#	Makefile
2019-02-25 23:18:20 +01:00
Michael Keller 2b29c2d7d0 Added 'pre-push' build targets, added to pull request instructions. 2019-02-25 15:57:12 +13:00
mikeller fad7ee3464 Fix missing 'platform.h' includes in compilation units, and make them stay away. 2019-02-23 17:49:25 +13:00
Michael Keller b3eedfe6af
Merge pull request #7625 from hydra/bf-rebuild-on-makefile-changes
Ensure target is rebuilt if ANY of the make files changes.
2019-02-22 04:52:25 +13:00
Dominic Clifton f475683366 Ensure target is rebuilt if ANY of the make files changes.
Prior to this, editing say make/source.mk didn't cause a rebuild.
2019-02-20 14:25:28 +01:00
blckmn 1bedb1b911 Moved hal config headers etc to ./src/main/startup 2019-02-20 18:24:16 +11:00
mikeller b329f0d70b Separate out target specific tests into the 'test-all' goal. 2019-02-03 15:54:26 +13:00
Michael Keller b36acf5576
Merge pull request #7490 from mikeller/add_makefile_test_invocations
Added 'test_help' and 'test_<testname>' targets to Makefile.
2019-01-30 00:54:00 +13:00