2023-11-29 07:21 PM
My target:
I want to use the same uart lines(RX line and TX line) to achieve communication between computers and multiple devices (in other words: multiple slave devices, computer as master).
I use some STM32F072C8 as slave devices, and configure these slave devices as follows:
Total methord:
Test result:
Question:
I want to know whether the data transfer from SRAM to USART through DMA will be broken and transfer again when an exti interrupt occurs on USART TX pin.
Solved! Go to Solution.
2023-11-29 08:04 PM
I mean, it'll do whatever your code tells it to do. If you put in a delay, it'll wait that delay. If you restart the transfer when EXTI happens, it'll do that.
The scheme you outlined can definitely work, but the slaves need to know how long to wait in order to not talk over one another, without getting input from the master. This can be tricky to solve in practice, unless you want to hard code the slaves separately. Bus contention in general is a nontrivial problem.
Using UART for this type of communication opens a can of worms. Perhaps I2C would be better as the problem of bus contention is solved by the protocol. Still only needs 2 wires connecting all devices. Similar speeds.
2023-11-29 08:04 PM
I mean, it'll do whatever your code tells it to do. If you put in a delay, it'll wait that delay. If you restart the transfer when EXTI happens, it'll do that.
The scheme you outlined can definitely work, but the slaves need to know how long to wait in order to not talk over one another, without getting input from the master. This can be tricky to solve in practice, unless you want to hard code the slaves separately. Bus contention in general is a nontrivial problem.
Using UART for this type of communication opens a can of worms. Perhaps I2C would be better as the problem of bus contention is solved by the protocol. Still only needs 2 wires connecting all devices. Similar speeds.
2023-11-29 11:13 PM
Thank you for your answer.
After some reading and test, finally I find there is no special work about DMA transmit. MCU is just do what the code tells it.
In this question, suitable EXTI Interrupt delay can avoid slave devices UART TX sending crash by a not skillful method.
:handshake: