Disable CDC Arduino Zero

There is a way to disable CDC on the Native port for the Arduino Zero?
I have a problem listing both endpoint as CDC instead HID


COM29 is the CDC and COM30 is the HID.
I tried to use -DCDC_DISABLED but i just get this error

C:\Users\nuyel\AppData\Local\Temp\arduino-sketch-E625889ECD94B1BD0E8C3A03A42661E3/core\core.a(USBCore.cpp.o): In function `USBDeviceClass::ISRHandler()':
C:\Users\nuyel\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\cores\arduino\USB/USBCore.cpp:921: undefined reference to `Serial_::handleEndpoint(int)'
C:\Users\nuyel\AppData\Local\Temp\arduino-sketch-E625889ECD94B1BD0E8C3A03A42661E3/core\core.a(USBCore.cpp.o): In function `USBDeviceClass::ISRHandler()':
C:\Users\nuyel\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.13\cores\arduino\USB/SAMD21_USBDevice.h:109: undefined reference to `SerialUSB'
collect2.exe: error: ld returned 1 exit status

If I manually change the driver to HID works, but the plan is make a PnP shortcut keys and this just make errors.

Is working now! After a sleep night.
What I did was open USBCore.cpp go to the error at line 921 and encapsulate just that line as

#ifdef CDC_ENABLED
SerialUSB.handleEndpoint(ep);
#endif

To make it easy to use I also duplicate on the boards.txt the entries for Arduino Zero (Prorgamming Port) as Arduino Zero (EDGB No CDC) and modify one line as arduino_zero_edbg_no_cdc.build.extra_flags=-D__SAMD21G18A__ -DCDC_DISABLED {build.usb_flags}


Now just go only HID and works perfectly

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.