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

65 commits

Author SHA1 Message Date
Mark Haslinghuis
09a70439be
Fix F7X2 AXIM flash region (#13270) 2024-01-08 08:05:07 +11:00
Cru Waller
632a13b821
AT32F43x: make sure the SRAM configuration is valid (#13031) 2023-08-15 04:37:12 +10:00
Eike Ahmels
66d7f05448
fix bootloader jump for g4 mcu (#12675) 2023-04-16 00:51:53 +10:00
Steve Evans
6766f9cf43
Add NEUTRONRCF435 support including AT32F435RGT7 1M FLASH (#12534) 2023-03-20 12:33:43 +11:00
J Blackman
ee77239db1
Removing Custom Defaults (#12425) 2023-03-02 19:39:44 +01:00
Steve Evans
68136910d0
Arrange all 192K of RAM in a single block on AT32F435 (#12435) 2023-03-01 17:57:09 +11:00
Dominic Clifton
d27bea9ca6
Revert "Fix missing CUSTOM_DEFAULTS for H730/H750 targets. (#12261)" (#12333)
This reverts commit 9850749afa.
2023-02-11 05:56:14 +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
Dominic Clifton
9850749afa
Fix missing CUSTOM_DEFAULTS for H730/H750 targets. (#12261) 2023-02-03 06:26:28 +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
David O'Connor
2fd5746dce
Added H723 unified target. Fixed H723 linker (#11826)
* Added H723 unified target. Fixed H723 linker

* Fixed a typo in the readme

* Update TARGETS line in mk file
2022-11-16 14:03:54 +01:00
Steve Evans
b197d1d6bd
Enable Instruction and Data cache and prefetch on G4 (#11973)
* Don't define USE_FAST_DATA on G4
Enable Instruction and Data cache and prefetch on G4

* Update src/main/startup/system_stm32g4xx.c

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

Co-authored-by: haslinghuis <mark@numloq.nl>
2022-11-10 04:30:20 +01: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
9bb1f18a82 Removing OPBL support. 2022-06-28 00:50:40 +10:00
Steve Evans
701b0ae55c Remove F1 and F3 support 2022-06-14 19:10:13 +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
Steve Evans
d78f2081db Fix pg_resetdata location in FLASH 2021-08-30 20:12:42 +01:00
Michael Keller
b83bc86713 Rearranged flash on targets >512 kB to keep first sector from overflowing. 2021-08-09 10:06:27 +12:00
Steve Evans
87c8847c13 New SPI API supporting DMA
Call targetConfiguration() once before config is loaded and again afterwards in case the config needs to be changed to load from SD card etc

Drop SPI clock during binding

Remove debug

Add per device SPI DMA enable

Fix sdioPinConfigure() declaration warning

Reduce clock speed during SPI RX initialisation
2021-07-25 12:40:25 +12:00
Michael Keller
5549a906f6 Added a Unified Target for STM32H743. 2021-06-27 18:49:45 +12:00
mikeller
3529195b9f Moved some data into FLASH1 from FLASH to free up space. 2021-05-18 01:49:09 +12:00
Steve Evans
0dbd712233 Allow normal RAM overflow to occupy start of CCM, and only reserve 2560 bytes for vector table and stack in CCM 2021-05-17 12:28:30 +01:00
mikeller
03d3d94497 Added Unified Target for STM32G4. 2021-04-26 16:18:28 +12:00
Michael Keller
00a75326c0 Fixed RAM overflow on NUCLEOH743_RAMBASED. 2020-12-16 01:16:59 +01:00
Steve Evans
cb908a6893 Add USE_LEDSTRIP_CACHE_MGMT option to use explicit cache management for LED strip.
Ensure DMA_RAM section is at start of RAM and the the region defining the shareable region is covered.
Enable USE_LEDSTRIP_CACHE_MGMT on NUCLEOH743 target
2020-12-14 19:35:13 +00:00
jflyper
1feb306674 [H7] H723/H725 support 2020-11-11 23:45:15 +09:00
Michael Keller
4bf3e99e9c
Merge pull request #10318 from jflyper/bfdev-h7-h7a3
[H7] H7A3 support
2020-11-05 02:11:20 +13:00
Michael Keller
49679ce0ef
Merge pull request #10247 from SteveCEvans/h7mscsrc 2020-11-01 11:27:52 +13:00
jflyper
697d0f7ed3 [H7] H7A3 support 2020-11-01 00:32:39 +09:00
Steve Evans
31b06cd7d2 Add USB MSC support for H7 2020-10-30 19:30:38 +00:00
Michael Keller
7763ab6a1e Moved parameter group defaults into main flash for STM32F722. 2020-10-25 18:50:24 +01:00
jflyper
e4d7c4e152 [G4][SYSTEM] Basic & build files 2020-09-30 18:20:05 +09:00
Michael Keller
4261f0499d
Revert "Clean up linker script" 2020-09-22 00:05:51 +12:00
Michael Keller
4ffe9dac9e
Merge pull request #10126 from SJ-Innovation/SJI_cleanup_linker_script 2020-09-13 16:15:46 +12:00
Sam Lane
bf3fb24aa1 Remove missed duplicate LMA 2020-08-23 09:04:18 +01:00
Sam Lane
4c99ad743d Rename FAST_RAM to FAST_DATA 2020-08-23 08:49:26 +01:00
Sam Lane
00d9fbbcd6 Clean up non aliased LMAs 2020-08-23 08:34:59 +01:00
Dominic Clifton
ad3f434aef Provide ability to build H750 for 1M when EXST support is not used.
Default for EXST is `yes`
2020-03-26 16:51:32 +01:00
Dominic Clifton
09ac5be8d6 Cleanup and de-duplicate H7 linker scripts 2020-03-26 16:50:21 +01:00
Dominic Clifton
bba5a1986b Update comment in the h743 ram based file to match the filename. 2020-03-26 16:37:12 +01:00
Dominic Clifton
fb6f93bc0d Remove 'flash' from the ram-based linker script filename. 2020-03-26 16:37:00 +01:00
jflyper
6dcb373257 [F1] Maintenance to keep F1 buildable 2020-03-23 10:30:33 +09:00
Michael Keller
39c8d1851e Revert the workaround for the EXST linker script. 2019-11-27 18:14:12 +13:00
mikeller
a302b5bae2 Removed ATOMIC_BARRIER check, fixed ITCM_RAM overflow. 2019-11-25 01:16:08 +13:00
Michael Keller
564f3031b2
Add NUCLEOF303RE target (#8938)
Add NUCLEOF303RE target
2019-10-20 22:50:18 +13:00
Michael Keller
9f5bbf6e5c
DSHOT telemetry optimizations (#8772)
DSHOT telemetry optimizations
2019-10-20 22:39:32 +13:00
jflyper
cb1bdfe204 Add Nucleo-F303RE support 2019-10-18 00:19:52 +09:00
jflyper
4e9923569a NUCLEOF103RG target
NUCLEOF103RG is a target for Nucleo-F103RG (Nucleo-F103RB transplanted
with STM32F103RG which has 1MB of FLASH).
Such hardware with this target comes in handy when a firmware that
doesn't fit in smaller FLASH variant when compiled with DEBUG option.

The target definition files are straight copy of NAZE, except LED0_PIN
has been redefined to use Nucleo's LD2 (User LED).

It is also easy to convert exisiting F1 targets to be built to run on
the Nucleo-F103RG board:

- Add
    #define FLASH_PAGE_SIZE 0x800
    to target.h

- Also add
    #undef USE_DSHOT
    #undef USE_LED_STRIP
    #undef USE_TRANSPONDER
    #undef USE_CAMERA_CONTROL
    to target.h to avoid non-F1 compatible code from getting in.

- Add
FLASH_SIZE  = 1024
    to target.mk
2019-09-23 23:58:03 +09:00
Dominic Clifton
376441f89f F3 - Add support for code in CCM RAM. 2019-09-02 18:40:13 +02:00
mikeller
3128328224 Fixed start / end addresses for custom defaults. 2019-09-01 13:35:10 +12:00