5
0
mirror of https://github.com/ArduPilot/ardupilot synced 2025-01-09 09:28:31 -04:00

HAL_ChibiOS: Revert "HAL_ChibiOS: fix a memory corruption bug on STM32H757"

This reverts commit 63633368f5.

this broke CAN1 on some H743 boards
This commit is contained in:
Andrew Tridgell 2023-03-18 17:18:24 +11:00
parent e5be8e9bf0
commit 0489323551
2 changed files with 1 additions and 31 deletions
libraries/AP_HAL_ChibiOS/hwdef/common

View File

@ -254,37 +254,7 @@ void __early_init(void) {
#endif
}
#if STM32_NO_INIT == TRUE && defined(STM32H7)
/*
this is a copy of the RCC reset code from hal_lld_init(), moved here
as we need to modify it for ArduPilot. See notes below. We set
STM32_NO_INIT to TRUE to ensure that the copy in hal_lld_init() is
not run
*/
static void stm32h7_rcc_init(void)
{
/*
resetting bit 0x80000000 of AHB1 can cause memory corruption in
SRAM1, causing BSS data to be initialised incorrectly. Only
observed with STM32H757, but may affect other H7
*/
rccResetAHB1(0x7fffffffU);
rccResetAHB2(~0);
rccResetAHB3(~(RCC_AHB3RSTR_FMCRST | RCC_AHB3RSTR_QSPIRST |
0x80000000U)); /* Was RCC_AHB3RSTR_CPURST in Rev-V.*/
rccResetAHB4(~(RCC_APB4RSTR_SYSCFGRST | STM32_GPIO_EN_MASK));
rccResetAPB1L(~0);
rccResetAPB1H(~0);
rccResetAPB2(~0);
rccResetAPB3(~0);
rccResetAPB4(~0);
}
#endif
void __late_init(void) {
#if STM32_NO_INIT == TRUE
stm32h7_rcc_init();
#endif
halInit();
chSysInit();

View File

@ -57,7 +57,7 @@
/*
* General settings.
*/
#define STM32_NO_INIT TRUE
#define STM32_NO_INIT FALSE
#define STM32_TARGET_CORE 1
/*