I'd like to redirect STDIO to USB CDC (virtual serial port). SAME54 + ASF4 project set up with Atmel Start.
It seems that Atmel Start supports redirecting STDIO to a USART, but not to USB.
My current workaround is to use sprintf() to print formatted text to a buffer, and cdcdf_acm_write() to write the buffer to USB CDC:
char buffer; sprintf(buffer, "One plus one is %i\n", 2); cdcdf_acm_write((uint8_t *)buffer, strlen(buffer));
It's functional, but not pretty. I'd much prefer to use printf() directly.
Anyone have a solution?
[cross-posted to the AVR Freaks ASF4 forum in reply to someone who had this problem 2+ years ago, but not clear if it was ever solved]