cancel
Showing results for 
Search instead for 
Did you mean: 

Program works as intended only after a reset or re-powering.

It doesn't work after a flash, but if I do a reset or reconnect the board, it works fine. Is this OK, or I miss something? I use SPL driver.

The application is similar to the demonstration that came with the board (Nucleo-L152RE), except the part for the shield (just the button and the led).

Thank you!

5 REPLIES 5
AvaTar
Lead

I would guess ome issue with interrupts and the vector table.

Instead of meticulously cleaning up after flashing, forcing a reset (via NVIC) could be a suitable solution.

I had to modify a function by adding these first three lines and it works.

void vpc_system_init(void){
  RCC_APB1PeriphClockCmd(RCC_APB1Periph_COMP, ENABLE);
  RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
  RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
 
  my_ticks = 0;
  SysTick_Config(SystemCoreClock / 1000);
}

Thank you for your reply!

But I have to master Interrupt priorities...

Ok.

I supposed a bootloader scenario, where you pass control to the flashed application.

I use to avoid downloading files from forum threads.

It is ok, it helped me to eliminate a cause from the list.