Go Down

Topic: Flash with command line (Read 349 times) previous topic - next topic

tryhus

Hi,

What is the commande line to flash the compiled binary file .bin into the mkr board?

Thanks

pert

Do this:
  • File > Preferences
  • Check the box next to "Show verbose output during: upload".
  • Sketch > Upload
  • After the upload finishes, examine the contents of the black console window at the bottom of the Arduino IDE window. There, you will find the command the Arduino IDE used to flash the compiled binary file. You can copy that command, modify it as you like, and use it from the command line.


There is one thing you should be aware of. In order to activate the bootloader on the MKR GSM 1400, it must be reset. The Arduino does this automatically by opening a serial connection to the MKR GSM 1400's serial port at 1200 baud. There is some code running on your MKR GSM 1400 that sees that 1200 baud connection as a signal to reset the microcontroller and enter bootloader mode. When in bootloader mode, the MKR GSM 1400 may have a different port than it does while your sketch is running. After opening the 1200 baud connection, the Arduino IDE waits for a new port to appear. It assumes that is the port of the MKR GSM 1400 in bootloader mode. As soon as it sees the new port, it starts the upload using bossac.

If you're uploading from the command line, you will need to somehow put the MKR GSM 1400 in bootloader mode. You could do this by reproducing the Arduino IDE's auto reset system, but that might be a bit overly complex. The alternative is to simply put the MKR GSM 1400 in bootloader mode manually before running the flash command. You can do this by pressing the reset button twice quickly. You should now see the onboard LED pulsing, which indicates the bootloader is active. After that, just run the bossac command.

tryhus

Hi pert,

Thank you for your answer.
Finally, I used arduino-cli : https://github.com/arduino/arduino-cli
It's really straightforward to use and the commands are the same whatever the type of arduino board used.
Furthermore, I don't have to press the reset button.

pert

Thanks for taking the time to share the solution you found tryhus. I'm glad you found arduino-cli to be useful!

Go Up