I'm trying to get a simple project up and running that requires a USB CDC Serial Port, a few interrupts, I2C, etc...
I am a self taught AVR guy. Did a professional project using an STM8. This is my first real CortexM project.
I've created an Atmel Start project that includes the USB CDC Echo example. The example works on my board, but modifying the code to eliminate the echo and build a proper terminal interface has turned out more difficult and hackish then I thought it would be.
The echo appears to be occuring in the bulk_out and bulk_in callbacks. The following code will display typed keys on the LCD. I have confirmed that cdcdf_acm_write() will send text strings to my PC as expected.
However, unusually I found that in the bulk_out function, if I didn't perform a write of length 0, that these callbacks would stop firing when I would type random letters into my terminal program.
In short, I do not how the USB CDC ACM driver works. I also cannot find documentation for it. Does documentation for it exist? I have the ASF4 API Reference manual. A google search for cdcdf_acm_write isn't bearing much fruit.
* \brief Callback invoked when bulk OUT data received
static bool usb_device_cb_bulk_out(const uint8_t ep, const enum usb_xfer_code rc, const uint32_t count)
//cdcdf_acm_write((uint8_t *)usbd_cdc_buffer, count);
/* No error. */
* \brief Callback invoked when bulk IN data received
static bool usb_device_cb_bulk_in(const uint8_t ep, const enum usb_xfer_code rc, const uint32_t count)
/* Echo data. */
int x = cdcdf_acm_read((uint8_t *)usbd_cdc_buffer, sizeof(usbd_cdc_buffer));
/* No error. */