digistump / DigistumpArduino

Files to add Digistump support (Digispark, Pro, DigiX) to Arduino 1.6.X (1.6.5+)
934 stars 377 forks source link

Edit USB profile to remove serial port #78

Open Shadow7369124 opened 6 years ago

Shadow7369124 commented 6 years ago

Hello there,

Is it possible to remove the serial port from the Digispark attiny85 ?

Someone did it for the Arduino Leonardo : https://github.com/arduino/Arduino/issues/6387

Thanks by advance

Regards

bratoff commented 6 years ago

The serial port is software based. If you don't declare it or use it, the code isn't compiled into your sketch. What problem are you trying to solve?

Shadow7369124 commented 6 years ago

Thanks for your reply

I got nothing to solve. I just want to get rid of the CDC interface.

I would like to disable the serial port that appears in Device manager (Windows 7 x64) when the device is connected.

Thanks by advance

pfeerick commented 6 years ago

Does it go away after 5 seconds? If so, it's the bootloader interface, and you should be able to get rid of it by changing to a version of micronucleus that uses a jumper to go into the bootloader.

bratoff commented 6 years ago

Updating micronucleus on a genuine Digispark could be tricky, since the fuses are set to disable the reset pin, thus disabling ISP programming. You'd have to use an HVSP programmer to reset the fuses, flash the new/modified bootloader, then re-disable reset (or give up on using P5 as an I/O). If you can live without P5, another alternative would be to eliminate the bootloader altogether and always program the ATTiny85 by ISP (shift-upload in the Arduino IDE). That would also get you back about 1.5K of flash space.

Shadow7369124 commented 6 years ago

Thanks for your replies.

I'm gonna try that.

pfeerick commented 6 years ago

@bratoff True, but that is only a problem if micronucleus is broken... as it can update itself, and hence you can switch to the jumper-only bootloader without HVSP ISP. But you're right, if you can live without the P5/reset pin, ISP is the way to go if space is tight. :)