Skip to main content
Graduate
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. 

 

 

    This topic has been closed for replies.
    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

    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.

    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

    pb33Author
    Graduate
    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);

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

    pb33AuthorAnswer
    Graduate
    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

    Graduate II
    June 13, 2025

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

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

    Super User
    June 14, 2025

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