Hello,
I'm currently porting xenomai on my project on a raspberry pi 4B and I would
like some advice, I'm using xenomai 3.0.9 with a ipipe patch that I found on
the web, I managed to set the module xeno_16550A and I was able to replace the
default module that load ttyAMA0 of the pi to /dev/rtdm/rtser0. Beside this, I
was able to adapt the code to the real time task with the Xenomai API, and the
performance I get with each cyclic is really good.
I would like to use this file descriptor to perform some exchange, the simple
test is to connect a Null cable on the RX/TX UART in order to form a loop. I
did import the rtdm/serial.h, and explicitely call the __RT() functions on the
open, write, read and ioctl on the low level functions. I am able to open the
file, configure it with ioctl and the rtser_config struct, and writing on it.
What I am struggling with is the read function, I am not able to retrieve the
correct return value of the read, it always return -1, I'm not sure if my
configuration is correct or not.
The rtser_config is the following :
struct rtser_config my_config;
my_config.config_mask = 0xFFFF; // RTSER_SET_BAUD |
RTSER_SET_TIMESTAMP_HISTORY; // //
my_config.baud_rate = 115200;
my_config.parity = RTSER_NO_PARITY;
my_config.data_bits = RTSER_8_BITS;
my_config.stop_bits = RTSER_2_STOPB;
my_config.handshake = RTSER_RTSCTS_HAND;
my_config.fifo_depth = RTSER_DEF_FIFO_DEPTH;
my_config.rx_timeout = RTDM_TIMEOUT_INFINITE;
my_config.tx_timeout = RTDM_TIMEOUT_INFINITE;
my_config.event_timeout = 1000000000; /* 1 s */
my_config.timestamp_history = RTSER_RX_TIMESTAMP_HISTORY;
my_config.event_mask = RTSER_EVENT_RXPEND;
my_config.rs485 = RTSER_RS485_DISABLE;
Could you help me on this issue ?
Best regards,
Li Xiang.