cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4A6 GPIO PC8 pin can't be pulled to low

Owenlu
Associate II

Hi,

i Pin PC8 is configured as GPIO,  but unfortuately, after execute following codes

HAL_GPIO_WritePin(GPIOC, GPIO_PIN_8, GPIO_PIN_SET) and

HAL_GPIO_WritePin(GPIOC, GPIO_PIN_8, GPIO_PIN_RESET) , the pin status didn't change,

always keeps in High status. other GPIOs like PD2 wroks with the same way.

Debug MCU configuration register (DBGMCU_CR) is in default setting (0x0).

 

CUBEIDE Version: 1.13.2

 

could you please let me know what is wrong?

4 REPLIES 4
Andreas Bolsch
Lead II

Did you actually *verify* the GPIO register contents (in particular MODER, OTYPE, ODR, IDR) after the calls of HAL_GPIO_Write_pin against expected contents? LCD controller used?

SofLit
ST Employee

Hello  @Owenlu,

Please:

Check if you have already enabled GPIOC RCC clock.

Check if you've already configured the pin PC8 in output push-pull.

Check if there is something connected to PC8 pin that forces it to that level.

Check the content of ODR register after writing to the pin PC8.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Owenlu
Associate II

@SofLit 

Check if you have already enabled GPIOC RCC clock.

A:Clock enabled:(RCC_AHB2ENR= 0x4200f)

Check if you've already configured the pin PC8 in output push-pull.

A:  GPIOC_MODER value 0xf2a1595d, MODER8 is 0x1, output

    GPIOC_OTYPER is 0, output push-pull, No PULL up/Down.

Check if there is something connected to PC8 pin that forces it to that level.

A: PC8 now is isolated from PCB, no other connection

Check the content of ODR register after writing to the pin PC8.

A: after setting GPIOC_ODR=0x100 

yes, registers value is as expected. 

there is no LCD interface/controller used in the project.