Skip to main content
Visitor II
November 4, 2024
Solved

STM32H7 PC2_C and PC3_C GPIO not working

  • November 4, 2024
  • 2 replies
  • 2281 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?

    2 replies

    mƎALLEmAnswer
    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?

    Peter3718Author
    Visitor II
    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

    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

     

    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

     

     

    Peter3718Author
    Visitor II
    November 15, 2024

    Thanks Andrew, 

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

     

    Peter

    Super User
    November 15, 2024