Skip to main content
Visitor II
January 16, 2025
Solved

STM32L053 GPIO Outputs not working

  • January 16, 2025
  • 2 replies
  • 961 views

Hi,

We have a custom design based on STM32L053C8U8 with the pinout mapping  as image attached. The GPIOs setting and initialization code is generated by STM32CubeIDE version 1.17.0 and companion CubeMX . however, the GPIO level the output pins are not in line with the firmware control using HAL_GPIO_WritePin(). for example, HAL_GPIO_WritePin(GPIOA, GPIO_PIN_11, GPIO_PIN_RESET) won't sew the PA11 to LOW. 

The initialization code is attached. 

What's wrong? thanks in advance and appreciate your responses!

 

 

quanngo_0-1737057327704.png

 



    This topic has been closed for replies.
    Best answer by quanngo

    It's resolved. For those who will see the same problem, this is due to the fact that VDD_USB pin of the STM32L053C8 did not pull up resulting PA11 (and PA12) are not usable.

     

    2 replies

    Graduate
    January 16, 2025

    Make sure that BOOT0 pin is at logic 0 level.

    quanngoAuthor
    Visitor II
    January 16, 2025

    BOOT0 is at 0. btw, the firmware is running but the gpio output is not as expected.

    Graduate II
    January 16, 2025

    Then debug...

    Start by checking the clocks in the RCC, then the pin/bank initialization in the GPIOx peripherals.

    If it's running your code you should be able step through it, set break points and inspect memory/peripherals

    Super User
    January 16, 2025

    Read out and check/post content of GPIOA registers.

    What is connected to PA11? How do you measure it? Did you measure it directly at the chip's pin?

    JW