Command Line Programmer

I’m wondering if anyone has been able to successfully program the M2 from the command line, without having to use a GUI. I looked into BOSSA, the open source programmer that Arduino uses for the Due, but haven’t had any luck getting it to work. I suspect it has to do with the slight changes made to the M2 that require it to have its own board configuration for the Arduino IDE.

Any advice on how to upload sketches to the M2 via the command line is much appreciated. Oh, and I’m running Ubuntu 16.04.

Thanks!

Have you tried the Arduino IDE CLI? I would be really surprised if it does not work if the Arduino IDE’s GUI does.

Yes, I’ve programmed an M2 from the command line plenty of times. I made a binary updater for M2RET where you can run it from the command line and flash the M2RET firmware without having to compile it. It’s worked for lots of people. You can find it here: www.savvycan.com

Maybe take a look and see what I did. It does just use bossac.

Thank you for the replies.

Adamvoss, I was unable to use the Arduino IDE CLI because to install it on linux, I’d have to use the command line package manager ( “sudo apt install arduino”), and that version is very old and does not support adding the M2 board.

CollinK, I must have overlooked the binary on your site. That is very helpful because one of the scripts I wanted to upload was M2RET.

In the end, I found the easiest method for me was to use PlatformIO, and I’d recommend it for anyone else with the same issue as me, since it already has support for the M2 build in, and it’s easily installed via “pip install platformio”

Perhaps more technical than you’d like, but I just clone the Git repository and build/run it from there. They also have pre-compiled packages available on their website.