Go Down

Topic: How to remove COM&LPT device function [Solved] (Read 457 times) previous topic - next topic

arduiko

Feb 22, 2018, 01:08 pm Last Edit: Feb 25, 2018, 03:12 pm by arduiko
Hello,

By browsing the description of other devices (from vendor), I seen that they don't have such device function (COM&LPT).

But my arduino have it, so the request is simple, which code from the bootloader source code should I remove to shutdown this device function ?

pert

Which Arduino are you talking about?


DrAzzy

If you remove the COM port functionality from the bootloader, why have a bootloader? That functionality is used to upload code.

You are starting IMO too many threads about related USB issues, so someone answering in each thread doesn't see the whole picture of what you're trying to do (I sure can't figure it out).

I am very suspicious that this is an x-y problem.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

arduiko

#4
Feb 22, 2018, 07:41 pm Last Edit: Feb 22, 2018, 08:50 pm by arduiko
if my Logitech G300S Gaming mouse don't have COM port, how it's working without it ?

And I want to do that just because I want it, nothing else, do you have any problem with that ?

And you cannot say if someone answering me will be confused because for now, no one answered me about my problem, just talking about why I ask such questions.

DrAzzy

#5
Feb 22, 2018, 08:24 pm Last Edit: Feb 22, 2018, 08:29 pm by DrAzzy
The Leonardo is programmed by triggering a reset (IIRC this is done by opening and closing serial port at 2400 baud, which is detected by the virtual com port code that runs as part of the sketch, and resets it into the bootloader. The bootloader then presents as a virtual com port (just like normal) and implements some standard serial programming protocol over this serial port.

So getting rid of the com port functionality in the bootloader will get rid of the ability to program the leonardo over USB using the bootloader, hence making the bootloader pointless, while getting rid of it in the sketch will mean you'll have to double-tap reset to get into the bootloader to reprogram it (it could still be put into DFU mode and flashed using Atmel FLIP, or you could upload code via ISP programmer). If you get rid of that in the bootloader, you might as well not use a bootloader....

Your mouse acts as a HID device. There is also no facility for reprogramming your mouse over USB.

I strongly suspect that this is an x-y problem, and that there is a much simpler solution to your original problem, rather than doing all manner of strange things to the USB code. Maybe there isn't, but these threads have all the hallmarks of an x-y problem.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

arduiko

#6
Feb 22, 2018, 08:42 pm Last Edit: Feb 22, 2018, 08:50 pm by arduiko
Thanks for arguing how important is to keep the COM port open.

But I still want to know how to remove it. so this thread still not resolved.

Stop seeing other problem than the actual one, what are you trying to do, trust me or not. this is my only problem in this thread.

DrAzzy

Since you're removing all hope of the bootloader doing it's job, wouldn't it be a better solution to dispense with the bootloader entirely (and upload by ISP or export hex -> DFU)? That would get you 2k of extra flash and slightly faster startup too...
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

arduiko

#8
Feb 22, 2018, 09:15 pm Last Edit: Feb 22, 2018, 09:22 pm by arduiko
Logitech Dev: Since we're removing all hope of the bootloader doing it's job, wouldn't it be a better solution to dispense with the bootloader entirely (and upload by ISP or export hex -> DFU)? That would get we 2k of extra flash and slightly faster startup too...

Logitech Boss: (Close the Enterprise)

sterretje

I have no experience with it but have an interest in 32U4 related stuff. Note that there is a risk that you already know this.

My feeling is that you have to remove the vid/pid that's responsible for the serial port; there might be some of the others that you might want to remove as well.

If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

arduiko

#10
Feb 23, 2018, 02:19 pm Last Edit: Feb 23, 2018, 02:26 pm by arduiko
It's not working.
https://imgur.com/a/gNe1s

arduiko

#11
Feb 25, 2018, 02:52 pm Last Edit: Feb 25, 2018, 03:30 pm by arduiko
Problem solved by remove CDC_GetInterface() and CDC_Setup() in SendInterfaces() and ClassInterfaceRequest() in USBCore.cpp:
Code: [Select]

static u8 SendInterfaces()
{
u8 interfaces = 0;

//CDC_GetInterface(&interfaces);

    #ifdef PLUGGABLE_USB_ENABLED
        PluggableUSB().getInterface(&interfaces);
    #endif

return interfaces;
}

Code: [Select]

// Handle CLASS_INTERFACE requests
static bool ClassInterfaceRequest(USBSetup& setup)
{
u8 i = setup.wIndex;

//if (CDC_ACM_INTERFACE == i)
//return CDC_Setup(setup);

    #ifdef PLUGGABLE_USB_ENABLED
        return PluggableUSB().setup(setup);
    #endif
   
return false;
}

Go Up