Com port number when programming leonardo via bootloader

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all
I was using AVRDUDE command line instructions to program a leonardo via its bootloader. Initially it had me stumped until someone pointed out that the com port ennumerated under the Windows device manager changes com number while in bootloader mode. (I.e. it briefly exists as a different com port number when in bootloader mode for about 8 seconds after reset or power up - or after a 1200 baud connect and disconnect happens).
So when I reset the board -I noted this 'temporary' com number to use in the command line.
Once I'd edited this correct (boot mode) com number in the command line, all was well. In the arduino IDE, the com port selected by the user during setup is the one which ennumerates after the leonardo has been powered up for more than 8 seconds and has 'settled' - this is the port number which is shown bottom right in the IDE.
So my question is - how does the IDE know which com port to use during the downloading via bootloader? I'd like to look at doing an app at some point that downloads code to the device and I presume the IDE authors were faced with the same challenge.
Russell

Last Edited: Sat. Oct 28, 2017 - 08:04 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Arduino is open source - you can look at the source and see precisely how they do it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks didn't realise - good idea. Will do.