2018-05-18 01:19 PM
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!!
2018-05-18 04:07 PM
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.
2018-05-20 05:12 AM
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
2018-05-20 09:03 AM
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.
2018-05-27 11:38 AM
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?
2018-05-28 12:34 AM
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.