Commit Graph

313 Commits

Author SHA1 Message Date
bugobliterator 0c78f8bac2 AP_HAL_ChibiOS: add support for booting into DFU 2022-08-30 10:51:06 +10:00
Peter Barker ecde9f8c3f AP_HAL_ChibiOS: make HAL_FLASH_PROTECTION a boolean, stop checking for definition 2022-08-16 08:10:16 +10:00
Andrew Tridgell 308717d5eb HAL_ChibiOS: enable ITCM and DTCM on H7 at startup
these may have been disabled by the px4 H7 bootloader
2022-06-15 17:28:40 +10:00
Lokesh Ramina adfb2f9cad AP_HAL_Chibios: add_12Mhz_Clock_stm32F405
There was no option for 12Mhz for STM32F405
2022-05-12 17:40:21 +10:00
Andrew Tridgell e73f868fc0 HAL_ChibiOS: disable fatal exceptions for DMA errors
this zeros-watchdog was caused by a SPI DMA error on STM32F405:

  https://discuss.ardupilot.org/t/crash-with-4-2-0-beta-and-4-3-0-daily-bdshot/83297

we had incorrectly left these internal errors enabled when asserts
were not enabled. That led to a osalSysHalt()

without these we get an spi_fail internal error, caught by the
SPIDevice code
2022-04-19 21:52:53 +10:00
Andy Piper e89eb34d55 AP_HAL_ChibiOS: add I2C and compass backend to drivers in memory on H750
move more of EKF into memory on H750
move rc handling into memory on H750
disable double math on SPRacing H7
2022-04-12 09:19:45 +10:00
Andrew Tridgell 392e80001f HAL_ChibiOS: fixed H7 flash storage
this fixes the flash re-init problem when flash storage fills on
H7. It was caused by rejecting writes where one or more of the 32 byte
chunks was not all 0xff but was equal to the current data. That
happens when writing to the sector header in AP_FlashStorage

it also moves the interrupt disable inside the loop to allow for
other interrupts to run between blocks
2022-04-05 17:46:52 +10:00
Andrew Tridgell a0c867bce7 HAL_ChibiOS: disable interrupts during flash operations
we have now shown that interrupts being enabled during flash
operations can cause the infamous "68ms" bug, or watchdog when using a
32 bit timer on boards using flash for storage

The issue is quite repeatable with a load of a very large waypoint
file (over 500 waypoints) using "wp ftpload" in MAVProxy. This puts a
huge load on flash storage.

