2018-06-29 05:52 AM
We are using STM32F767ZIT6 Nucleo board and developing a startup application that jumps to the main application. The main application is a simple toggling LED app with a HAL_Delay API.
By the below startup code we can able to jump to the main application, but after jumping to the main application, we are not able to get any interrupts, this means HAL_Delay API never returns. Please suggest what is missing in our startup code / application.
Code Snippet:
#define SA_START_ADDRESS_UAP 0x08040400
int
main()
{
uint32_t
bootadd ;
bootadd = SA_START_ADDRESS_UAP;
BOOT_boot(bootadd);
return
0;
}
void
BOOT_boot(
uint32_t
bootaddress)
{
if
(
HAL_OK!=HAL_RCC_DeInit())
{
while
(1);
}
SysTick->
CTRL
= 0;
SysTick->
LOAD
= 0;
SysTick->
VAL
= 0;
__disable_irq();
SYSCFG->
MEMRMP
= 0x00000001;
SCB
->VTOR
= bootaddress ;
/* Reinitialize the Stack pointer and jump to application address */
JumpAddress = *(__IO
uint32_t
*) (bootaddress + 4);
Jump_To_Application = (
pFunction
) JumpAddress;
/* Initialize user application's Stack Pointer */
__set_MSP(*(__IO
uint32_t
*) bootaddress);
Jump_To_Application();
}
2018-06-29 08:21 AM
>>By the below startup code we can able to jump to the main application, but after jumping to the main application, we are not able to get any interrupts, this means HAL_Delay API never returns. Please suggest what is missing in our startup code / application.
__disable_irq(); // You do this
Perhaps you should re-enable them on the other side of the worm hole?
2018-07-09 08:47 AM
I had already enabled the interrupt in the main application , LED glows but it doesn't blink.
This implies that the startup code jumps to the main application but still HAL_Delay API doesn't work.
While debugging the main application to which startup code jumps i found the SCB->VTOR holding the default value of 0x00200000 even though i am setting this to jump address in the startup code as you can see above post.
Afterwards i manually entered the jump address in the SCB->VTOR register in the I/O register window while debugging the main application , I found that it starts blinking , can you suggest how to solve the issue on the basis of above observation?
2018-07-09 08:54 AM
Perhaps look at SystemInit() in system_stm32f7xx.c. I tend to prefer using the linker to fix up the __Vectors symbol rather than hard code values in source files.