Skip to main content
Zanon.Luciano
Associate III
April 2, 2020
Solved

Cube MX 5.3.0 ERROR?

  • April 2, 2020
  • 7 replies
  • 1664 views

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

This topic has been closed for replies.
Best answer by Imen.D

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

7 replies

Nikita91
Lead II
April 2, 2020

It's OK.

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

Imen.DBest answer
ST Technical Moderator
April 2, 2020

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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Zanon.Luciano
Associate III
April 2, 2020

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.

ST Technical Moderator
April 2, 2020

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"

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Zanon.Luciano
Associate III
April 2, 2020

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

ST Technical Moderator
April 2, 2020

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.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Piranha
Principal III
April 8, 2020

> 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.