Skip to main content
Vasile Guta_Ciucur
Senior
December 20, 2018
Question

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

  • December 20, 2018
  • 5 replies
  • 1781 views

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!

    This topic has been closed for replies.

    5 replies

    AvaTar
    Senior III
    December 20, 2018

    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.

    Vasile Guta_Ciucur
    Senior
    December 20, 2018

    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!

    Vasile Guta_Ciucur
    Senior
    December 20, 2018

    But I have to master Interrupt priorities...

    AvaTar
    Senior III
    December 20, 2018

    Ok.

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

    I use to avoid downloading files from forum threads.

    Vasile Guta_Ciucur
    Senior
    December 20, 2018

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