I have the beetle board, a Leonardo clone same as in this question.
Arduino Leonardo Beetle mini board
Using the reset pin and quick hands on the keyboard, I am able to flash with avrdude and get also the board info with a command line like this:
$ avrdude -c avr109 -p atmega32u4 -P /dev/ttyACM1
And get the output:
Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.
Programmer supports the following devices:
Device code: 0x44
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e9587 (probably m32u4)
avrdude: safemode: Fuses OK (E:CB, H:D8, L:FF)
avrdude done. Thank you.
This is good but when I flash something from the ArduinoIDE I noticed I don't have to reset the board manually by grounding the reset pins, the boot loader starts automatically
How does ArduinoIDE reset the bootloader, some kind of communication on /dev/ttyACM1
?
1 Answer 1
The uploaded Arduino sketch has in the part provided by core a code which waits for a 1200 baud connection on USB. If a 1200 baud connection is established it resets the board to bootloader. The bootloader then starts the com port and waits for the upload.
To reset a board which has in boards.txt upload.use_1200bps_touch=true
Arduino IDE opens a 1200 baud connection to the board, then detects the new com port and start avrdude for the upload.