I have two devices. Need to setup UART communication?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-22 6:41 AM
I have two STM32 devices and both are identical, send and receive messages in frame formats. They both have UART, DMA, NVIC etc.
And I need a good strategy to setup a lossless communication between them. There is too much information online, but very little about which is good method. Also this project is configured with RTOS.
What I found online:
--> Interrupts is bad strategy.
--> DMA is the good one, DMA with circular buffer is also a good one.
--> byte format is not reliable, so use frame type.(identifier, address, data, crc)
can someone help me here? I'm actually overwhelmed by these concepts.
Solved! Go to Solution.
- Labels:
-
DMA
-
UART-USART
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-22 11:12 PM
Honestly seem to be over thinking ​this. A simple interrupt method should work to prove the method. Then implement DMA TX, if that improves efficiency.
​
D​oes the packet form provide for synchronization or integrity checking?
​
H​ave you reviewed protocols like SLIP and XMODEM? Or say packet methods used by sensors or GNSS receivers.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-22 6:49 AM
There is no info because your question is still too vage, you still need to make some arquitecture design decisions.
Some examples:
- Which two devices specifically?
- How far are they?
- How fast does the communication need to be?(bytes per second)
- What latency are you able to tolerate?(miliseconds? miroseconds?)
- How realiable does this communication need to be?
- How much RAM/Flash cold you spare for this?
- How many tasks are you running, is your RTOS already pretty busy?
- Do you want to integrate this protocol with an already existing tools/devices echosystem? (for example MAVLINK)
- How experienced is the developer, how much time do you have?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-22 7:06 AM
- Which two devices specifically?
- STM32L431CC
- How far are they?
- less than 3cm.
- How fast does the communication need to be?(bytes per second)
- 9600bps
- What latency are you able to tolerate?(miliseconds? miroseconds?)
- microseconds
- How realiable does this communication need to be?
- Highly reliable. There shouldn't be any loss. (they communicate information, in 14 byte telegrams - send and receive)
- How much RAM/Flash cold you spare for this?
- I have 1MB of RAM, so quite a lot, but no specific number
- How many tasks are you running, is your RTOS already pretty busy?
- Two tasks are running. This communication task should be third one, and no its not busy.
- Do you want to integrate this protocol with an already existing tools/devices echosystem? (for example MAVLINK)
- Nope.
- How experienced is the developer, how much time do you have?
- I have 2 years, but I have 2 month of time. Can be extended upon asking.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-22 11:12 PM
Honestly seem to be over thinking ​this. A simple interrupt method should work to prove the method. Then implement DMA TX, if that improves efficiency.
​
D​oes the packet form provide for synchronization or integrity checking?
​
H​ave you reviewed protocols like SLIP and XMODEM? Or say packet methods used by sensors or GNSS receivers.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-23 4:33 AM
True, but this implementation will be used for many things. I want to have some references where I can properly implement this module.
I don't know SLIP but I looked at XMODEM.
