-
Notifications
You must be signed in to change notification settings - Fork 668
Open
Labels
Type: BugSomething isn't workingSomething isn't working
Description
Description / Steps to reproduce the issue
I'm just playing with Modbus RTU in NuttX and I see that the slave response time is too long and approximately constant at 50ms. Inter frame delay for modbus is 3.5 character, so this delay is much too high (should be below 10ms).

It is directly related to timeout for this select()
:
nuttx-apps/modbus/nuttx/portserial.c
Lines 99 to 110 in e336eba
tv.tv_sec = 0; | |
tv.tv_usec = 50000; | |
FD_ZERO(&rfds); | |
FD_SET(iSerialFd, &rfds); | |
/* Wait until character received or timeout. Recover in case of an | |
* interrupted read system call. | |
*/ | |
do | |
{ | |
if (select(iSerialFd + 1, &rfds, NULL, NULL, &tv) == -1) |
Decreasing this value reduces the response time accordingly. It looks like there is something wrong with this serial logic.
Has anyone verified the slave response time with NuttX before? I don't know if it's broken from the start or is it something new.
On which OS does this issue occur?
[OS: Linux]
What is the version of your OS?
doesn't matter
NuttX Version
master
Issue Architecture
[Arch: all]
Issue Area
[Area: Modbus]
Verification
- I have verified before submitting the report.
cederom
Metadata
Metadata
Assignees
Labels
Type: BugSomething isn't workingSomething isn't working