Commit Graph

371 Commits

Author SHA1 Message Date
Tom Pittenger f66327d97d AP_HAL_ChibiOS: Ethernet related memory allocations 2023-08-06 09:20:08 +10:00
Tom Pittenger 3b79ff0ad3 AP_HAL_ChibiOS: add hooks to compile Networking 2023-08-06 09:20:08 +10:00
Tom Pittenger d841d250d8 AP_HAL_ChibiOS: allow HW without HW_RNG to SW-based create psuedo-random 2023-08-06 09:20:08 +10:00
Andrew Tridgell 0accc9f897 HAL_ChibiOS: clear EOP bit at end of F4 programming 2023-07-10 06:52:44 +10:00
Andrew Tridgell 0aab2f7974 HAL_ChibiOS: implement newlib alloc functions as malloc wrappers
this fixes issue #24106
2023-07-05 07:13:39 +10:00
Andrew Tridgell 54e2e33ee1 HAL_ChibiOS: allow hwdef to specify a NRST_MODE override
this allows the boot behaviour of a board to be changes to avoid a
reset issue
2023-06-27 10:32:43 +10:00
Andrew Tridgell ddb991d9b5 HAL_ChibiOS: fixed 24mhz crystal on H7 with 480MHz clock
need to adjust the PLLQ as well as the PLLN
2023-06-20 18:56:13 +10:00
Andrew Tridgell 1055c5f1c6 waf: fixed dependency of ChibiOS build on compiler flags
this adds a chibios_flags.h which contains the flags we pass to the
ChibiOS make, which allows us to have a make level dependency on the
flags

this fixes (among other things) the build of copter followed by
bootloader for SPRacingH7
2023-06-20 18:08:31 +10:00
Martin Luessi b336526765 AP_HAL_ChibiOS: Move scheduler task table to RAM for H750 2023-06-06 19:19:10 +10:00
Martin Luessi 82280b6a8d AP_HAL_ChibiOS: Rename STM32_FORCE_CLOCK_INIT to HAL_FORCE_CLOCK_INIT 2023-06-06 19:19:10 +10:00
Martin Luessi 350dfc235e AP_HAL_ChibiOS: Add libgcc comment to H750 linker script 2023-06-06 19:19:10 +10:00
Martin Luessi f55261c852 AP_HAL_ChibiOS: Use DTCM for vector table for external flash targets 2023-06-06 19:19:10 +10:00
Martin Luessi ab03c49ea8 AP_HAL_ChibiOS: Move more time critical code to RAM for H750 2023-06-06 19:19:10 +10:00
Martin Luessi 0c93800ec1 AP_HAL_ChibiOS: Copy vector table to RAM if external flash is primary 2023-06-06 19:19:10 +10:00
Martin Luessi 84ccd046c6 AP_HAL_ChibiOS: Change linker script so vector table can be copied to RAM for external flash targets 2023-06-06 19:19:10 +10:00
Martin Luessi f5e6b055b6 AP_HAL_ChibiOS: Allow custom STM32_QSPISEL for H7 2023-06-06 19:19:10 +10:00
Martin Luessi 01f030da7c AP_HAL_ChibiOS: Option to force clock init 2023-06-06 19:19:10 +10:00
Andrew Tridgell 6f469c48e7 HAL_ChibiOS: support f_mkfs on all boards 2023-06-06 15:19:00 +10:00
Andrew Tridgell 146cc3312c HAL_ChibiOS: implement ff_memalloc, fixing mkdir() after format
this implements FATFS memory allocation in the HAL_ChibiOS malloc.c
which fixes mkdir() after a format of the microSD

The strategy is to deny large allocations and try for DMA allocations
if possible. This both fixes mkdir() and makes filesystem operations
faster as we have less copying of memory via the bouncebuffer
2023-06-03 17:07:04 +10:00
Andrew Tridgell 4946ce5431 HAL_ChibiOS: revert recent USB changes
these are causing some boards to crash on startup. Tested with a
QiotekZealotH743 which doesn't get out of setup_usb_strings()

