1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 04:15:44 +03:00
Commit graph

18431 commits

Author SHA1 Message Date
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
Mark Haslinghuis
e9269507ae
Remove duplicate and sort *_SRC files [H7] (#12282)
Remove duplicate and sort *_SRC files
2023-02-03 14:24:24 +11:00
Dominic Clifton
9850749afa
Fix missing CUSTOM_DEFAULTS for H730/H750 targets. (#12261) 2023-02-03 06:26:28 +11:00
Mark Haslinghuis
7207892ab1
Revert "Update ARM SDK to 11.3rel1" (#12285) 2023-02-02 21:13:53 +11:00
Mark Haslinghuis
8ca013dfc5
Update ARM SDK to 11.3rel1 (#12146) 2023-02-02 04:13:18 +01:00
Steve Evans
e5cd2cad7b
Fix max permissible CMS rows and up/down page arrows (#12277)
* Fix max permissible CMS rows and up/down page arrows

* For CMS displays of 30 columns or less shrink width of menu to fit

* Fix string overflow

* Use 'v' for down arrow rather than 'V' as it's less ugly as devices without OSD character set can display lower case
2023-02-01 23:51:58 +01:00
J Blackman
33a96bb5f6
Source file re-arrangement for better separation of MCU types (#12268)
Source file re-arrangement for better spearation of MCU types

- Move STM32 specific files to drivers/stm32
2023-02-01 01:12:34 +01:00
Mark Haslinghuis
a3b7d74016
Update ISSUE Template to require Support ID Only (#12259) 2023-02-01 04:55:03 +11:00
J Blackman
7604b05a00
Enable retrieval of the BUILD_KEY using MSP2 (#12264)
* Enable retrieval of the BUILD_KEY using MSP2

* Repositioning
2023-01-31 17:50:55 +01:00
ctzsnooze
395e8e8983
Fix Bug causing Dynamic Idle to fail if RPM filtering is turned off (#12270)
Init erpmToHz even if RPM filtering is disabled

Fix for no RPM values sent to Dynamic Idle when RPM filtering was turned off
2023-01-31 15:20:36 +01: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
8900a831e5
AT32F435/7 Libraries (#12158) (#12263)
Source: https://github.com/ArteryTek/AT32F435_437_Firmware_Library
Version: 2.1.1
2023-01-30 22:05:32 +01:00
Dominic Clifton
5e16ddb01b
Don't bundle flash drivers and flash fs/tools together. (#12252)
Flash drivers need to be able to be compiled in without flashfs/flash tools.
2023-01-31 05:26:00 +11:00
Mark Haslinghuis
1b6208d63d
Fix gating for USE_ACC_SPI_MPU9250 (#12240) 2023-01-30 20:06:23 +11:00
Steve Evans
85d9ae2386
Add GYRO_CALIBRATION debug mode (#12241) 2023-01-30 20:05:48 +11:00
QuadMcFly
7dedaa4254
Add Octo X8 + to mixer defaults (#12175) 2023-01-29 02:19:47 +01: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
Mark Haslinghuis
d9264045b3
Default blackbox device to NONE on reset (#12221)
* Default blackbox device to NONE on reset

* Add check for flashIsSupported

* Move blackbox validation outside of validateAndFixGyroConfig()
2023-01-29 01:42:32 +01:00
Mark Haslinghuis
99088f28d1
Fix picture and update links (#12244) 2023-01-29 10:55:49 +11:00
J Blackman
3cbafaf183
Update version for next release (#12234) 2023-01-29 10:24:02 +11:00
Hans Christian Olaussen
4605309d82
Increment EEPROM version for 4.4 (#12242) 2023-01-29 10:18:41 +11:00
J Blackman
0151c30066
Adding Launch Control as standard option. (#12229)
* Adding Launch Control as standard option.
* Adding so it is not present in the CORE_BUILD
* Adding comment
2023-01-25 20:07:15 +11:00
Mark Haslinghuis
2634c3ab37
Remove docs and fix links (#12222) 2023-01-25 19:34:17 +11:00
ykeuter
b1433123c5
fix SITL (#12220)
define USE_PWM_OUTPUT
2023-01-23 13:29:19 +11:00
Jan Post
fb29036ba7
Fix SDFT batch process (#12218)
Fix SDFT batch processing
2023-01-19 15:58:01 +11:00
haslinghuis
e782ab9b28
Fix SITL (#12217) 2023-01-19 15:57:45 +11:00
Jan Post
89afb99dea
Fix DEBUG_ALTITUDE (#12213) 2023-01-19 15:57:29 +11:00
Hans Christian Olaussen
fd54774155
Include MSP over telemetry for ghost (#12208) 2023-01-18 21:24:56 +11:00
ctzsnooze
4454286165
GPS Rescue Bugfix, add a failsafe debug, refactor stick deflection (#12195)
* simple failsafe debug

* simplify areSticksActive

use getRcDeflectionAbs and fix unitTest

* bugfix to require stick input to re-take control

* small refactor
2023-01-18 02:44:50 +01:00
J Blackman
e5c53597a3
Adding comments to common PRE and POST (#12196) 2023-01-18 02:36:08 +01:00
J Blackman
a7cf8f0c6a
Adding release name to the build key output (if provided). (#12201) 2023-01-17 10:48:34 +11:00
J Blackman
d96586d505
Missing define to activate TABLE_VIDEO_SYSTEM (#12200)
* Missing define to activate TABLE_VIDEO_SYSTEM
* USE_PWM should only be for RX (parallell RX inputs), USE_PWM_OUTPUT is for all others.
* Updated gate naming so there is less confusion
* Simplified. Note there maybe further occurences.
2023-01-16 15:50:57 +11:00
Jan Post
5ce7c509a1
Minor fixes for Dyn Notch & SDFT (#12199)
* Minor fixes for Dyn Notch & SDFT
- expand possible configurations for maxHz
- fix proper windowing at the edges of the SDFT

* Refactoring
2023-01-16 15:43:38 +11:00
haslinghuis
56373817fd
Cleanup and make more space available (#12180) 2023-01-16 09:34:40 +11:00
J Blackman
2d57e59dc7
Betaflight 4.4 Release Notes (#12176)
* Create Betaflight 4.4 Release Notes.md

Co-authored-by: Steve Evans <Steve@SCEvans.com>
Co-authored-by: Ivan Efimov <gendalf44@yandex.ru>
Co-authored-by: ctzsnooze <chris.thompson@sydney.edu.au>
2023-01-16 05:26:41 +11:00
Daniel Mosquera
f39f267301
Fixed getDshotAverageRpm function (#12178)
Fixed getDshotAverageRpm function, that was returning erpm value instead of rpm one
2023-01-15 13:42:10 +11:00
Steve Evans
040a519ecd
Automatically apply HD settings if HD VTX is detected (#12184) 2023-01-13 22:05:43 +00:00
J Blackman
2417d50d89
FIX: Hard fault on dump of settings if no OSD selected (#12171) 2023-01-11 08:06:54 +11:00
Dominic Clifton
738ed32cff
Improve performance for ELRS SX1280 SPI callbacks and SPI/ELRS handlers. (#11460)
* SPI - Mark the SPI IRQ handler as FAST_IRQ_HANDLER.

Since it's used by both the gyro code, at 8k (or 2x8k on dual gyro
boards) having it in RAM removes a significant amount of potential flash
latency.

It is also used by the ELRS SPI code.  The ELRS code runs at 500hz, but
each cycle uses multiple SPI transfers, for clear irq, read,
start-recieving, change-frequency, etc. I.e. invokd at least 1000hz in
addition to gyro reads.

* ELRS - Move some frequently used functions to RAM and mark some irq
handlers as FAST.

* SPI/LL - Move some frequently called code to FAST_CODE.

Also remove some invalid characters that Eclipse with encoding as UTF-8
complained about.

* SPI - Mark the spiRx and spiTx dma handlers as FAST_IRQ_HANDLER.

* Filter - move nullFilterApply out of FAST_CODE.

Since it doesn't do anything, it doesn't need to be fast.  Instead we
keep more `fast` RAM for other code that really benefits from being in
fast RAM.

There is a slight penalty to jump into slower RAM.

* Gyro - Move `performGyroCalibration`out of 'fast' ram.

On F7X2 it was being inlined, saved 478 bytes of ITCM.

* Prevent handling of crash recovery handling, not detection of crash
recovery, from being inlined to save ITCM for code that runs more
frequently.
2023-01-11 06:33:06 +11:00
Daniel Mosquera
4494805202
Avoid debugging other data than RPM telemetry when decoding DSHOT RPM (#12166) 2023-01-11 06:29:16 +11:00
haslinghuis
d78082ccf0
Use Support ID in issue template (#12165) 2023-01-11 06:28:19 +11:00
haslinghuis
6793a8efea
Add gate for ICM20602 (#12161) 2023-01-10 12:40:54 +01:00
Steve Evans
1e3fcbfcee
Add osd_canvas_width/height variables (#12164) 2023-01-10 13:25:22 +11:00
haslinghuis
7dd0f60544
Fix removing USE_LED_STRIP (#12162) 2023-01-10 06:15:21 +11:00
J Blackman
261c957762
Move JETIEXBUS serial RX to targets > 512kb flash. (#12160)
This is inline with the telemetry settings. Those who want JETIEXBUS on smaller targets will need to perform a cloud build and select it as an option.
2023-01-09 18:15:54 +01:00
Martin Luessi
a56abc94a8
Flash M25P16: Add QSPI support (#12103) 2023-01-09 15:13:42 +01:00
haslinghuis
105223e65b
Update artifact-links.yml (#12157)
https://github.com/tonyhallett/artifacts-url-comments/issues/80
2023-01-09 12:26:56 +11:00
haslinghuis
be6852e242
Feature cutback making headroom for local development (#12139)
Feature cutback
2023-01-09 12:25:13 +11:00
Steve Evans
107d577a90
Fix reset PG behaviour and configurator interactions based on USE_OSD_SD and USE_OSD_HD definitions (#12152) 2023-01-08 20:49:28 +11:00
Steve Evans
a3a21d9233
Ensure OSD elements are on canvas (#12144) 2023-01-06 23:19:42 +01:00