Skip to main content
Visitor II
September 14, 2022
Solved

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

  • September 14, 2022
  • 3 replies
  • 2366 views

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

    This topic has been closed for replies.
    Best answer by Peter BENSCH

    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

    3 replies

    Technical Moderator
    September 14, 2022

    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

    SGoel.2Author
    Visitor II
    September 15, 2022

    @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 ??

    Technical Moderator
    September 15, 2022
    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
    SGoel.2Author
    Visitor II
    September 15, 2022

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

    SGoel.2Author
    Visitor II
    September 15, 2022

    @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