Our current working theory is that while doing flash writes for
storage on dual-bank we block access to only one bank, so if another
thread uses a timeout function with a short timeout while the flash
write is happening and chVTDoTickI calls code which crosses the flash
bank boundary then it can cause chVTDoTickI to violate the assumption
that no more than CH_CFG_ST_DELTA ticks pass while it is calculating
the value to set in the system timer. In that case we get a delay of a
full timer wrap, which is 68ms on boards with 16 bit timer and 70
minutes on boards with 32 bit timer
2022-04-05 17:46:52 +10:00
Andy Piper ceef68e07b AP_HAL_ChibiOS: allow H7 480Mhz clock speed to be configured in hwdef via MCU_CLOCKRATE_MHZ 2022-03-16 20:37:30 +11:00
bugobliterator 90a660b445 AP_HAL_ChibiOS: update clock tree to have FDCAN Base clock at 80MHz 2022-03-11 18:13:54 +11:00
Andy Piper ed952a0ea0 AP_HAL_ChibiOS: allow flash to be write-protected/unprotected on reboot
control protection support via HAL_FLASH_PROTECTION
provide support for flash protection on SPRacingH7
SPRacingH7 bootloader needs to use w25q-dtr
2022-02-24 10:19:07 +11:00
Andy Piper f840315aa4 AP_HAL_ChibiOS: clock H750 at 480Mhz when using 8Mhz, 16Mhz and 24Mhz crystals 2022-02-23 18:19:56 +11:00
Andrew Tridgell f2308e96a9 HAL_ChibiOS: added stm32_was_software_reset() 2022-02-17 14:37:41 +11:00
Andy Piper 48c21299f8 AP_HAL_ChibiOS: hwdef for SPRacingH7
hwdef for DevEBoxH7v2
pin definitions for STM32H750
add QSPI to DevEBox bootloader
add external flash to DevEBox
rename EXTERNAL_PROG_FLASH_MB to EXT_FLASH_SIZE_MB
Add support for EXT_FLASH_RESERVE_START_KB and EXT_FLASH_RESERVE_END_KB
Disable HAL_ENABLE_SAVE_PERSISTENT_PARAMS when there is no bootloader flash available
relax storage health status with SD card backend
don't check SD card health unless USE_POSIX
binary sections rearranged on external ram
manage RAMFUNC through ldscript and optimize function placement in external flash
inline timer functions
optimize placement of ChibiOS and functions in ITCM and AXI RAM
fix chibios features on bootloader build with external flash
change H750 memory layout
increase line storage for SD card based parameters
comment external flash linker script
move vtables into DTCM
update ram map for H757
enable crashdump support with external flash
correct bootloader pins and generator on SPRacingH7/DevEBoxH7v2
setup external flash reserve regions
allow different RAM_MAP for external flash on H750 and H757
2022-02-09 12:47:55 +00:00
Andrew Tridgell e07057d24f HAL_ChibiOS: support SDIO 48MHz clock on F412 2022-02-02 07:42:23 +11:00
Andrew Tridgell 040ff007ea HAL_ChibiOS: fixed some F4 clocks, and support no crystal on F4
this fixes up some of the F4 varients that were running at the wrong
clock, and also gives support for running F4s with no crystal
2022-01-29 18:57:33 +11:00
Andrew Tridgell 61ecf0c443 HAL_ChibiOS: cleanup SDMMC enable defines
ensure both are set
2021-12-28 16:04:57 +11:00
Andrew Tridgell 146f394d64 HAL_ChibiOS: include fatfs format code 2021-12-28 16:04:57 +11:00
Andrew Tridgell fbadc24fca HAL_ChibiOS: support 12MHz crystal on L4xx MCUs 2021-12-07 10:23:54 +11:00
bugobliterator f9bb9b4fc0 AP_HAL_ChibiOS: log heap and bss memory regions if enough space 2021-12-01 18:17:50 +11:00
bugobliterator ee35350129 HAL_ChibiOS: setup for recording crashdump at the remaining flash space 2021-12-01 18:17:50 +11:00
bugobliterator 52c7886270 HAL_ChibiOS: fix issue with failing to write final buffer 2021-12-01 18:17:50 +11:00
bugobliterator eae3fb016f HAL_ChibiOS: dump per thread stack for crash 2021-12-01 18:17:50 +11:00
Andrew Tridgell f7bc7b0d9b HAL_ChibiOS: support more enable pins for late enable 2021-11-10 08:47:21 +11:00
bugobliterator 57e1fb1a81 HAL_ChibiOS: disable building CrashCatcher for non 2M boards 2021-10-30 19:24:57 +11:00
bugobliterator 91fdf6e875 HAL_ChibiOS: fix issue with writing the last byte 2021-10-30 19:24:57 +11:00
bugobliterator 70f606c480 AP_HAL_ChibiOS: restrict crash dump mechanisms only on boards with 2M flash 2021-10-30 19:24:57 +11:00
bugobliterator 909f59f0e0 HAL_ChibiOS: fix build with boards without HAL_CRASH_SERIAL_PORT 2021-10-30 19:24:57 +11:00
bugobliterator a6b2018cbf HAL_ChibiOS: fix build and serial crash dump for F4 based boards 2021-10-30 19:24:57 +11:00
bugobliterator 7d199f3e51 HAL_ChibiOS: record info into watchdog as well 2021-10-30 19:24:57 +11:00
bugobliterator 13c83f7010 HAL_ChibiOS: remove build of Crash dump to flash methods when !defined(HAL_CRASH_DUMP_FLASHPAGE) 2021-10-30 19:24:57 +11:00
bugobliterator 66b8b9cf74 HAL_ChibiOS: add support for dumping crash logs to flash page 2021-10-30 19:24:57 +11:00
bugobliterator bd08d2d257 HAL_ChibiOS: move crashcatcher methods out from system.cpp into hwdef common 2021-10-30 19:24:57 +11:00
bugobliterator c32bd845f2 HAL_ChibiOS: build crashcatcher lib alongside chibios 2021-10-30 19:24:57 +11:00
Andrew Tridgell 5a68e21435 HAL_ChibiOS: support STM32L431 2021-10-17 20:30:20 +11:00
Andrew Tridgell f1ea4f5d01 HAL_ChibiOS: use a 16 bit sysinterval_t on 16 bit timers
prevent mixed size subtraction errors
2021-10-17 20:29:42 +11:00
Andrew Tridgell 25324ae0e2 HAL_ChibiOS: support SDMMC2 for sdcard 2021-10-12 15:47:51 +11:00
Nick Exton ffa2bba35c HAL_ChibiOS: add missing return to Dual CDC get_usb_baud() 2021-10-12 10:54:44 +11:00
bugobliterator f298ea406e HAL_ChibiOS: enable RNG only for H7 based boards off for the rest by default 2021-10-07 19:43:11 +11:00
bugobliterator fc4d59c5a4 HAL_ChibiOS: setup hw random number generator for stm32 chips 2021-10-07 19:43:11 +11:00
Andrew Tridgell 52124cf602 HAL_ChibiOS: fixed f1 bootloader build errors 2021-10-06 06:44:36 +11:00
Andrew Tridgell 8deaa1b46b HAL_ChibiOS: fixed warning for USB 2021-10-06 06:44:36 +11:00
Andrew Tridgell 4daf4ad501 HAL_ChibiOS: lock in no warnings for chibios RTOS build 2021-10-06 06:44:36 +11:00
Andrew Tridgell 0212e23cd3 HAL_ChibiOS: added support for STM32L496 MCUs
good MCU for AP_Periph
2021-09-24 18:08:00 +10:00
Andrew Tridgell 2e4766fe54 HAL_ChibiOS: ensure HI_POWER periph is on 2021-09-07 10:40:44 +10:00
Siddharth Purohit d484477a99 AP_HAL_ChibiOS: move to using PLL2_R_CK for QSPI 2021-09-01 17:10:53 +10:00
Siddharth Purohit 81dc237a19 AP_HAL_ChibiOS: move to using Instruction RAM with External Flash setup 2021-09-01 17:10:53 +10:00
Siddharth Purohit 813e93a69c AP_HAL_ChibiOS: do not reset GPIO for boards with external flash 2021-09-01 17:10:53 +10:00
Siddharth Purohit 4ba2835de1 AP_HAL_ChibiOS: add config for supporting load from external flash 2021-09-01 17:10:53 +10:00
Andrew Tridgell 584fb7cd7b HAL_ChibiOS: use more USB buffers on higher end F7 chips 2021-08-31 10:12:00 +10:00