0

Let's see the leonardo section in boards.txt:

leonardo.name=Arduino Leonardo
leonardo.vid.0=0x2341
leonardo.pid.0=0x0036
leonardo.vid.1=0x2341
leonardo.pid.1=0x8036
leonardo.vid.2=0x2A03
leonardo.pid.2=0x0036
leonardo.vid.3=0x2A03
leonardo.pid.3=0x8036

leonardo.upload.tool=avrdude
leonardo.upload.protocol=avr109
leonardo.upload.maximum_size=28672
leonardo.upload.maximum_data_size=2560
leonardo.upload.speed=57600
leonardo.upload.disable_flushing=true
leonardo.upload.use_1200bps_touch=true
leonardo.upload.wait_for_upload_port=true

leonardo.bootloader.tool=avrdude
leonardo.bootloader.low_fuses=0xff
leonardo.bootloader.high_fuses=0xd8
leonardo.bootloader.extended_fuses=0xcb
leonardo.bootloader.file=caterina/Caterina-Leonardo.hex
leonardo.bootloader.unlock_bits=0x3F
leonardo.bootloader.lock_bits=0x2F

leonardo.build.mcu=atmega32u4
leonardo.build.f_cpu=16000000L
leonardo.build.vid=0x2341
leonardo.build.pid=0x8036
leonardo.build.usb_product="Arduino Leonardo"
leonardo.build.board=AVR_LEONARDO
leonardo.build.core=arduino
leonardo.build.variant=leonardo
leonardo.build.extra_flags={build.usb_flags}

What are the meanings of the leonardo.vid|pid.* and of the leonardo.build.vid|pid? Perhaps the first are for the USB serial device at runtime and the second for the bootloader?

1 Answer 1

1

The build ones are used when compiling the Arduino core. The others are used to identify the board when it resets into the bootloader so it can find the right com port to upload to

4
  • Ok, but the problem is the run-time pid/vid are 2341:8036. If the first set is used to identify the bootloader should not contain these values, otherwise it's impossible to detect it!
    – Mark
    Commented Apr 1, 2022 at 10:28
  • @Mark The runtime ones can be whatever you like. The IDE opens the (manually) selected COM port at 1200 baud which resets the board into the bootloader. Then it waits for a new device to appear that matches one of the bootloader VID/PID pairs (any one will do) at which point it records the COM Port and passes that to avrdude to upload the program.
    – Majenko
    Commented Apr 1, 2022 at 11:09
  • It's exactly what I'm doing right now. But because even the default run-time VID/PID pairs for Leonardo are in that set, I cannot be sure if it's the bootloader or not! Example: if the reset does not work, I assume there is a bootloader while it's still the application serial channel.
    – Mark
    Commented Apr 1, 2022 at 11:16
  • @Mark If the reboot didn't work then there won't be a new device.
    – Majenko
    Commented Apr 1, 2022 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.