cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H750 GPIO G11 not work as output mode

fema
Associate III

I have two hardware boards mount with STM32H750 . I want to set the GPIO G11 to high , the code as below :

 __HAL_RCC_GPIOG_CLK_ENABLE();

   HAL_GPIO_WritePin(GPIOG, GPIO_PIN_11, GPIO_PIN_SET); 

   GPIO_InitStruct.Pin    = GPIO_PIN_11;

   GPIO_InitStruct.Mode   = GPIO_MODE_OUTPUT_PP;

   GPIO_InitStruct.Pull   = GPIO_PULLUP;

   GPIO_InitStruct.Speed   = GPIO_SPEED_FREQ_LOW; 

HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);

One board work but another don't .

The corresponding bit on the "GPIO input data register" on failure board will not set after i run the above codes.

Any idea ?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

If the pin is shorted to ground through a hardware error, setting it to output high will have no effect other than sinking ~30mA of current. The IDR will still show up as low even if the ODR bit is high. Might be what is happening here.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

3 REPLIES 3
TDK
Guru

If the pin is shorted to ground through a hardware error, setting it to output high will have no effect other than sinking ~30mA of current. The IDR will still show up as low even if the ODR bit is high. Might be what is happening here.

If you feel a post has answered your question, please click "Accept as Solution".

Going to have to validate the design more critically. Make sure you don't have other things on the net, and that all the VDD pins are connected.

Review the register content in the debugger.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
fema
Associate III

Thanks for your reply , That was our fault after hardware guys confirmed the G11 short to ground through another failure component .