cancel
Showing results for 
Search instead for 
Did you mean: 

Stm32f0 IAP Bootloader

Hi world!
Associate III

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.

8 REPLIES 8
in mozbek we trust
Associate II

maybe you should set timer interrupt and enable your interrupts when timer interrupt occur

Hi world!
Associate III

I fixxed problem at another way. thanks.

AvaTar
Lead

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.

Thank for resond.

How I get my vector table? So where this table information?

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.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..

Ok i finded document. in "Programming manual"

good work.

if i jump application program, i use __disable_irq. So am i wrong?

>>So am i wrong?

Well unless they magically get enabled some place, you'll never see an interrupt again..

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..