Hi,
I am hoping to send/receive binary data (a protocol) on the same UART that has logging/shell enabled. Is there a way to access the UART RX traffic that the shell gets? I would like to pass it on to a function of my own for processing.
Hi,
I am hoping to send/receive binary data (a protocol) on the same UART that has logging/shell enabled. Is there a way to access the UART RX traffic that the shell gets? I would like to pass it on to a function of my own for processing.
Hi Terence,
I am not sure what you want to do and what is the use case, and also if I fully understand the requirements/needs.
Nonetheless:
UART Exercise talks about accessing the uart tx and rx buffers.
UART Echo sample demonstrates how to use the UART serial driver. It reads data from the console and echos back.
UART Passthrough sample virtually connects two UART instances. It reads data from console and transmits to the other interface.
Shell UART API might also be of interest to you
/br,
Naeem
Thank you. Basically, I want to do something like the following:
void uart_rx(uint8_t *data, uint16_t length) { // In the Shell UART example, the shell is already churning over incoming bytes shell_rx_processing(data, length); // I want my own custom protocol engine to churn over the same incoming bytes // in parallel to the shell's processing my_custom_protocol_rx_processing(data, length); }
Could you point me to where in the code I would need to add this additional processing?
In the echo bot for example, the print_uart function is kind of custom implementation you are looking for, ain't it?
In the serial callback, the received data is put in uart message queue and then processed.
Yes, that's what I'm looking for. However, when the shell is enabled (CONFIG_SHELL=y), I'm not sure where this serial_callback is. Can someone point me in the right direction?
Yes, that's what I'm looking for. However, when the shell is enabled (CONFIG_SHELL=y), I'm not sure where this serial_callback is. Can someone point me in the right direction?