cancel
Showing results for 
Search instead for 
Did you mean: 

Cube MX 5.3.0 ERROR?

Zanon.Luciano
Senior

hi, I am working with the NUCLEO-F207ZG card and I have configured USART2 on port D.

Now CubeMx offers me the setting of the RX pin in Push-pull mode !!!!!! The same for CTS !!!

And there is no way to set the pin in any other way !!!

Can anyone give me an explanation ???

0693W000000VCeoQAG.png

1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee

Hello @Zano,

After check with STM32CubeMX V5.6.0, it is possible to select open-drain mode for USART2_RX (see my attached screenshot).

so, please update and use the latest version of STM32CubeMX.

0693W000000VDi3QAG.png

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

7 REPLIES 7
Nikita91
Lead II

It's OK.

In the ST terminology push-pull apply also to input!

Imen.D
ST Employee

Hello @Zano,

After check with STM32CubeMX V5.6.0, it is possible to select open-drain mode for USART2_RX (see my attached screenshot).

so, please update and use the latest version of STM32CubeMX.

0693W000000VDi3QAG.png

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Zanon.Luciano
Senior

Okay Imen,  thanks for your answer,

but this is still wrong in my opinion, cube-mx continues to set the usart RX pin as if it were an output.

Imen.D
ST Employee

According to the reference manual, we can add the "Open Drain" mode option at alternate function:

"When the I/O port is programmed as alternate function: 

• The output buffer can be configured as open-drain or push-pull"

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Zanon.Luciano
Senior

Ah .... thanks Imen,

so this means that by configuring a pin as an alternate function and when the alternate function requires the pin to be an input (usart RX) then the output buffer is automatically disabled and its configuration is superfluous .....

This also means that I have to read the manual better before posting questions like this :D

Imen.D
ST Employee

You are right, when the alternate function (USART RX) this means that the output buffer is disabled.

In fact, when the USART is used in single wire half duplex, the pin must be configured as alternate function open drain (as it is used for transmission and reception). The same when the IP is used in Smartcard mode.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

> In fact, when the USART is used in single wire half duplex, the pin must be configured as alternate function open drain (as it is used for transmission and reception).

Not necessarily. Even on half-duplex lines one can put a series resistor for safety and use push-pull mode. That will be more robust and faster connection compared to open drain and pull-up. That is actually used and recommended, for example for some stepper motor drivers:

https://cdn.instructables.com/FSV/CUMP/JHATJSN0/FSVCUMPJHATJSN0.LARGE.jpg

Instead of connecting Rx and Tx pins like in an image, on STM32 the same can be done by using half-duplex configuration with a single Tx pin in push-pull mode and a 1k series resistor.