Page 1 of 1

Question, DMA and U(S)ART use

Posted: Wed Apr 11, 2018 6:06 pm
by piwi1263
Hi All,

is the following known and covered in the DMA/UART/USART area.

Efficiently use of DMA with UART RX from ST forum

I'm just wondering how ChibiOS is preventing from data loss on the receiving side as described in above link.

Care to elaborate ?

Thanks in advance,

Peter.

Re: Question, DMA and U(S)ART use

Posted: Wed Apr 11, 2018 7:52 pm
by Giovanni
You can't in principle using UART alone, you need to design a protocol where lost characters are handled using timeouts. The UART driver also allows to start and stop operations allowing to perform partial transfers. Errors are handled using callbacks. Idle detection is also possible but not strictly required IMO.

So let's discuss the protocol first, then design the state machine for the protocol, then how implement to it using ChibiOS.

Giovanni

Re: Question, DMA and U(S)ART use

Posted: Sat Apr 14, 2018 9:32 am
by piwi1263
Hi Giovanni,

thanks for the reply.

The goal was not to start a conversation about protocols and their implementation, sorry for not being all that clear. When I stumbled over the article on STM forum I just was wondering how ChibiOS was preventing from that to happen. How, is not that important to me, basically it is and how to cope with eventualities if they may occur and under what circumstances.

If I've understood your answer correctly from the basics it is handled so I do not need to worry that much on the ChibiOS level.

Thanks again,

Peter.

Re: Question, DMA and U(S)ART use

Posted: Sat Apr 14, 2018 10:17 am
by Giovanni
Hi,

That application not is quite generic, it is a solution for an unspecified problem, just pointing out "we have idle detection".

Giovanni