Skip to main content
Associate III
November 4, 2024
Solved

STM32H7 PC2_C and PC3_C GPIO not working

  • November 4, 2024
  • 11 replies
  • 2364 views

Originally a reply in this thread: https://community.st.com/t5/stm32cubemx-mcus/bug-cubemx-should-warn-h7-users-against-pc2-c-pc3-c-pitfalls/td-p/708817

 

Hi,

What's wrong with PC2_C and PC3_C???  I am using them as normal GPO on my board, but it's not working, while PC0 and PC1 are working, same initialization and HAL_GPIO_WritePin() operation.

Thanks

Peter

This topic has been closed for replies.
Best answer by mƎALLEm

Hello,

How did you configure the internal switches?

 

SofLit_1-1730721256921.png

SofLit_2-1730721310653.png

They need to be closed. So their respective values of PCXSO in SYSCFG_PMCR register needs to be 0.

+ Read this article: https://community.st.com/t5/stm32-mcus/faq-default-state-of-stm32h7-switches-connecting-pxy-c-and-pxy/ta-p/49300

What is the exact STM32H7 part number you are using?

11 replies

mƎALLEm
mƎALLEmBest answer
ST Technical Moderator
November 4, 2024

Hello,

How did you configure the internal switches?

 

SofLit_1-1730721256921.png

SofLit_2-1730721310653.png

They need to be closed. So their respective values of PCXSO in SYSCFG_PMCR register needs to be 0.

+ Read this article: https://community.st.com/t5/stm32-mcus/faq-default-state-of-stm32h7-switches-connecting-pxy-c-and-pxy/ta-p/49300

What is the exact STM32H7 part number you are using?

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
Peter3718Author
Associate III
November 15, 2024

Thanks

it seems i misled by the H755 user manual.

please check H755 rm0399, page 587

Peter3718_0-1731638381455.png

it states 0 is close, actually 1 is close. 

Peter3718_1-1731638571150.png

I read PMCR, 0x300 0000, and PC2, PC3 GPIO function is normal now.

0 is default register value from reset, but GPIO is not working.

 

I think CUBEMX need to generate these switch code if GPIO function is selected.

 

Peter

mƎALLEm
ST Technical Moderator
November 15, 2024

The default status of the switches depends on the package:

SofLit_0-1731654701438.png

Also, read this article: https://community.st.com/t5/stm32-mcus/faq-default-state-of-stm32h7-switches-connecting-pxy-c-and-pxy/ta-p/49300

 

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
Andrew Neil
Super User
November 4, 2024

@Peter3718 wrote:

What's wrong with PC2_C and PC3_C???


The original thread stated "speed limitations" - check the datasheet for details.

Did you review the linked threads?

What speeds are you trying to achieve?

What is your configuration?

Please show your schematic

What, exactly, is "not working" ?

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228

 

 

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.
Peter3718Author
Associate III
November 15, 2024

Thanks Andrew, 

It seems i found an error of your user manual. please see above reply.

 

Peter

Andrew Neil
Super User
November 15, 2024

@Peter3718 wrote:

Thanks Andrew, 

It seems i found an error of your user manual.


Not my manual!

https://community.st.com/t5/community-guidelines/st-community-welcome-guide/ta-p/575223#:~:text=How%20to%20identify%20ST%20employees%C2%A0

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.