cancel
Showing results for 
Search instead for 
Did you mean: 

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.

CG3
Associate III

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 ...

10 REPLIES 10
CG3
Associate III

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

Mike_ST
ST Employee

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.

CG3
Associate III

Thank you let me try this

CG3
Associate III

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 ?

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

You should be able to go step by step.

CG3
Associate III

Dear Mike

Download verified successfully 

but there is no blinking on board ...

please recommend what I should check

Please attach your ioc file and your main.c file to this thread.

CG3
Associate III

Dear Mike I upload all files in zip here :

https://drive.google.com/file/d/1KrVC-9MLMR-JmiA6xMrF3vWiPJyrU-c8/view?usp=share_link

Thank you for helping in advance

Thank you.

So problem is that you've selected the HSE as input for the PLL when on the board SB12 and SB13 are not closed.

So you have 2 options:

1) select the HSI as input for the PLL: 

RCC_OscInitStruct.OscillatorType = /*RCC_OSCILLATORTYPE_HSE|*/RCC_OSCILLATORTYPE_HSI;

 /*RCC_OscInitStruct.HSEState = RCC_HSE_ON;*/

 RCC_OscInitStruct.HSIState = RCC_HSI_ON;

 RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;

 RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;

or

2) close SB12 and SB13.

Hope that helps