Skip to main content
Associate II
June 13, 2025
Solved

LED2 (Blue) Doesnt Work

  • June 13, 2025
  • 3 replies
  • 944 views

Hello, 

I am using the H753zi board and cannot figure out why my blue led won't turn on. The green and red do work. Any ideas would be greatly appreciated. 

 

 

Best answer by pb33

Okay so I got them all to turn on. Instead of BSP, I used HAL, for example:

HAL_GPIO_TogglePin(LED1_GPIO_PORT, LED1_PIN); // Green LED

3 replies

Andrew Neil
Super User
June 13, 2025

Welcome to the forum.

Please see How to write your question to maximize your chances to find a solution for best results.

 


@pb33 wrote:

I am using the H753zi board


Which H753zi board ?

If it's an ST board, documentation will be available on that board's Product Page:

  • User Manual on the 'Documentation' tab;
  • Schematics on the 'CAD Resources' tab.

either/both of those will tell you the correct GPIO pin for each LED.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Technical Moderator
June 13, 2025

Hello @pb33 ,

Check the board's User manual or Datasheet to confirm the pin assignment.

Ensure that the GPIO pin for the blue LED is correctly configured in your code and is not being used by another peripheral

"When your question is answered, please close this topic by clicking ""Accept as Solution"".ThanksImen"
pb33Author
Associate II
June 13, 2025

Hi Imen, 

 

I looked at the schematic and its telling me PE1 is the pin I should be referencing. There is no other peripherals attached to that pin. 

this is in my main.h file:

#define LD2_Pin GPIO_PIN_1

#define LD2_GPIO_Port GPIOE
I am also doing this in my main.c:

__HAL_RCC_GPIOE_CLK_ENABLE();

/*Configure GPIO pin Output Level */

HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_RESET);

 

/*Configure GPIO pin : LD2_Pin */

GPIO_InitStruct.Pin = LD2_Pin;

GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;

GPIO_InitStruct.Pull = GPIO_NOPULL;

GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;

HAL_GPIO_Init(LD2_GPIO_Port, &GPIO_InitStruct);

Andrew Neil
Super User
June 13, 2025

You still haven't said what board you are using.

Please see How to insert source code for how to properly post source code (the instructions are also in How to write your question to maximize your chances to find a solution - please be sure to read that, too).

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
pb33AuthorBest answer
Associate II
June 13, 2025

Okay so I got them all to turn on. Instead of BSP, I used HAL, for example:

HAL_GPIO_TogglePin(LED1_GPIO_PORT, LED1_PIN); // Green LED

Tesla DeLorean
Guru
June 13, 2025

Ok, but which GPIO Bank(s) and Pin(s) ??

Please show whole working code so we might learn what was happening.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Andrew Neil
Super User
June 14, 2025

@pb33 and you still haven't confirmed what board you actually have.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.