I apologize, this may not be an issue at all with your platform, but I have been unable to figure out how to use the USB CDC as a serial in the Arduino framework. I have tried to use both the openwch and ch32v build cores to no success. I have not been able to generate a COM device from the USB ports of a generic dev board. I can use the port to upload programs, though.
Best I can assume, this should work as a main.cpp file:
#include <Arduino.h>
#include <stdio.h>
void setup() { Serial.begin(9600); }
void loop() {
Serial.println("Hello, World!");
delay(1000);
}
ini File:
[env:genericCH32V307VCT6]
platform = ch32v
board = genericCH32V307VCT6
framework = arduino
upload_protocol = isp
board_build.core = openwch
board_upload.maximum_size = 294912
board_upload.maximum_ram_size = 32768
When I try openwch or ch32v build cores, nothing happens. When I add:
build_flags =
-D USE_TINYUSB
to openwch, I get
8 | #include "Adafruit_USBD_CDC.h"
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from C:\Users\elimb\.platformio\packages\framework-arduino-openwch-ch32\cores\arduino\wiring.h:48,
from C:\Users\elimb\.platformio\packages\framework-arduino-openwch-ch32\cores\arduino\Arduino.h:36,
from C:\Users\elimb\.platformio\packages\framework-arduino-openwch-ch32\cores\arduino\HardwareSerial.cpp:27:
C:\Users\elimb\.platformio\packages\framework-arduino-openwch-ch32\cores\arduino\WSerial.h:8:10: fatal error: Adafruit_USBD_CDC.h: No such file or directory
I can see the TinyUSB library has been git sub-module included into the libraries folder of the framework. However, it doesn't seem to be found by the rest of the PIO platform.
Any help on getting USB communication set up via any means is appreciated. I do need to stick to C++, and ideally the Arduino framework.
I apologize, this may not be an issue at all with your platform, but I have been unable to figure out how to use the USB CDC as a serial in the Arduino framework. I have tried to use both the openwch and ch32v build cores to no success. I have not been able to generate a COM device from the USB ports of a generic dev board. I can use the port to upload programs, though.
Best I can assume, this should work as a main.cpp file:
ini File:
When I try openwch or ch32v build cores, nothing happens. When I add:
build_flags = -D USE_TINYUSBto openwch, I get
I can see the TinyUSB library has been git sub-module included into the libraries folder of the framework. However, it doesn't seem to be found by the rest of the PIO platform.
Any help on getting USB communication set up via any means is appreciated. I do need to stick to C++, and ideally the Arduino framework.