HAL_ChibiOS: enable ITCM and DTCM on H7 at startup

these may have been disabled by the px4 H7 bootloader
This commit is contained in:
Andrew Tridgell 2022-05-13 13:53:03 +10:00
parent 7e4da1ef85
commit 308717d5eb
1 changed files with 6 additions and 0 deletions

View File

@ -238,6 +238,12 @@ void __early_init(void) {
SCB_DisableDCache();
#endif
#if defined(STM32H7)
// ensure ITCM and DTCM are enabled. These could be disabled by the px4
// bootloader
SCB->ITCMCR |= 1; // ITCM enable
SCB->DTCMCR |= 1; // DTCM enable
// disable cache on SRAM4 so we can use it for DMA
mpuConfigureRegion(MPU_REGION_5,
0x38000000U,