I'm designing a small electronic gadget with a USB device port.
Now I'm thinking about a good method to upgrade the firmware through the USB. The process should be as simple as possible for the user.
I think there are three main method, each one with pros and cons. In all of them, the user should only press a button while the device is connected to the host (so powered up). At startup, the switch is sensed and, if pressed, the bootloader enters or stop running the application.
CDC The device is seen as a COM port from the host. IMHO this is the simplest method for the developer, but has many cons. First of all, the user should be able to read the COM port number assigned by the host to the device. However I don't know if it is really true. Is it possible to write a software that automatically detects if my USB CDC gadget is connected and automatically communicate to it without knowing the COM port number (or automatically detect it)? Second, the user should install a driver when the device is attached (at lest in Windows, the driver is a .inf file only). Third, a software must be installed on the host to communicate with the bootloader.
DFU It seems USB defined a DFU standard for firmware upgrade through USB connection. If I understood well, even in this case the user should install a driver and should use a custom tool to manage the firmware upload process.
MSD I think this is the simplest method for the user. The host sees the device as a removable disk with a virtual filesystem in it (usually it is FAT12 that is the simplest to implement in the device). The firmware upgrade process is only to drag the new file to the root folder. The only issue I see here is how to report the result of firmware upgrade (success or error) to the user. He can only see a list of files. I can think to create a virtual file, such as SUCCESS.TXT or ERROR.TXT or other similar names, when the firmware upgrade ends. However the host OS could cache the content of the virtual disk, so hiding the new virtual files.
Maybe there are other methods. Which one do you prefer?