STM32H7 PC2_C and PC3_C GPIO not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-04 3:45 AM - last edited on ‎2024-11-04 4:08 AM by Andrew Neil
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
Solved! Go to Solution.
- Labels:
-
GPIO-EXTI
-
STM32H7 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-04 3:52 AM - edited ‎2024-11-04 4:43 AM
Hello,
How did you configure the internal switches?
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-04 3:52 AM - edited ‎2024-11-04 4:43 AM
Hello,
How did you configure the internal switches?
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-04 3:56 AM
@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" ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-14 6:46 PM
Thanks
it seems i misled by the H755 user manual.
please check H755 rm0399, page 587
it states 0 is close, actually 1 is close.
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-14 6:47 PM
Thanks Andrew,
It seems i found an error of your user manual. please see above reply.
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-14 11:11 PM
The default status of the switches depends on the package:
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-15 1:01 AM
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!
something must be wrong.
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-15 1:13 AM
@Peter3718 wrote:Thanks Andrew,
It seems i found an error of your user manual.
Not my manual!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-15 1:14 AM - edited ‎2024-11-15 1:26 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-15 1:42 AM
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:
