Skip to main content
CG3
Associate III
January 12, 2023
Question

Hello and thanks in advance for any helping , I start learning recently and my first Blinking codes not working , i guess forget any point , please kindly check codes and pictures and recommend me. I add more pic in reply. please check all.

  • January 12, 2023
  • 3 replies
  • 5329 views

stm32cubeide

i set as attached files, save and it generate codes by itself,

then add codes for blinking and then building ,

finally debugging ...

no blinking at all ...

    This topic has been closed for replies.

    3 replies

    CG3
    CG3Author
    Associate III
    January 12, 2023

    0693W00000Y839TQAR.png0693W00000Y83AVQAZ.png0693W00000Y83AaQAJ.png0693W00000Y83AfQAJ.png0693W00000Y83ApQAJ.pngI add more images

    Mike_ST
    Technical Moderator
    January 12, 2023

    Hello,

    3rd parameter of HAL_GPIO_WritePin should be GPIO_PIN_RESET or GPIO_PIN_SET (0 or 1)

    If I understand well, you're doing test=0 and then test = -test which is always 0.

    There is another function that might interrest you: HAL_GPIO_TogglePin, please have a look.

    Good luck.

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. 
    CG3
    CG3Author
    Associate III
    January 12, 2023

    Dear Mike i did it as attached files ,

    then debug and it continue blinking (red /green...) it means continue uploading?

    0693W00000Y83JXQAZ.png0693W00000Y83JcQAJ.pngHow long it take for debugging?

    Am i forget any setting ?

    Mike_ST
    Technical Moderator
    January 12, 2023

    The LD4 led keeps blinbking RED/GREEN when debugging. That is normal.

    You should be able to go step by step.

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. 
    CG3
    CG3Author
    Associate III
    January 12, 2023

    Thank you let me try this