Skip to contentSkip to conversation

error after timeout on serial port

Xenomai-help Lauener Nathan 2 participants 3 messages Feb 23, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

I am polling on a serial port during an init sequence of a positioning device. Every once in a while I get a return code indicating that a timeout occured, code -110 (ETIMEDOUT). After a timeout occured I can't read the port anymore. Whenever I call rt_dev_read() again the function returns the error code -14 (EFAULT). Is there a flag I must clear to get the port operatioanl again?

Regards
Nathan

#1 lore raw
Quoted 8 lines · Lauener Nathan

Hi,

I am polling on a serial port during an init sequence of a positioning device. Every once in a while I get a return code indicating that a timeout occured, code -110 (ETIMEDOUT). After a timeout occured I can't read the port anymore. Whenever I call rt_dev_read() again the function returns the error code -14 (EFAULT). Is there a flag I must clear to get the port operatioanl again?

I /tend/ to say it's an application bug, because we are using the driver heavily, and our sluggish devices often cause timeouts during setup. Some colleague should have already slapped me otherwise. :)

Are you sure that a valid buffer and a valid size is passed to rt_dev_read after the timeout (because those should be the reason for EFAULT)? If yes, maybe you can post a simple demo for the effect.

Jan

#2 lore raw

Hi Jan,

Thank you for your advice. After receiving a timeout I didn't set the size again before calling rt_dev_read(). It now works smoothly. Thanks again.

Nathan

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]
Gesendet: Freitag, 23. Februar 2007 15:52
An: Lauener Nathan
Cc: [email protected]
Betreff: Re: [Xenomai-help] error after timeout on serial port

Quoted 8 lines · Lauener Nathan

Hi,

I am polling on a serial port during an init sequence of a positioning device. Every once in a while I get a return code indicating that a timeout occured, code -110 (ETIMEDOUT). After a timeout occured I can't read the port anymore. Whenever I call rt_dev_read() again the function returns the error code -14 (EFAULT). Is there a flag I must clear to get the port operatioanl again?

I /tend/ to say it's an application bug, because we are using the driver heavily, and our sluggish devices often cause timeouts during setup. Some colleague should have already slapped me otherwise. :)

Are you sure that a valid buffer and a valid size is passed to rt_dev_read after the timeout (because those should be the reason for EFAULT)? If yes, maybe you can post a simple demo for the effect.

Jan