1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 14:25:20 +03:00
Commit graph

696 commits

Author SHA1 Message Date
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
haslinghuis
73934cccc0
Merge pull request #11032 from daleckystepan/gcc10
Support for GCC 11.2.1
2022-07-06 02:41:14 +02:00
Štěpán Dalecký
4cf54f9ddc Support for GCC10 and some compilation tuning 2022-06-30 01:56:50 +02:00
blckmn
9bb1f18a82 Removing OPBL support. 2022-06-28 00:50:40 +10:00
J Blackman
de4c4474d8
Merge pull request #11682 from daleckystepan/lib_usb_fs_remove 2022-06-28 00:18:29 +10:00
blckmn
413d23c66b Adding make all_rev goal 2022-06-26 08:47:05 +10:00
blckmn
916ccf39de Removed commit hash (revision) from filename by default. Can still be generated by:
make hex_rev TARGET=XXX
  make TARGET_rev
2022-06-25 17:05:24 +10:00
haslinghuis
8ee84d011f
Revert "Create variably named files as an additional make step." 2022-06-22 03:08:37 +02:00
Štěpán Dalecký
be8fbcdaac Remove unused STM32 USB FS lib 2022-06-21 14:01:32 +02:00
haslinghuis
b28b07eb95
Merge pull request #11659 from hydra/step-for-conditionally-named-artifacts
Create variably named files as an additional make step.
2022-06-16 23:55:41 +02:00
haslinghuis
608615642a
Merge pull request #11658 from hydra/gdwarf5-support
Use gdwarf-5 debugging information.
2022-06-16 22:07:43 +02:00
Dominic Clifton
67887df139 Create variably named files as an additional make step.
e.g. betaflight_4.2.0_SPRACINGH7CINE_3c367e7be4.hex from
betaflight_4.2.0_SPRACINGH7CINE.hex

* Default goals unchanged
* Some developers use external tools that require fixed filenames.
2022-06-15 14:22:49 +02:00
Dominic Clifton
2d041c9936 Use gdwarf-5 debugging information. 2022-06-15 14:15:29 +02:00
Steve Evans
701b0ae55c Remove F1 and F3 support 2022-06-14 19:10:13 +01:00
blckmn
eb3209ec45 Additional comment clarity. 2022-01-07 15:00:57 +11:00
blckmn
90f609fa99 Makefile changes to support RELEASE=yes to simplify naming, and also remove the production of the bin file by default.
Bin files can still be made using: make bin TARGET=xxx
2022-01-07 14:58:56 +11:00
Mathias Rasmussen
abef8eaa3c Use GitHub Actions for CI 2022-01-06 23:18:27 +01:00
Dominic Clifton
a325e2386d STM32H730 - Initial ST32H730 support.
The H730 is a value-line CPU, similar to the H723/H725, but with only
128kb RAM.

The FC firmware code is designed to RUN from external flash in MEMORY
MAPPED mode, via OctoSPI.  Use of ITCM/DTCM advised for core loops, like
PID control.

A bootloader is required to enable memory-mapped mode and jump to the
firmware, similar to how EXST bootloader system works.

Config storage is not part of this commit and is a problem when using a
single flash chip in memory mapped mode because the CPU can't run
read/write routines from the flash chip while writing to the flash chip.
Until flash read/write routines are updated the solution requires either
a second flash chip on an SPI interface, or the use of an SD card for
config storage.

Additional commits will support read/write of config to the code/data
storage flash chip to enable cheap and space efficient single-flash-chip
FC solutions.

Squashed commits:
STM32H730 - Workaround issue with 2GB `.elf` files being created.
STM32H730 - Reduce firmware size to 1MB.
STM32H730 - Add USB HS configuration.
STM32H730 - Add ADC internal tag mappings.
STM32H730 - Update all ADC mappings based on the referenced ST
documentation.  Add the VBAT channels.
STM32H730 - Fix DMA continuous requests.
STM32H730 - Fix ADC_INTERNAL confusion.
STM32H730/G4 - Disambiguate use of ADC_CHANNEL_INTERNAL_FIRST_ID.
STM32H730 - Fix documentation reference.
STM32H730 - Add DMA request mapping for ADC3.
STM32H730 - Explicitly set the ADC clock.
STM32H730 - Configure PLL2 speeds correctly.

* Tested with Ultrafast 64GB SanDisk SDXC card.

STM32H730 - Use 50Mhz clock for SDXC cards.

* Tested with SanDisk Ultra 64GB.  100Mhz clock gave CRC errors.

STM32H730 - Ensure USB has a lower NVIC priority than the SDMMC card
reads.

If it's higher, 0, then the SDMMC's DMA IRQ handler doesn't get called
when handing USB MSC storage reads.

STM32H730 - Support CPU name in CLI.

STM32H730 - Rebuild when linker scripts changes.
2021-12-23 15:02:23 +01:00
Dominic Clifton
4fcf752655 Fix objcopy 'memory exhausted' error when extracting the EXST hash
section.

References:
* https://stackoverflow.com/questions/5235009/huge-binary-files-with-objcopy
2021-12-23 12:36:02 +01:00
Michael Keller
ae65d6eb07 Add constant (i.e. string) deduplication, including at link time. 2021-11-07 14:27:36 +13:00
Michael Keller
8f0cfdbe27 Fixed comment in Makefile. 2021-10-04 23:36:31 +13:00
Michael Keller
8570c54c11 Fixed the 'make pre-push' build on MacOS. 2021-08-04 17:29:51 +12:00
mikeller
03d3d94497 Added Unified Target for STM32G4. 2021-04-26 16:18:28 +12:00
Michael Keller
5da56bda05 Minor Makefile improvement. 2021-01-03 19:51:02 +08:00
Michael Keller
6eb7222af6 Removed unused BUILD_DIR target from Makefile. 2021-01-01 10:12:20 +01:00
mikeller
835091992a Use PYTHON environment variable in Makefile. 2020-10-12 03:22:58 +13:00
mikeller
c128f33a85 Added STM32F4DISCOVERY_DEBUG target and added it to pre-push. 2020-07-22 02:18:25 +12:00