cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 PC2_C and PC3_C GPIO not working

Peter3718
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
SofLit
ST Employee

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 on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

11 REPLIES 11
SofLit
ST Employee

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 on "Accept as Solution" on the reply which solved your issue or answered your question.
Andrew Neil
Evangelist III

@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

 

 

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

Thanks Andrew, 

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

 

Peter

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 on "Accept as Solution" on the reply which solved your issue or answered your question.

anyway, for H755, these bit has to be set for right GPIO function, however SET means OPEN base on datasheet.

but in HAL, it is CLOSE! 

Peter3718_1-1731661231669.png

something must be wrong.

Peter

 

Sorry I did understand the issue.

This API is generic to all H74x/H75x MCUs and the user needs to open/close the switch according to his needs and according to the package he has.

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.

I mean RM0399 user manual should be revised as following:

1: Analog switch closed

0: Analog switch open

do you think so?

 

The old is: 

Peter3718_0-1731662828266.png