2018-11-05 02:45 AM
Hi guys,
Bootloader program is doing jump. But my application code interrupts don't work.
HAL_Delay () does not work.
HAL_GPIO_TogglePin (GPIOA, PA0_LED_Pin);
HAL_Delay (1000); // IS NOT WORK
while (i ++ <1500000) {} // THIS WORK
i = 0;
So the led is blinking but Hal_Delay does not work because the interrupts are not working.
I don't know how to edit the vector table. I wrote a code, but it's not working.
void Remap_Table (void) {
#define APPLICATION_ADDRESS (uint32_t) 0x08004000
__IO uint32_t VectorTable [48] __attribute __ ((at (0x20000000)));
for (uint8_t i = 0; i <48; i ++)
{
VectorTable [i] = * (__ IO uint32_t *) (APPLICATION_ADDRESS + (i << 2));
}
__HAL_RCC_APB2_FORCE_RESET ();
__HAL_SYSCFG_REMAPMEMORY_SRAM();
}
What can I do. I'm using HAL Library.
Good work.
2018-11-05 04:17 AM
maybe you should set timer interrupt and enable your interrupts when timer interrupt occur
2018-11-05 05:05 AM
I fixxed problem at another way. thanks.
2018-11-05 05:06 AM
You bootloader has one vector table - preferably the one from the default startup code.
Your application needs to be built with it's own vector table, i.e. needs a modified startup code.
Setting the vector table is then done in the application, preferably in the startup.
This is how one of my application has done it, only on a CY FM4 controller, not a STM32.
2018-11-05 06:06 AM
Thank for resond.
How I get my vector table? So where this table information?
2018-11-05 06:13 AM
Normally startup_stm32f0xx.s
Make sure you don't disable interrupts in your loader with __disable_irq, and don't transfer control from an interrupt handler or callback routine.
2018-11-05 06:21 AM
Ok i finded document. in "Programming manual"
good work.
2018-11-05 06:51 AM
if i jump application program, i use __disable_irq. So am i wrong?
2018-11-05 06:58 AM
>>So am i wrong?
Well unless they magically get enabled some place, you'll never see an interrupt again..