once we have debugged this we can re-add the functionality
2023-06-03 16:50:30 +10:00
bugobliterator f7d3969116 AP_HAL_ChibiOS: enable write protection on USB msd
also fixes support for MSD on FS
2023-05-31 18:40:17 +10:00
bugobliterator a9ef3b031e AP_HAL_ChibiOS: add support for setting baudrate for ACM port in USB MSD 2023-05-31 18:40:17 +10:00
bugobliterator c6631bce57 AP_HAL_ChibiOS: add block filesystem access support when using MSD USB 2023-05-31 18:40:17 +10:00
bugobliterator 6d6c791fdf AP_HAL_ChibiOS: add support for mass storage device 2023-05-31 18:40:17 +10:00
bugobliterator cc302d8b8c AP_HAL_ChibiOS: add support for OTG HS 2023-05-31 18:40:17 +10:00
Peter Barker 537fc19bb5 AP_HAL_ChibiOS: do not build ChibiOS with debug symbols unless debug build
debug symbols subtly change the compiler output which can lead to problems with repeatable builds
2023-05-16 09:55:47 +10:00
Andrew Tridgell 7e84028a91 HAL_ChibiOS: fixed sdcard lockup with SPI sdcard
this affects boards that share sdcard on the same bus as another SPI
device. In this case it was a QiotekZealotH743 where logging stopped

this issue is that the SPI hooks for MMC SPI did not do a DMA channel
lock before the SPI device lock. So when the RAMTRON driver on the
QiotekZealotH743 which is on the same SPI2 bus as the sdcard did an
operation we had a lock order violation
2023-05-13 18:18:14 +10:00
Andy Piper 95437d248f AP_HAL_ChibiOS: advanced timers are now determined automatically on L4+ 2023-05-03 07:39:39 +10:00
Andy Piper d69b8c2693 AP_HAL_ChibiOS: fix usage of ADC2 and ADC3 in STM32H730 2023-04-28 08:31:15 +10:00
Andy Piper 26c59349d5 AP_HAL_ChibiOS: use HAL_XIP_ENABLED to denote running in external flash 2023-04-28 08:31:15 +10:00
Andy Piper ff1661a8de AP_HAL_ChibiOS: use STM32_FLASH_NBANKS for flash actions 2023-04-28 08:31:15 +10:00
Andy Piper 5b43926d0a AP_HAL_ChibiOS: for H730/H750 running in XIP mode do not reset clocks
create mcuconf file for STM32H730 (type2)
allow OTG2 to be used as OTG1 on MCUs that need it
remove redundant OTG enablement
2023-04-28 08:31:15 +10:00
Andy Piper b75ff2e2ae AP_HAL_ChibiOS: allow only ADC2 to be used 2023-04-28 08:31:15 +10:00
Andy Piper 798fc05ba8 AP_HAL_ChibiOS: clean up linker map on H730 and H750
use regular ChibiOS RAM areas for RAM functions
exclude board.o from RAM functions and add some comments
use separate linker script for H750
use correct RAM area for process stack on H750/H743
update EXCLUDE items to put __early_init in flash on H730 and H750
optimize H730 ramfunc usage
2023-04-28 08:31:15 +10:00
Andy Piper 7516f04106 AP_HAL_ChibiOS: create two configurable non-cacheable memory areas for DMA 2023-04-28 08:31:15 +10:00
Andy Piper cc086ab8d4 AP_HAL_ChibiOS: support for STM32H730xx MCUs
correct calculation of advanced timers
add support for linker script configuration in mcu config script
use linker script configuration for H750 and H730
add single OTG_HS support on H730 via OTG2
make sure complimentary channels get advanced timers
complemntary timers do not require advanced mode
allow custom clockspeeds of 550Mhz
correct debug pins on H730
support custom clockrate of 520Mhz on H730
correct H730 USB end point pins
restructure linker script for STM32H730
allow chibios_hwdef.py to set advanced timer on L431
don't define RAMFUNC on STM32H730
clock tree for STM32H730
create non-cacheable memory area for SDMMC DMA
don't look for RAM_MAP in bootloader with external flash
2023-04-28 08:31:15 +10:00
bugobliterator 0343b789e6 AP_HAL_ChibiOS: add support for mixed internal and external flash 2023-04-26 18:04:00 +10:00
bugobliterator 726dcda24f AP_HAL_ChibiOS: add support for using ADC2 and ADC3 on H7 2023-04-26 18:04:00 +10:00
Andrew Tridgell 64cd58c21a ChibiOS: disable DMA on I2C on F7 and H7 by default
this was already done on many (most?) boards, and greatly reduces DMA
sharing which improves performance of UARTs. This changes the default
to no DMA on I2C
2023-04-25 14:19:09 +10:00
Andy Piper fc6cb74ac7 AP_HAL_ChibiOS: SDIO PWRSAV needs to be enabled on F4/F7 2023-04-14 08:05:19 +10:00
tsubashmail@gmail.com ae9e15ade5 HAL_ChibiOS: port for STM32L4+ processor
Added support for stm32l4+ processor

