Skip to main content
Explorer
September 29, 2024
Solved

LED won't toggle

  • September 29, 2024
  • 8 replies
  • 6320 views

I am trying to toggle one of the LED lights of STM32 NUCLEO-L552ZE-Q board. I am working with the latest version of STM32CubeIDE 1.16.1. The steps I followed are given in the picture. However, I find this error when I debugg:

set *(int *)0xE000EDFC=*(int *)0xE000EDFC|0xFF0

Program received signal SIGINT, Interrupt.

0x080006bc in HAL_IncTick () at ../Drivers/STM32L5xx_HAL_Driver/Src/stm32l5xx_hal.c:303

303 }

 

Also, the pics show more. I tried many things to fix this issue but couldn't.

Has someone face the same issue and how did you solve it? Any help is highly appreciated.

    This topic has been closed for replies.
    Best answer by Karl Yamashita

    I assume it compiles without errors? Can you program with STM32CubeProgrammer?

    8 replies

    emb_rfAuthor
    Explorer
    September 29, 2024

    The images of the errors:

    Screenshot 2024-09-29 020154.png

    Screenshot 2024-09-29 020203.png

    Screenshot 2024-09-29 020620.png

    Am I doing something wrong in the configuration or ???

    Graduate II
    September 29, 2024

    Perhaps start with one of the NUCLEO-L552 examples in the CubeL5 repository trees, and then add code for LED toggling to that?

    emb_rfAuthor
    Explorer
    September 29, 2024

    It didn't work unfortunately :(

    Graduate II
    September 29, 2024

     

    Why is your clock at 4MHz? Anyways, why don't you use the Board Selector which will make sure everything is optimally setup including the clock.

     

    KarlYamashita_0-1727571852442.png

     

     

    emb_rfAuthor
    Explorer
    September 29, 2024

    emb_rf_0-1727624275547.png

    It didn't work. This was the result.

    Graduate II
    September 29, 2024

    Copy and paste the code you've written. Be sure to use the </> when posting the code.

    Graduate II
    September 29, 2024

    The IOC file in your project

    Graduate II
    September 29, 2024

    Does the LED ever blink?

    Or just errors during debugging?

     

    emb_rfAuthor
    Explorer
    September 29, 2024

    Just errors during debugging. 

    None of these blink.

    emb_rf_0-1727638768178.png

     

    Graduate II
    September 29, 2024

    Not sure if it'll make a difference but you don't have debugging enabled.

    KarlYamashita_0-1727639225043.png

     

    I've tried on another Nucleo with Debug off and I don't run into errors. I have a counter variable that still counts up and updates in the Expressions. So that is why i say it may not make a difference if you do enable it.

    emb_rfAuthor
    Explorer
    September 29, 2024

    thank you, yes, I also have tried that, but no difference. Still I get the same problem. 

    Graduate II
    September 29, 2024

    I have a lot of Nucleo boards but unfortunately i don't have the one your have. Just out of curiosity, place a breakpoint on SystemClock_Config and MX_GPIO_Init and see if you can get past HAL_Init and SystemClock_Config functions without any errors?

    emb_rfAuthor
    Explorer
    September 29, 2024

    No, unfortunately, it gives the same error.

    emb_rf_0-1727642310086.png

    emb_rf_1-1727642352790.png

     

     

     

    Graduate II
    September 29, 2024

    I assume it compiles without errors? Can you program with STM32CubeProgrammer?

    emb_rfAuthor
    Explorer
    September 29, 2024

    yes, no errors in compiling. Sure, I can give a try.