In what case would UART serial driver fail to write some bytes out?
I've realized that sometimes after 10 seconds, sometimes after five minutes my chSequentialStreamWrite which uses SD3 would hang up. The thread was in WTQUEUE state indefinitely, so I've moved to chnWriteTimeout method instead and it now sometimes fails to write all 100 bytes at 115KB in 10 seconds. When would this happen? I am pretty sure only one thread is accessing SD3. Could I be exhausting any buffer? Should I increase SERIAL_BUFFERS_SIZE ?
ChibiOS 2.6.3
when does UART write fail?
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: when does UART write fail?
Hi,
This is a known bug in 2.6.x, it has already been fixed in repository and will be fixed in 2.6.5/3.0.0.
Giovanni
This is a known bug in 2.6.x, it has already been fixed in repository and will be fixed in 2.6.5/3.0.0.
Giovanni
Re: when does UART write fail?
Looks like fresh serial_lld.c has solved this issue, thank you for the hint.
So, in real life UART should never fail? Is it safe to put an assertion that write() method writes all bytes?
So, in real life UART should never fail? Is it safe to put an assertion that write() method writes all bytes?
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: when does UART write fail?
It always writes all bytes unless you specify TIME_IMMEDIATE, in that case it just fills the buffer as much as possible without waiting.
Giovanni
Giovanni