10 years, 1 month ago.

Half-duplex UART & SPI support on Nucleo


I am trying to control PhantomX hexapod via my Nucleo-F103RB but realized that neither mbed not STM provides an official port for Half-duplex UART communication. I would suggest the nice folks @ STM to provide an mbed interface for Half-duplex UART and SPI which are already supported by their STM32 chipsets.

The PhantomX: http://www.trossenrobotics.com/phantomx-ax-hexapod.aspx

Thanks Ashwin

Is there any ST board which supports half duplex? I recall that most CMSIS-DAP interfaces are full duplex.

posted by Martin Kojtal 15 Jun 2014

4 Answers

8 years, 7 months ago.

Dear @ST @mbed folks:

Does any status update in SPI half-Duplex support question? I'm using STM32446RE and try to verify SPI half-Duplex function. Just change SPI intial setting from SPI_DIRECTION_2LINES to SPI_DIRECTION_1LINE can not work. Can any one provide some clue? Thanks for any reply.

10 years, 1 month ago.

Not sure that I understand your question correctly, but you can use NC for either TX,RX, MOSI or MISO when declaring serial or SPI ports. This allows you to use the unused pins for some other function.

Hi Wim, Thanks for posting a reply but I am looking for a different answer. Using NC will configure the serial port for simplex (one-way) communication, I am however interested in half-duplex (two-way over single wire) communication.

Thanks Ashwin

posted by Ashwin Vijayakumar 15 Jun 2014
10 years, 1 month ago.

I think it shouldn't be very hard to implement. Even to add it in the mbed libs, but it was years ago removed from there. So you probably going to have to make it yourself by for example inhereting the mbed serial class in your own class, and adding some of your own code. Essentially I guess it is just shorting TX and RX pins of an UART, keeping the TX pin as digital input (with pull up probably), and when putc is called switching that to TX mode and sending your data. Maybe it also has it built-in, but for sure it would be possible to do it in software.

I would look at it, but something I say often lately: Don't have Nucleo boards, so can't do much :)

9 years, 8 months ago.


I am trying to control a PhantomX robotic arm also using a Nucleo Board. I was wondering if you managed to get something working for your hexapod? I need to write my driver in Half-Duplex UART and I've never done this before so if you have something a little help would be appreciated :-)