- Added scripts for hwdef generation
- Tested in custom hardware prototype (stm32l4r5vit6)
- Tested all peripherals and auto pilot modes.
2023-04-14 07:48:56 +10:00
Andy Piper a115681373 AP_HAL_ChibiOS: add support for building USB MSD 2023-03-29 20:49:40 +11:00
Andy Piper a56a2ec2c1 AP_HAL_ChibiOS: correct SDC power saving 2023-03-29 20:49:40 +11:00
Andy Piper 73da2162d2 AP_HAL_ChibiOS: QSPI prescaler is indexed from 1 2023-03-29 20:49:40 +11:00
Andy Piper d9d252a1b7 AP_HAL_ChibiOS: update clock trees for H7 variants 2023-03-29 20:49:40 +11:00
Andy Piper 667b386356 AP_HAL_ChibiOS: port to ChibiOS 21.11.x
convert RCOutput to new virtual timer interface
cope with SDC vs SDMMC
use new SPIv3 driver. Correct clocks for SDMMCv2.
add STM32L431 support
port ChibiOS config to version 8
support SPIv3 driver model v2 on H7
use currcore in debug options
use new mmc API
disable speed optimizations in the bootloader to save a little flash
upgrade to halconf v8.4
relax constraints on QSP/flash clock.
add support for disabling QSPI reset in main firmware
2023-03-29 20:49:40 +11:00
Andrew Tridgell 4141dd5bbe HAL_ChibiOS: support starting the clock at non-zero
for testing time wrap bugs
2023-03-24 08:31:25 +11:00
Ryan Friedman 5dbfec1e33 AP_HAL_ChibiOS: Add poll implementation
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
Co-authored-by: Arsh Pratap <arshpratapofficial@gmail.com>
Co-authored-by: Andrew Tridgell <andrew@tridgell.net>
2023-03-22 09:22:36 +11:00
Andrew Tridgell 0489323551 HAL_ChibiOS: Revert "HAL_ChibiOS: fix a memory corruption bug on STM32H757"
This reverts commit 63633368f5.

this broke CAN1 on some H743 boards
2023-03-19 07:17:28 +11:00
Andrew Tridgell 63633368f5 HAL_ChibiOS: fix a memory corruption bug on STM32H757
this fixes an issue where a variable in SRAM1 gets set to a bad value
when we reset AHB1 with the top bit (a reserved bit)

the bug was only reproducible with this particular commit:

https://github.com/tridge/ardupilot/commits/cubeorangplus-crash-boot-bisect

but likely is just luck that it triggered on that commit. In this
instance it triggered as AP_OSD::singleton was reset to non-nullptr,
causing a panic() in AP_OSD::AP_OSD()

compiler was gcc 10.2-2020-q4
2023-03-18 08:35:51 +11:00