Skip to main content
Visitor II
November 30, 2022
Question

application's HAL_Delay() is not working ,when jumped from bootloader program

  • November 30, 2022
  • 1 reply
  • 1025 views

The program jumps to the address but stuck in HAL_Delay()

without HAL_Delay() its work perfect

Here is the code...........

static void goto_application(void)

{

 printf("Gonna Jump to Application\r\n");

 void (*app_reset_handler)(void) = (void*)(*((volatile uint32_t*) (0x08004000 + 4U)));

 __set_MSP(*(volatile uint32_t*) 0x08004000);

 // Turn OFF the Green Led to tell the user that Bootloader is not running

 HAL_GPIO_WritePin(GPIOC, GPIO_PIN_13, GPIO_PIN_RESET );  //Green LED OFF

 app_reset_handler();  //call the app reset handler

}

    This topic has been closed for replies.

    1 reply

    Super User
    November 30, 2022

    So it appears the HAL_IncTick() function is never called, which means your SYSTICK interrupt isn't working.

    Lots of possibilities. Do you use (or at least enable) SYSTICK in your bootloader? If so, do you disable it and its interrupt before calling the main program? Does your main program set the interrupt vector pointer (VTOR) to its interrupt table (instead of the bootloader's)? Does you main program enable SYSTICK (or which ever timer you have selected to drive the HAL system tick)? That is normally done in one of the SystemClock_Config_***() functions.