Hi,
I'm using the Keil USB library to implement a CDC ACM driver (Keil Middleware v7.3.0) to send data from my LPC4330 to a linux host.
I'm sending an array of bytes to the host from the LPC4330.
The funtion USBD_CDC_ACM_WriteData() sends the data through, but changes all 0x0D(CR) bytes with 0x0A(LF).
Is there a way to disable this "feature", I would like to send through binary data and not have to convert everything to ASCII.
I'm using uVision 5.22.0.0.
/* Send packet to phytec */ osMutexWait(usb_tx_mutex, 0xFFFF); if(USBD_Configured(0U)) { (void)USBD_CDC_ACM_WriteData(0U, ffsk_packet_buff, 29); } osMutexRelease(usb_tx_mutex);
Thanks,
Carel Bosch
I have a project that relies on USBD_CDC_ACM_WriteData() between the MCU and a Linux or Windows host, and I have never seen this translation happen. One packet type I send includes the value of an 8-bit counter -- if this translation were happening I'd be missing a count and I haven't seen that. Have you tried using Wireshark on the Linux host to see the USB packets as they arrive?
How are you opening the port on the Linux side? Linux may be doing the translation for you -- I recommend checking the terminal configuration.
I cleared the ICRNL input mode flag and that fixed my issue.
Maybe next time I'll read the man page like I should have form the start.