I’m using 4 A-star boards in a project, and each time I make a modification to my program, I have to upload it with avrdude to each of the 4 boards, which are not easily accessible. So, I would like to be able to upload my program to the board without having to press twice the reset button to enter bootloader mode as it is suggested in the a-star documentation. There must be a way no? How does the Arduino IDE get the board to enter bootloader mode automatically?
If you are not compiling using the Arduino IDE, you can still program the A-Star to behave in the same way. You might consider importing the Arduino core code into your project, or using some other USB stack such as LUFA.
When you click the “Upload” button in the Arduino IDE, it opens the selected serial port, sets the baud rate to 1200, and closes it. Then it monitors the serial ports on your system for a while, waiting for a new one to appear. When a new serial port appears, it assumes that the serial port is for the A-Star’s bootloader, and then it launches AVRDUDE in order to upload your program using that serial port.
You might consider using libserialport to write a command-line utility in C that does the same thing as the Arduino IDE. Alternatively, most programming languages have libraries for listing the serial ports, opening them, and setting their baud rates, so you could a language other than C.
Hi David,
Thank you for your very complete answer! It’s really helpful. Indeed, I would like to avoid using the Arduino IDE, so I will try the solutions you suggest.
Thank you!