cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use PH1 as GPIO if I config PH0 as HSE BYPASS Clock Source? The same question on PC14, PC15 for LSE. my chip is STM32H seriies. tks adv.

Jerry1
Associate
 
9 REPLIES 9
TDK
Guru

Yes.

10.3.14 Using the HSE or LSE oscillator pins as GPIOs

When the HSE or LSE oscillator is switched OFF (default state after reset), the related oscillator pins can be used as normal GPIOs.

When the HSE or LSE oscillator is switched ON (by setting the HSEON or LSEON bit in the RCC_CSR register) the oscillator takes control of its associated pins and the GPIO configuration of these pins has no effect.

When the oscillator is configured in a user external clock mode, only the OSC_IN or OSC32_IN pin is reserved for clock input and the OSC_OUT or OSC32_OUT pin can still be used as normal GPIO.

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

Although it is mentioned that the PH1 is useable as a I/O, I do not succeed in doing so, on the standard configuration of a NucleoL053 where a 8Mhz clock signal is supplied from the ST-link part.

+1

Concurring with your observation on the L0 series, definitely doesn't function with the STM32L072CZ used on the Murata LoRa device

Not usable as a GPIO w/BYPASS

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

> Although it is mentioned that the PH1 is useable as a I/O

Where?

JW

Now this admittedly is talking about OSC_IN, but the reasonable inference is that OSC_OUT should be uninvolved, and usable.

At a minimum this is poorly documented and misleading

0693W000006GCVlQAO.jpgI haven't tested the H7 implementation, but I'd be cautious..

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

A secondary effect would be some potentially very undesirable behaviour out of the system boot loader..

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

PC14/PC15 on STM32 implementations generally are within the low power domain, these pins have low drive expectations. Check data sheet on specifics

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

@Community member​ I was convinced that I had read it somewhere, but cannot retrieve it. Maybe it was the table 40 in the reference manual that was misleading me. But in the text it is written that the OSC_OUT must be left "hi-Z". Thanks for pointing this out.0693W000006GEENQA4.pngFrom the moment I used the MSI oscillator instead of the HSE in bypass mode, the output PH1 is useable. As clock resolution and stability is not important for this project, I can continue this way.

TDK
Guru

The initial reply to this post is correct. It works on the H7 series, see https://community.st.com/t5/stm32-mcu-products/in-clock-source-bypass-mode-can-we-use-the-osc-out-as-gpio/m-p/577976/highlight/true#M219627.

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