Commit Graph

654 Commits

Author SHA1 Message Date
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
mikeller 4bd9605d2a Added 'test_help' and 'test_<testname>' targets to Makefile. 2019-01-28 20:39:05 +13:00
mikeller 8c2a896025 Added 'test-representative' make target to run a representative subset of the unit tests. 2019-01-28 00:08:01 +13:00
mikeller 5c4d94457c Added the ability to print lists of targets by MCU type to the Makefile. 2019-01-19 15:09:26 +13:00
mikeller 5b3f54874d First wave of feature cut conversions: CHEBUZZF3, MIDELICF3, and SPRACINGF3EVO. 2019-01-19 00:53:09 +13:00
mikeller 2e000506c8 Renamed to 'FEATURE_CUT_LEVEL', added 'FORCE_FEATURE_CUT_LEVEL' command line option. 2019-01-17 09:03:35 +13:00
Michael Keller 776549785d For discussion: Take a methodical approach to dealing with flash overflows. 2019-01-16 15:56:10 +13:00
Dominic Clifton 2584a90134 Ensure debug symbols are generated for startup code when needed. 2018-12-10 19:50:59 +01:00
mikeller 3be377bde1 Fixes for NRF24 SPI RX drivers. 2018-08-31 00:10:15 +12:00
mikeller 4ec481a843 Added '-fno-common' build option, fixed resulting problems. 2018-08-30 18:58:34 +12:00
mikeller 581628eeb4 Switch to GNU11 language standard. 2018-08-19 10:33:32 +12:00
Michael Keller 2293462324
Added more verbosity. 2018-07-22 12:08:31 +12:00
mikeller 5c16c50826 Added per-MCU-type build targets. 2018-07-22 11:24:07 +12:00
Anders Hoglund 0185018973 Build target groups populated dynamically. 2018-07-16 18:10:03 +02:00
mikeller 7a2192d13e Fixed typo in 'Makefile'. 2018-05-27 10:53:50 +12:00
Andrey Mironov ed72803858 Added FAST_RAM usage correctness check 2018-05-23 14:40:33 +03:00
Andrey Mironov eac01a6ad6 Replaced PCRE with egrep for macOS users 2018-05-22 12:00:16 +03:00
mikeller e823920662 Added memory usage output to linker. 2018-05-16 23:17:03 +12:00
mikeller 3a149dd450 Rebased, fixed regex for target name at end of line. 2018-05-14 19:18:20 +12:00
mikeller 4c11c6666b Fix from review. 2018-05-14 19:13:37 +12:00
mikeller ede204aa81 Removed some target dependencies, and added makefile target 'check-target-independence' to find dependencies. 2018-05-14 19:13:37 +12:00
jflyper 35df29f0bc Use nomk to signify no build target name 2018-05-05 01:13:12 +09:00
Michael Keller f53d79d13f
Changed 'relwithdebinfo' debug option to more memorable name. (#5690) 2018-04-16 23:08:33 +12:00
Andrey Mironov a3f33f996f Added release with debug info DEBUG type 2018-04-12 10:03:50 +03:00
Petr Ledvina eee15e7ca4 Implement minimalistic strcasestr (#5411)
* Implement minimalistic strcasestr

* fixup! Implement minimalistic strcasestr

* Add _GNU_SOURCE

Enable gcc extensions

* fixup! fixup! Implement minimalistic strcasestr
2018-03-15 02:17:23 +13:00
Vishal Verma 2074dbb004
Makefile: fix clean_all trying to cleean SKIP_TARGETS
clean_all or all_clean were trying to clean SKIP_TARGETS too, resulting
in:

    make/targets.mk:15: *** The target specified, ALIENWHOOP, cannot be
        built. Use one of the ALT targets: ALIENWHOOPF4 ALIENWHOOPF7.  Stop.

Remove SKIP_TARGETS from the clean lists.
2018-02-21 11:12:50 -07:00
Anders Hoglund 1605b15cff Clean up the verbosity usage with echo commands in makefiles. 2017-12-30 16:28:52 +01:00
blckmn 7036ad9074 Removed ITCM_RAM warning by defining the region. 2017-12-22 09:20:40 +11:00
Michael Keller 5ae3933db4 Changed make target for 'all' to not include unsupported, added 'all_with_unsupported' (formerly 'all') and 'unsupported' targets. 2017-10-18 09:56:44 +13:00
Michael Keller e6fdd266e0 Removed F1 targets from the target lists used for CI, added warning about deprecation. 2017-10-17 11:34:09 +13:00
Steffen Windoffer 03aa31acdd remove not needed whitespaces 2017-08-24 11:33:39 +02:00
Anders Hoglund ab232e8828 Remove hardcoded unconditional measurement of target build time. 2017-08-17 11:29:17 +02:00
blckmn 2dca6a5bbc Preparation for F4 being LL enabled.
Updated F7 to use latest HAL / LL libraries
2017-07-29 23:02:39 +10:00
fishpepper b57c3ea5d8 adding openocd-gdb command to makefile 2017-07-25 23:24:16 +02:00
blckmn 6151ded961 Low level driver for SPI for F7 2017-07-23 20:53:45 +10:00
blckmn 61cfb0aedf Some separation in the Makefile 2017-07-21 07:51:13 +10:00
Martin Budden cf9d20bede Merge pull request #3413 from martinbudden/bf_gyro_spi_tidy
SPI tidy. Rename SPI functions. Rationalise parameter order.
2017-07-20 19:31:57 +01:00
Martin Budden 2fd20c2bd9 Rename SPI functions. Rationalise parameter order. 2017-07-20 16:22:59 +01:00
Martin Budden 6943fb8e56 Split MSP box code into separate module 2017-07-20 13:33:34 +01:00
Martin Budden 657c88c767 Merge pull request #3567 from brucesdad13/target-alienwhoop
SKIP_TARGET for make clean_all
2017-07-20 05:58:01 +01:00
brucesdad13@gmail.com 5c413726fa Complement for SKIP_TARGET PR #3545 to skip same targets for clean_all etc. 2017-07-19 20:15:29 -04:00
jflyper ec8592d779 Rebased 2017-07-18 17:45:55 +09:00
jflyper 46b3a7c9b0 Define and use i2c functions that accept busDevice_t 2017-07-18 16:46:23 +09:00
Michael Keller dcc600a78b Merge pull request #2727 from DieHertz/camera-control
Camera OSD control
2017-07-18 06:47:57 +08:00
Michael Keller 9e73acf73b Inverted when the SKIP_TARGET warning is being shown. 2017-07-17 19:01:14 +08:00
brucesdad13@gmail.com d1b331baea * @mikeller asked if I would "[add] a warning message if targets are not built because of `SKIP_TARGETS`" to avoid confusion and frustration. I've put it at the beginning of the build process.
- Charlie Stevenson
2017-07-16 23:46:48 -04:00
Martin Budden dcb21a92c1 Merge pull request #3527 from brucesdad13/target-alienwhoop
New ALIENWHOOP target
2017-07-16 07:43:42 +01:00
DieHertz cc358dc405 Implemented Camera Control using Hardware and Software PWM 2017-07-16 02:23:31 +03:00
brucesdad13@gmail.com 7fcc0b0a20 Renamed define DUMMY_TARGETS to SKIP_TARGETS in last commit but forgot to update where it was used. No more late night commits :D
~ Charlie Stevenson
2017-07-15 02:39:35 -04:00
brucesdad13@gmail.com ec2e764a55 Changed define name from DUMMY_TARGETS to SKIP_TARGETS per @blckmn request
~ Charlie Stevenson
2017-07-15 02:33:35 -04:00
brucesdad13@gmail.com 60bfe6905f Added list of DUMMY_TARGETS (folder names that aren't actually targets) to be removed from VALID_TARGETS before build. Currently only ALIENWHOOP proposed target falls into this category. It would potentially be a nice way to clean up some of the other targets where only the arch and a few sensors differ.. thoughts?
~ Charlie Stevenson
2017-07-15 02:23:39 -04:00
brucesdad13@gmail.com 4de1f747fe * Updated Makefile to hopefully appease travis
* Undefined VTX-related in target.h.. not currently used on target and caused warnings...
~ Charlie Stevenson
2017-07-15 00:57:06 -04:00
blckmn eab46fa1b5 DYSF4PRO target 2017-07-15 14:43:40 +10:00
jflyper 5a7054f704 Merge branch 'master' into bfdev-configurable-escserial-pin 2017-07-09 12:58:04 +09:00
Martin Budden 4ca50db206 Revisited which modules are compiled with speed optimisations 2017-07-04 21:00:39 +01:00
fishpepper f9cd4c3800 added make target for lst output 2017-07-03 20:57:00 +02:00
jflyper f78ced9a4d Converted target.h
[Converted]
AIR32: entry 0 PA4
AIRHEROF3: entry 0 PA0 (PPM)
ALIENFLIGHTF3: entry 0 PB14
ALIENFLIGHTF4: entry 0 PA8 (PPM)
BEEROTORF4: entry 0 PA3 (PPM)
BETAFLIGHTF3: entry 0 PB7 (PPM)
BLUEJAYF4: entry 0 PC7 (PPM)
CHEBUZZF3: entry 0 PA8
CLRACINGF4: entry 0 PB9 (PPM)
COLIBRI: entry 0 PA10 (PPM)
COLIBRI_RACE: entry 0 PA8 (PPM)
DOGE: entry 0 PA8 (PPM)
F4BY: entry 8 8 PA0
FF_FORTINIF4: entry 0 PB0
FF_PIKOBLX: entry 0 FF_RADIANCE||FF_KOMBINI PA7 else PA4
FF_PIKOF4: entry 0 PA3
FISHDRONEF4: entry 0 PB0 (PPM)
FRSKYF3: entry 0 PB9
FRSKYF4: entry 0 PB8 (PPM)
FURYF3: entry 0 PB3 (PPM)
FURYF4: entry 0 PC9 (PPM)
IMPULSERCF3: entry 0 PA15 (PPM)
IRCFUSIONF3: entry 0 PA0 (PPM)
ISHAPEDF3: entry 0 PA0 (PPM)
KAKUTEF4: entry 0 PC7 (PPM)
KISSFC: entry 6 PA13 (Common to KISSFC & KISSCC)
KIWIF4: entry 0 PA3
LUX_RACE: entry 0 PA8 (PPM)
MOTOLAB: entry 0 PA4
MULTIFLITEPICO: entry 0 PA0 (PPM)
OMNIBUS: entry 0 PB4 (PPM)
OMNIBUSF4: entry 0 PB8 (OMNIBUSF4SD,PPM) PB14 (else, PPM)
RACEBASE: entry 0 PA0 (PPM)
RCEXPLORERF3: entry 0 PA8
REVO: entry 0 PB14 (PPM)
REVONANO: entry 0 PB10 (PPM)
SINGULARITY: entry 0 PA15 (PPM)
SIRINFPV: entry 0 PB11 (PPM)
SPARKY: entry 0 PB15
SPARKY2: entry 0 PC7 (PPM)
SPRACINGF3: entry 0 PA0 (PPM)
SPRACINGF3EVO: entry 0 PA15 (PPM)
SPRACINGF3MINI: entry
SPRACINGF3NEO: entry 0 PA3 (PPM)
SPRACINGF4EVO: entry 0 PA3 (PPM)
SPRACINGF4NEO: entry 0 PA3 (PPM)
STM32F3DISCOVERY: entry 0 PB8 (PPM)
VRRACE: entry 0 PE9 (PPM)
X_RACERSPI: entry 0 PA0 (PPM)
YUPIF4: entry 0 PC8 (PPM)

[No ESCSERIAL defined (non-F7)]
ALIENFLIGHTF1
CC3D
CJMCU
CRAZYFLIE2
ELLE0
KROOZX
LUMBAF3
MATEKF405
MICROSCISKY
NAZE
RG_SSD_F3
SITL
SPRACINGF3OSD
TINYFISH

[No ESCSERIAL defined (F7)]
ANYFCF7
ANYFCM7
CLRACINGF7
FURYF7
NUCLEOF7
NUCLEOF722
OMNIBUSF7

[ESCSERIAL disabled]
ALIENFLIGHTNGF7: entry 0 PA8 (PPM) DISABLED
NERO: entry 0 PC7 (PPM) DISABLED
2017-07-03 00:37:00 +09:00
jflyper d18a06f721 Merge remote-tracking branch 'betaflight/master' into bfdev-configurable-spi-phase-1 2017-07-02 11:06:50 +09:00
blckmn 67d2c3ef25 Minor makefile change to support windows better
Removed uninitialised warnings
2017-07-02 06:55:14 +10:00
jflyper ac668e2c6d Merge branch 'master' into bfdev-configurable-spi-phase-1 2017-06-24 15:27:57 +09:00
jflyper 0c803f23d2 Cherry-picked #3321 (Preset CS lines for SPI devices initial high) 2017-06-24 12:44:01 +09:00
Martin Budden cca6d1ad6a Merge pull request #3321 from jflyper/bfdev-set-spi-cs-initial-high-2
Preset CS lines for SPI devices initial high
2017-06-23 10:36:16 +01:00
jflyper 7a52f91975 Make SPI pins configurable 2017-06-23 11:12:10 +09:00
Dominic Clifton 32fa109a64 Merge pull request #2852 from azolyoung/add-runcam-split-support
Add runcam split support
2017-06-23 08:48:07 +12:00
jflyper 682d4d4014 Preset CS lines for SPI devices initial high 2017-06-20 21:10:31 +09:00
borisbstyle 98b301f1e8 Merge pull request #3302 from blckmn/config_led
Making status LEDs configurable.
2017-06-19 08:19:06 +02:00
Dominic Clifton db006b1585 Merge pull request #2856 from ledvinap/improvement-64bit-boxid
array based box masks
2017-06-19 13:31:08 +12:00
blckmn 3cfcf8a4b3 Fix for SITL target 2017-06-19 06:35:40 +10:00
Michael Keller e7a02c819c Merge pull request #3229 from jflyper/bfdev-i2c-configurable-rework
Configurable I2C (rework)
2017-06-16 09:11:25 +12:00
jflyper 52bfef1ea5 Configurable I2C (rework) 2017-06-16 01:20:32 +09:00
Michael Keller a139e71750 Merge pull request #3247 from jflyper/bfdev-additional-transponders
Porting aRCiTimer and ELRT from CF
2017-06-14 12:42:40 +12:00
Cheng Lin 7bdb03c7f7 Change Makefile match target name CLRACINGF4 2017-06-13 16:38:03 -04:00
Dominic Clifton fac694ce4b Cherry-pick CF/fbb3f92 2017-06-11 02:07:17 +09:00
Dominic Clifton a4ee4102d7 Cherry-pick CF/9f7f2f2 2017-06-11 01:47:01 +09:00
frsky 3638dab351 Added FrSky F3 / F4 targets.
Add frsky f3 directory

add F4

ADD F4 CONFIG.C

restore rx.c and fix some issues

restore Makefile

restore Makefile

1.USE DEF_TIM in target.c
2.remove unneeded include and config items in xonfig.c
3.adjusted indentation in all of the files.

solve the whitespace issue in taget.c and config.c
In FRSKYF3/target.h remove the line UNDEF USE_I2C

Fixed tabbing.
2017-06-09 14:34:00 +12:00
Michael Keller 671d453709 Merge pull request #3097 from jflyper/bfdev-uart-refactor-and-configurable
UART refactor and configurable
2017-06-05 08:35:29 +12:00
Martin Budden da042a2331 Merge pull request #3200 from mikeller/added_spracingf4neo
SPRACINGF4NEO - Initial target support.
2017-06-04 15:14:26 +01:00
Dominic Clifton 08b401737b Merge pull request #2835 from cleanflight/spracingf4neo
SPRACINGF4NEO - Initial target support.
2017-06-04 11:16:22 +12:00
Dominic Clifton 4dca2d3ddc Merge pull request #2837 from cleanflight/size-optimize
CF/BF - Always size optimize some non-speed critical files.
2017-06-04 10:39:42 +12:00
Michael Jakob 337d9823a3 Final reduction of targets 2017-05-29 21:08:38 +02:00
Michael Jakob 6050bd4600 Rename FuriousFPV targets (prefix all with FF_) 2017-05-29 20:48:25 +02:00
Michael Jakob ee582df432 Adding various PikoBLX based FuriousFPV targets 2017-05-29 20:48:22 +02:00
Michael Jakob c68e2e1bbf FuriousFPV PIKOF4 target support 2017-05-29 08:01:53 +02:00