cancel
Showing results for 
Search instead for 
Did you mean: 

Hello all Hope You are doing well !! I have an issue with Nucleo board g071rb.

SGoel.2
Associate III

I am trying to blink two led's one is connected to pin 5 (green led) and second is red led and for blinking i set it to pin 6 but the issue is that i am not able to blink red led(LD1) and the green led(LD4) is properly working .

Can anyone help me regarding this..

1 ACCEPTED SOLUTION

Accepted Solutions

First of all, a few hints:

If you define GPIOs with STM32CubeMX or STM32CubeIDE as GPIO_Input or GPIO_Output, names are also further defined for them, which can be used alternatively. Example:

HAL_GPIO_WritePin(GPIOA, GPIO_PIN_7, ***);

is in your case equivalent to

HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, ***);

Your notation is not a mistake, but the latter should be easier to understand.

If you are working with FreeRTOS, you should first familiarise yourself with how it works. For tasks in FreeRTOS, for example, HAL_Delay() should not be used, but osDelay(), since osDelay does not block and is handled by timers.

Finally: are you sure that your LED still works and is connected correctly, i.e. with series resistance (depending on forward current and LED colour) of 62 ohms...1.3k?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

8 REPLIES 8
Peter BENSCH
ST Employee

You cannot control LD1 because it is a bicolor LED that is controlled by the embedded ST-LINK. The only user-controllable LED on the NUCLEO-G0B1RB is LD4.

Does it answer your question?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
SGoel.2
Associate III

@Peter BENSCH​ Thank you for your help, I want to ask another thing that if we connect external led to nucleo board and want to blink it that's possible or not?? Why we can blink it ??

Peter BENSCH
ST Employee
Yes, of course you can connect an external LED to one of the unused pins. Please remember to connect a series resistor to limit the LED current.
Also, please remember that the output current of the GPIO is limited, and that for white, blue and blueish-green LEDs the output voltage is a little too close to the forward voltage. Red and yellow LEDs, however, can usually be operated well on STM32 with 3.3V.
Regards
/Peter
In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

@Peter BENSCH​  Thank you sir for your help & Kind Information.

@Peter BENSCH​  Can you please tell me one thing that how can I define pin for external led, I have connected its (+) to Pin D7 externally and (-) at ground and define pin D7 as shown in figure but it is nt working still only green led is working only. I am using RTOS here and defined two tasks StartBlynk01 & StartBlynk02 with respect to LD4 and Red Led.0693W00000SvRwmQAF.png0693W00000SvRwSQAV.png0693W00000SvRwNQAV.png

First of all, a few hints:

If you define GPIOs with STM32CubeMX or STM32CubeIDE as GPIO_Input or GPIO_Output, names are also further defined for them, which can be used alternatively. Example:

HAL_GPIO_WritePin(GPIOA, GPIO_PIN_7, ***);

is in your case equivalent to

HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, ***);

Your notation is not a mistake, but the latter should be easier to understand.

If you are working with FreeRTOS, you should first familiarise yourself with how it works. For tasks in FreeRTOS, for example, HAL_Delay() should not be used, but osDelay(), since osDelay does not block and is handled by timers.

Finally: are you sure that your LED still works and is connected correctly, i.e. with series resistance (depending on forward current and LED colour) of 62 ohms...1.3k?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

@Peter BENSCH​  Thank you sir for your help, Now I have understand the things about that & Project is Working Properly.

Great, you're welcome!

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.