STM32H730 - Initial ST32H730 support.
commita325e2386d06ab62dfa940c3034aed9cf6aa8e9b
authorDominic Clifton <me@dominicclifton.name>
Thu, 11 Mar 2021 21:38:34 +0000 (11 22:38 +0100)
committerDominic Clifton <dominic.clifton@cleanflight.com>
Thu, 23 Dec 2021 14:02:23 +0000 (23 15:02 +0100)
tree2e5a0ac372e002a18a7538dfd90d332d3a1d4357
parent0b7fcb7df4a5d3b303385e9cf41e20b721214017
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.
24 files changed:
Makefile
make/mcu/STM32H7.mk
make/targets.mk
src/link/stm32_h730_common.ld [new file with mode: 0644]
src/link/stm32_h730_common_post.ld [new file with mode: 0644]
src/link/stm32_ram_h730_exst.ld [new file with mode: 0644]
src/link/stm32_ram_h730_exst_post.ld [new file with mode: 0644]
src/main/build/build_config.c
src/main/build/build_config.h
src/main/cli/cli.c
src/main/config/config_streamer.c
src/main/drivers/adc.h
src/main/drivers/adc_stm32g4xx.c
src/main/drivers/adc_stm32h7xx.c
src/main/drivers/dma_reqmap.c
src/main/drivers/io.c
src/main/drivers/sdio_h7xx.c
src/main/drivers/system_stm32h7xx.c
src/main/drivers/timer_stm32h7xx.c
src/main/drivers/usb_msc_h7xx.c
src/main/platform.h
src/main/startup/startup_stm32h730xx.s [new file with mode: 0644]
src/main/startup/system_stm32h7xx.c
src/main/vcp_hal/usbd_conf_stm32h7xx.c