2022-09-14 05:38 AM
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..
Solved! Go to Solution.
2022-09-19 03:41 AM
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
2022-09-14 06:44 AM
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
2022-09-14 09:40 PM
@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 ??
2022-09-14 11:55 PM
2022-09-15 12:39 AM
@Peter BENSCH Thank you sir for your help & Kind Information.
2022-09-15 02:08 AM
@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.
2022-09-19 03:41 AM
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
2022-09-19 04:17 AM
@Peter BENSCH Thank you sir for your help, Now I have understand the things about that & Project is Working Properly.
2022-09-19 06:49 AM
Great, you're welcome!
Regards
/Peter