arduino / ArduinoCore-avr

The Official Arduino AVR core
https://www.arduino.cc
1.25k stars 1.06k forks source link

-DCDC_DISABLED not working #534

Open Phoen11xx opened 1 year ago

Phoen11xx commented 1 year ago

Hello. I am trying to create a usb device and I need to disable the CDC so that only the hid device works. To install the code, I use usbasp. After enabling the -DC DC_DISABLED parameter or adding define, the CRC still works and I get a hid device plus a non-working device. Does anyone know the solution to this problem?

per1234 commented 1 year ago

Hi @Phoen11xx. Thanks for your report. I know there has been a recent discussion about the use of this macro on Arduino Forum:

https://forum.arduino.cc/t/remove-serial-port/1123859

Is that you? I ask because that discussion contains valuable information about how the users are setting the macro (via the boards definition instead of trying to do it via the sketch code).

Phoen11xx commented 1 year ago

These not my forum thread. but i have exactly the same problem.

facchinm commented 1 year ago

The issue is very likely due to how Windows caches the USB descriptors; you can try changing the productVersion field here , replacing 0x100 with any other number, to check if it forgets the previous association.

Phoen11xx commented 1 year ago

I recorded a video showing this problem: https://www.youtube.com/watch?v=9o1CELyCOsc It doesn't look like the problem is in the cache. digitalWrite still working but mouse.move not working with CDC_DISABLED define

Phoen11xx commented 1 year ago

@facchinm I was wrong about the cache. I change 0x100 to 0x101 and it worked

Phoen11xx commented 1 year ago

Maybe replace this number with a timestamp or compilation number? there is no information about possible caching in the comments to this option