stm32H7, HAL_Deinit() causes core stall
Hi there, I'm fixing the jump function from my custom bootloader to the application, below the code:
static void __inline__ CheckAPPjumpRESET(void)
{
/*.-.-.| Local variables: |.-.-.*/
u32t uiI = 0;
/*.-.-.| Execution: |.-.-.*/
if(GetRESETkey() != RESET_DRV_APP_KEY) { ; }
else {
// RESET_DRV_APP_KEY found: jump to app!
SetRESETkey(RESET_DRV_BTL_KEY);
__disable_irq(); // Disable all interrupts
SysTick->CTRL = 0; // Disable Systick timer
HAL_RCC_DeInit(); // Set the clock to the default state
// Clear Interrupt Enable Register & Interrupt Pending Registers:
for (uiI = 0; uiI < 8; uiI++)
{
NVIC->ICER[uiI]=0xFFFFFFFF;
NVIC->ICPR[uiI]=0xFFFFFFFF;
}
SCB_CleanDCache(); // Clean Data Cache
SCB_DisableDCache(); // Disable Data Cache
SCB_DisableICache(); // Disable Instruction Cache
HAL_MPU_Disable(); // Disable MPU
HAL_DeInit();
__enable_irq(); // Re-enable all interrupts
DoAPPjumpRESET(FLASH_INT_M7_APP_START_ADR);
}
}
My Bootloader is running only on the M7 core, while the application uses both of them; since I'm having trouble in peripheral initialization in the application I tried to reset all of them in the jumping function using HAL_Deinit() function. Doing this, after the jump the M4 core is stalling: it seems it is not running but I' dont have an Hard Fault...
Has anyone some idea?
Thanks in advance,
iTTy
