I was trying a simple sketch to test out some of the stuff I mentioned in the thread:
#include <HID.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
while(!Serial && millis() < 5000) {}
delay(1000);
}
int loop_count = 0;
void loop() {
Serial.print("Loop Count: ");
Serial.print(++loop_count, DEC);
Serial.print(" Baud: ");
Serial.println(Serial.baud(), DEC);
}
I started this as new thread, in case others run into issues where they setup their WIFI board to do HID and have similar difficulties.
And confirmed that Serial was the native USB serial... i.e. the baud() method exists.
tried to add a delay at the end of loop.
And then found it very difficult to upload. For a bit I felt like the board was bricked.
Probably related to when the board is in ESP32 controlling USB versus the RA4M1 controlling USB, they are different COM ports COM3 and COM13.
I finally was able to get it to upload
It appears to take several iterations of double clicks of the reset button, until I hear the windows notification that some device changed. And then I need to go up to the Tools ->port menu and verify that it now has the other port and select it. And finally, could upload a sketch.
Note: The above sketch will not build if <HID.h> is not included as
Serial.baud() is not defined. Side note: I also verified that with HID included, other source files that do Serial.print and do not include HID.h their output does not output to the Serial port.
Wondering if bootloader on the main processor should have USB support in it? For example, monitor the baud rate and if special baud... ?