1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-12 19:10:32 +03:00
Commit graph

722 commits

Author SHA1 Message Date
mjs1441
b6d37008f5
Fix missing #if for PINIO_COUNT (#14515)
Allow user to supply CFLAGS_DISABLED to Makefile.
Fix missing #if..endif for PINIO_COUNT in pinio.c.
Fix other strncpy build warning/errors for build with CFLAGS_DISABLED="-flto=auto".
2025-07-06 18:13:06 +02:00
Jay Blackman
1dcc611388
PICO: Makefile uf2 support using picotool (#14402)
* Adding picotool build recipe in makefiles.

* Use semaphore in directory for default goal recipe for target

* Suggestions from coderabbitai

* Further coderabbit suggestions

* Wrong case

* Minor change to improve logic

* Further improvements.

- submodules replaced with specific submodule for pico_sdk (to avoid all developers needing this)

* Removing need for remote on git submodule update for configs, as we have the commit occurring daily.

- made sure config also build uf2

* Simplified firmware output selection for target

* Moved UF2 outside of EXST

* Missed two remnants of HEX_TARGETS

* Adding check for target

* As target is known default output can be set in platform mk file or target mk file

 - no need for file indicator (i.e. .exe or .uf2)

* Update config.mk for less verbosity
2025-06-01 04:53:54 +10:00
mjs1441
b845d6dfd8
Add SYS_INCLUDE_DIRS to top level Makefile. (#14388)
Add directories in $(SYS_INCLUDE_DIRS) to the search path via -isystem.

This allows a workaround for https://github.com/raspberrypi/pico-sdk/issues/2451 by
using system headers, which are more tolerant of macro redefinitions.

Co-authored-by: Matthew Selby <matthewjselby@aol.com>
2025-05-16 06:11:29 +10:00
Thisas
38007f8b59
Fix SITL for MacOS M1 (#14284)
* Fix SITL for MacOS M1

* move macos m1 SITL fix into SITL.mk and extract warnings flags from cflags into WARNING_FLAGS varible

* add back -Werror

* add warning about potencial issues with PG on SITL builds for MacOS apple silicon

* removed override and added CFLAGS_DISABLED and OPTIMISATION_DISABLED

* change OPTIMISATION_DISABLED to OPTIMISATIONS_DISABLED and also use it for CC_DEBUG_OPTIMISATION

* fix building useless hex

* copy instead of move

* clean new artifacts from SITL

* fix clean

* fix issue where in SITL_STATIC will build properly

* building static does not seem to work on macos

* building static does not seem to work on macos

* building static is not possible on macos

* fix issue where make TARGET=SITL still builds hex

* Move everything to CFLAGS_DISABLED and use else if chaning

* add SITL to CI_TARGETS

* add rev to SITL

* add changes suggested by ledvinap

* Update Makefile

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>

* Update src/platform/SIMULATOR/mk/SITL.mk

* Add EXE_TARGET_REVISION

---------

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
2025-04-11 20:13:09 +02:00
Mark Haslinghuis
6e9e9e39b6
Add make preview and extend CI coverage (#14187)
Add make common
2025-01-23 23:36:36 +01:00
Stepandrr
ae8d57bb06
FIX: REVISION length not more than 7 symbols (#14151)
* FIX: REVISION length not more than 7 symbols

* FIX: REVISION length changed to 9 symbols

* FIX: Updated GIT_SHORT_REVISION_LENGTH to 9

* Revert "FIX: Updated GIT_SHORT_REVISION_LENGTH to 9"

This reverts commit ec01012e44.

* Deleted REVISION cut

---------

Co-authored-by: s.salov <s.salov@rels.dom>
2025-01-23 22:56:17 +01:00
Jay Blackman
b2bafa1a8c
FIX: USE_STDPERIPH_DRIVER incorrectly defined for all targets (legacy) (#14181) 2025-01-19 09:22:37 +11:00
Jay Blackman
076d8d20ec
FIX: Makefile such that make CONFIG=config-target works as expected (#14129) 2025-01-10 19:48:44 +11:00
Jay Blackman
b826ce3df9
Ditching default target for make in favour of make all (#14099) 2024-12-24 00:21:34 +01:00
Thomas Stibor
00bcbdd897
Fix typo in Makefile for populating configuration targets (#14100) 2024-12-23 07:29:11 +11:00
Jay Blackman
8ef734408f
Adding 'size optimised' file list validity check (#14063)
* Adding 'size optimised' file list validity check

* NL at EOF
2024-12-09 15:49:26 +01:00
Jay Blackman
23605feb79
Adding check for speed optimised source validity (#14055)
* Adding check for speed optimised source validity
* Updated file location
* Common files to all HW
* Inadvertent inclusion
* VPATH reductions
- note simulator directory name change due to clash with MK file.
* Missed these MK files.
* Remove empty string
2024-12-05 07:28:02 +11:00
Jay Blackman
cfa5f0b2a1
./src/platform stage 3 (#14051)
* Removing more excludes from SITL.

* Ensure platform located files get optimised

* Fix unit test

* Revert file moves
2024-11-28 15:43:25 +01:00
Jay Blackman
53d44aa1b1
Adding common source location in ./src/platform (#14044)
* Adding common source location in ./src/platform

To enable the continued clean up of multiple files still in ./src/main/driver (more PRs to follow) that are specifically for AT32, APM32 and STM32

Source will be moved to MCU_COMMON_SRC where it is specifically for that MCU (or variant). The test will be to ensure no files in the MCU_EXCLUDES for SITL.

* Use of +=
2024-11-25 21:16:45 +01:00
J Blackman
b21cfe3282
Code re-organisation: src/platform/xxx for the MCU type (#13955) 2024-10-13 03:07:17 +11:00
Mark Haslinghuis
07bf547d42
Add STM32F4DISCOVERY to CI (#13963) 2024-10-09 06:42:47 +11:00
Petr Ledvina
3e130de49c
Makefile - remove -j0 (#13838)
Makefile - don't override user-supplied --jobs argument

Some targets will default to parallel build, but only when no
-j / --jobs argument is specified on make command line
2024-08-30 16:12:17 +02:00
J Blackman
fec8542720
FIX: make: Circular configs <- configs dependency dropped. #13695 (#13815)
- reintroduced by #13660 (possible back re-base?)
2024-08-14 10:23:41 +02:00
Petr Ledvina
a2289bc6d8
build - remove -Wpedantic (#13818) 2024-08-14 06:37:59 +10:00
Steve Evans
6e0855c296
Allow change of debug flags without forcing complete rebuild (#13708) 2024-07-29 07:29:45 +09:00
Steve Evans
7ee2c99cd4
Add all_configs make target to build all FC configs (#13660)
* Add configs_all make target to build all FC configs

* Update Makefile

Change from `configs_all` to `all_configs`.

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>

---------

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
2024-07-27 17:54:58 +02:00
J Blackman
c2c3d6740c
CLEANUP: MCU file locations (#13692) 2024-06-22 09:21:08 +10:00
J Blackman
660018b1de
FIX: make: Circular configs <- configs dependency dropped. (#13695) 2024-06-17 21:30:08 +02:00
J Blackman
a49c5c3a35
Adding initial H563 target files in preparation (#13686)
* Adding initial H563 target files in preparation
* Start up files
* Explicit inclusion of source files for @ledvinap suggestion
- adding system_stm32h5xx.c
2024-06-16 12:57:35 +10:00
Mark Haslinghuis
1074950e42
Update ARM SDK (#12286)
* Update ARM SDK
* Add ARM_SDK_BASE_DIR
* Update ARM SDK to latest 13.2.Rel1
2024-05-30 13:06:42 +10:00
Petr Ledvina
6ba4944a9f
build - trigger rebuild on change of most flag change (#13596)
Sometimes, files with different build flags are mixed, producing
broken result. With this change, most flags are hashed and force
rebuild if changed.
2024-05-24 17:46:57 +10:00
Steve Evans
79d031b8b6
Ensure consistent openssl behaviour with version 3.2.x and 3.3.x (#13385)
Ensure consistent openssl behaviour with verion 3.2.x and 3.3.x
2024-02-26 23:21:20 +01:00
Mark Haslinghuis
c6250fee6e
Add autocomplete for hydrating configuration (#13378) 2024-02-22 20:50:02 +01:00
Steve Evans
08570cadce
Add support for 'make CONFIG_clean' as per 'make TARGET_clean' (#13038) 2023-08-18 10:02:00 +02:00
Dominic Clifton
2edc5fb7d5
Makefile - use -gddb2, not -gddb3 due to issues with GDB crashing. (#12971)
Makefile - use gddb2, not gddb3 due to issues with GDB crashing.

The cause seems to be the macro debugging information which when generated by the compiler, apparently incorrectly, causes GDB to use excessive amounts of CPU and crash.

Error:
"gdb/utils.c:717\
: internal-error: virtual memory exhausted: can't allocate 4064
bytes.\nA problem internal to GDB ha\
s been detected,\nfurther debugging may prove unreliable."

Reference:

* https://sourceware.org/bugzilla/show_bug.cgi?id=28219#c15
* https://github.com/microsoft/vscode-cpptools/issues/9219#issuecomment-1118034083

Note this crashing behavior is observed with `GCC > 9.3.1`, `9.3.1` itself is OK.
2023-07-26 08:53:10 +10:00
Dominic Clifton
6ba117d69e
Improve CI target visibility (#12930)
* Add SPRacingH7RF to CI targets.

* It uses memory-mapped flash.
* It uses OctoSPI.
* It uses EXST.

* Add SPRACINGH7EXTREME to CI targets.

* It uses QuadSPI.
* It uses EXST.
2023-06-30 10:02:25 +10:00
Eike Ahmels
3f80b0c8bf
Implement DShot bit bang for AT32 (#12577)
* implement dshot bitbang for AT32

* fix dshot bitbang bidirectional for AT32

* AT32 target features

* implement latest improvements from steve to at32

* generalize AT32 target.h

* Tri-state USART TX output if load due to powered down peripheral is detected

* enable LED STRIP for AT32

* at bitbang timer adjustments

* revert makefile changes

* revert target generalization

* Update src/main/drivers/at32/platform_mcu.h

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>

---------

Co-authored-by: Steve Evans <Steve@SCEvans.com>
Co-authored-by: J Blackman <blckmn@users.noreply.github.com>
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
2023-06-22 07:31:16 +10:00
Dmytro
7b39d3d296
Rename make folder to get rid of build error. (#12880)
When trying to build firmware with current directory in PATH environment
it scans for make command and generates "Permission denied" error in
case if current directory in PATH precedes /usr/bin/ directory.In my
case it was caused by incorrect pyenv init script.

Rename make folder to avoid errors like this.
2023-06-14 21:48:55 +02:00
Mark Haslinghuis
eb4d95e039
[CONFIG] Add NUCLEOF446 Development Board (#12678)
Add NUCLEOF446 Development Board
2023-06-14 13:42:33 +10:00
J Blackman
6e05967840
Config handling updated to using repository for hydration (#12714)
* Modification to allow src/config to be a repo within a repo.

* Moving config files to own repository, and including using make.

* Removing all old config files.

* Correct CI errors.

* Playing with pulling the configuration files from the API

* Attempt to get past github actions issue

* Adding additional assistance when configs not hydrated

* Move the workflow to support hydration before outputing target list.

* Correction for revision targets

* Requires additional config hydration

* Better messaging on what to do:

- when you have a local config.h for a new target, ignore hydration of target list if you are building the target config in question.
- when you are doing any activity that does not require hydration, e.g. printing out help or installing arm_sdk etc.

* Anything suffixed with clean should be allowed through

* Adjusting to simply use a copy of the repository. Noting we will need to decide whether or not to include MFTR name in the config directory or not.
2023-05-10 11:12:07 +02:00
J Blackman
ba01a6a48d
Obtain HSE_VALUE from config.h where provided. (#12632) 2023-04-13 13:33:45 +10:00
J Blackman
ee77239db1
Removing Custom Defaults (#12425) 2023-03-02 19:39:44 +01:00
J Blackman
6bbd49a3f9
Adding VMA address to config.h (#12386) 2023-02-23 22:58:28 +11:00
J Blackman
166ff9c9b3
FIX: Several build issues following configuration changes (#12389)
* FIX: Several build issues following configuration changes

1. RX_SPI pins undefined
2. SDCARD enabled but no utilisation (i.e. no blackbox selected).

* Improved readability (readiness for "black" macro magic)

* Adding Makefile rule to enable CI targets to include Configured targets
2023-02-20 15:17:45 +01:00
J Blackman
69c779c0f7
Makefile Cleanup - further simplification of local building (#12354)
* Makefile Cleanup - further simplification of local building

Can now use the commands:

make BETAFLIGHTF4

make BETAFLIGHTF4_clean

make configs

Target objects for config are now kept separate, so changing a config in use will rebuild as required.

* Minor correction for cummulative use in naming target
2023-02-14 16:44:20 +01:00
J Blackman
693f55dcff
Simplified Local Build using Permanent Config (#12341) 2023-02-11 14:02:18 +11:00
Dominic Clifton
b3053be4dd
OctoSPI and Memory Mapped Flash support (#11825)
* STM32H730/STM32H750 - Fix use of USE_LP_UART1 instead of USE_LPUART1.

* STM32H723 - Prepare for being able to build for using non-internal-flash
config storage.

* STM32H723 - Prepare for using non-default strings.

* STM32H723 - Disable 'use custom defaults' when using USE_EXST.

* STM32H723 - Disable CUSTOM_DEFAULTS_EXTENDED when EXST is used.

* OCTOSPI - Add initialisation code.

* Add support for RAM_CODE.

* STM32H730 - Add support for RAM_CODE via the .ram_code attribute.

* OCTOSPI - Proof-of-concept for disabling/enabling memory mapped mode on
a running system.

NOTE: The HAL libs are compiled into a memory mapped region, and this cannot be used for OctoSPI access when memory mapped mode is disabled.

* OCTOSPI - Drop HAL support after determining that it's not suitable for
the memory mapped flash use-case.

* OCTOSPI - Sometimes, when disabling memory map mode, the abort fails.
Handle this by disabling the OSPI peripheral first and re-enabling it
afterwards.

* SD/FLASH - Update comments regarding possible solutions to the catch-22
issue with SD/SPI/QUADSPI/OCTOSPI pin configurations.

* OCTOSPI - Use device instance directly.

* OCTOSPI - Prepare W25Q flash driver for octospi support.

* OCTOSPI - Add octospi flash detection.

Note: The method to detect flash chips is similar to the method used for
QUADSPI and as such the code was used as a base. However the initial
OCTOSPI implementation doesn't support the non-memory-mapped use-case so
the un-tested code is gated with `USE_OCTOSPI_EXPERIMENTAL`.

The key differences are:
* uses octospi api not quadspi api.
* flash chip clock speeds should not be changed for memory-mapped flash
chips, bootloader already set it correctly.
* only certain flash chips are capable of memory mapped support.

* W25Q - Ensure w25q128fv_readRegister returns 0 if the receive fails.

* OCTOSPI - Implement octoSpiTransmit1LINE, octoSpiReceive1LINE and
octoSpiReceive4LINES.

* OCTOSPI - Specify device from init.

* OCTOSPI - More fixes and work on init.

Current status is that memory mapped mode is disabled and flash chip is
detected, but w25q128fv_detect should not be calling w25q128fv_reset.

* FLASH - Add comment regarding wasted flash space on targets that only
use one bus type for the flash chip.

* FLASH - Split `detect` into `identify` and `configure`.

* OCTOSPI - Extract flashMemoryMappedModeEnable/Disable to separate
methods.

* FLASH - Reduce size of targets that don't support the use of multiple
flash interfaces.

* Single-flash-chip targets usually only support one type of io
interface.
* Without this, compiler warnings are generated in `flashSpiInit` for
targets that only use flash chip drivers that support quadspi or octospi
that don't even use SPI for flash.

* FLASH - Use MMFLASH_CODE/DATA to conditionally move code/data to RAM.

Only targets compiled to support memory mapped flash chips need the some
specific code in RAM.  Otherwise the code/data should be in the normal
linker section.

* FLASH - W25Q Prepare for memory mapped flash usage.

* Wait/Delay functions must work with interrupts disabled.
* Code used for reading/writing must run from RAM.

* OCTOSPI - Implement remaining required methods.

* OCTOSPI - Fixes for earlier code (not last commit).

* FLASH - W25Q update timeout values from Datasheet Rev L.

* FLASH - Prepare flash driver for use when memory mapped flash is
disabled.

* System - Prepare microsISR for use when memory mapped flash is disabled.

* FLASH - Add support for CONFIG_IN_MEMORY_MAPPED_FLASH.

* Flash - Fix incorrect gating on cli flash commands.

When compiling with USE_FLASH_CHIP and without USE_FLASHFS there were
compiler warnings.

* MMFLASH - Fix release-mode build.

* FLASH - Allow SPI pins to be reconfigured when using CONFIG_IN_MEMORY_MAPPED_FLASH.

MMFLASH only works via QuadSPI/OctoSPI peripherals.

* EXST - Disable the 2GB workaround which is now causing a different
error.

The error we get with 'remove-section' enabled is:

"error in private header data: sorry, cannot handle this file".  The
cause of this new error in the objcopy codebase is an out of memory
condition, somehow the 2GB files and this error are related but the root
cause of both is still unknown.

* OCTOSPI - Add support for STM32H723.

* STM32H723 - Add linker scripts for EXST usage.

* NucleoH723ZG - Add build script to demonstrate OCTOSPI and Memory Mapped
flash support.

* FLASH - WUse the size in bits to set the size of the buffer.

* FLASH - Fix typo in W25N driver defines.

Was using W28N instead of W25N

* OCTOSPI - Fix missing semilcolon when compiling without
USE_FLASH_MEMORY_MAPPED.

* OCTPSPI - Fix missing call to 'memoryMappedModeInit'.

* SPRacingH7RF - Add example build script to allow for testing prior to
unified target / cloud-build support.
2023-02-04 06:24:01 +11:00
J Blackman
74be33dfbc
AT32 development, introduction of AT32F435 target (#12247)
* AT32F435: new target (#12159)
* AT32F435: New target (WIP)
* IO and Timer Updates
* Adding pseudonyms for the STM TypeDef items.
- implementation to follow
* Adding config_streamer support for AT32
* Implementation for IO
* Adding in Peripheral mapping from emsr.
* Warnings cleanup for AT drivers
* Getting things to the linking stage
* Add AT-START-F435 LEDs as default in AT32F435 as a temporary measure to aid bringup
* Remove tabs
* Enable selection of serial port to use for MSP
* Setup defaults for AT-START-F435 to use MSP on UART1
* Fix for most recent 4.5.0 Makefile changes
* Solve for sanity check.
* Add AT32F435 MCU type
* Fix compilation issue with SITL
* Merge conflict resolution
* Minor cleanup
* Adding line feed.

---------

Co-authored-by: Steve Evans <Steve@SCEvans.com>
2023-01-31 11:31:23 +11:00
J Blackman
ecdbba2ce2
Cleanup make (#12179)
* Cleanup Makefiles

Given the targets are now simply the MCU, there is now a significant amount of duplication.

TODO:
- will possibly add STM32.mk for inclusion from STM32F4 etc to remove further duplication.

Noting it is now imperative that the gating is right.

* Removed the remnants of "features"

* Further clean up in preparation of new MCUs

* Typo for STM32F722xx

* Fix F411

* Last remnants of the _TARGETS lists.
2023-01-29 01:51:06 +01:00
J Blackman
dc940e3132
FIX: EXTRA_FLAGS not forcing a rebuild when changed. (#12116) 2022-12-31 13:04:30 +01:00
J Blackman
af1001a35c
FIX: USE_PWM not working (#12004) 2022-11-18 18:10:32 +11:00
blckmn
b6b76d1b88 Adding board scratch space.
- Including ability to define custom defaults as char[] that is baked into the build
- removed unnecessary size of custom defaults header parsing (defines provided by build process or in board.h for devs).
2022-10-30 17:43:43 +11:00
blckmn
06c5bb40b5 Final target cleanup 2022-10-25 14:28:13 +11:00
KarateBrot
ddf1d46549 Remove old style definitions 2022-10-13 03:33:54 +02:00
J Blackman
17c5420882
Merge branch 'master' into github-action-build 2022-07-08 15:00:31 +10:00