cancel
Showing results for 
Search instead for 
Did you mean: 

UART Multiprocessor and half-duplex mode at the same time

Christoph Hesse
Associate II
Posted on May 18, 2018 at 22:19

Hi,

I would like to combine STM32 UART multiprocessor mode with half duplex mode, connecting a number of slaves in short distance to a STM32 using one wire, or twisted pair differential drivers. In CubeMX, this is not supported by default, only Multiprocessor OR half duplex is possible.

Is there any way to do it with CubeMX?

If not, can I init the UART to use both Multiprocessor mode and half-duplex mode using HAL? It seems possible from the hardware side of things?

Will it be possible to connect all slaves' TX to the same line (possibly using buffers for signal conditioning) without further measures, or do I have to manually set the TX to high impedance when they are not sending?

If I have to do it manually, how do I do it? Deactivate the UART? Set it immediately to RX mode?  

Thanks!!

5 REPLIES 5
T J
Lead
Posted on May 19, 2018 at 01:07

Which processors are you using ?

is the entire set of boards using the same processor ?

There is s new way of comms over one wire, now available on some STM processors.called SWPMI.

not sure which series, I know the new STM32H7 series has it.

otherwise yes, half duplex is ok, and multi processor ? do you mean automated ?

if you want automated addressing scheme, I think CanBus would be good. up to 250KHz.

Otherwise you are talking MODBUS. using RS485.

Posted on May 20, 2018 at 12:12

Hi T J,

I am fine using UART at the moment as my on-chip interface for the communication at 4.5 Mbps. CAN is too slow, Modbus is relatively complicated because of the timing but I might eventually convert the UART in/output to RS485 levels using MAX3284 or something similar. But this is not the question.

The Uart HAL library and CubeMX support either multiprocessor (9bit addressed UART) or half-duplex. In order to use both at the same time, it seems I have to initiate the UART in one of the two modes and then use the LL libraries to add the other one. This is what I would like to have confirmed, or someone tell me how to combine the two modes using HAL.

Any thoughts?

Christoph

Posted on May 20, 2018 at 16:03

still not sure which processor you are using.

I guess the DMA would transfer all 9 bits in a 16bit chunk.

The Uart/HAL/ DMA works very well.

But an auto trigger on  a matched address ?    maybe some of the other guys here have done it.

Set the RxDMA to circular, I set the TxDMA to normal.

Christoph Hesse
Associate II
Posted on May 27, 2018 at 20:38

I solved part of the question - I am deactivated all TX that are not transmitting, and so the transmitting now works fine. However, the question remains about simultaneous multi-processor half-duplex UART set-up.

Are specialists from ST working on these forums as well? Or is there another way to contact ST with questions about HAL?

Posted on May 28, 2018 at 07:34

I would not rely on Cube/HAL, which uses to cover the 'normal' use cases.

UART is normally a point-to-point connection, so you might need different GPIO settings for the multiprocessor mode. I would double-check the regarding section of the reference manual.

I have never tried this mode myself, though.