cancel
Showing results for 
Search instead for 
Did you mean: 

I have two devices. Need to setup UART communication?

Vmere.1
Senior

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

4 REPLIES 4
Javier1
Principal

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?
we dont need to firmware by ourselves, lets talk
  • 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.

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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.