hi
I created a project that uses Zephyr RTOS on a nRF52840 dk that is attached to a USB port on the computer, and on the computer side, there is Python code that sends configuration data over USB.
It reads config data over USB in hex format, so it is able to read all of the sent data in a single read with the usb_dc_ep_read() function.
It is implemented as follows: usb_dc_ep_read(ep,buff, 64,&read bytes) so that the configuration data length and content can be validated and applied.
After that, I needed to convert the USB to UART, so I used uart_fifo_read() as they did in the Zephyr sample echo_bot, but I had to make some changes because they use ASCII and in my case i sent binary (hex) data .
and I found these two issues:
1. The uart_fifo_read reads byte by byte, which does not work for me, so I cannot determine the length of the single message sent.
2. When sending data with zeros (for example, 0x1156000099), it deletes the zeros and returns 0x115699.
How can I solve these problems and make it work like the USB case without having to store data byte by byte and maybe use timers to handle the data?
thank you