KurtE
Senior Member+
There are times, when I would like to be able to do Arduino builds with using a GUI. Often this is to ARM boards like the RPI, but other times it may be to a different Linux or windows machine.
I am currently using KiTTy on my machine which is simply an updated version of Putty.
There is information about the Arduino Command line up at: https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc
In my current case, I am trying to build for a Teensy 3.2 connected up to an RPI3 board. On the RPI3 I setup Arduino and Teensyduino (beta 2 as 3 was not up when I last tried). I setup Arduino using a VNC window to begin with. I then downloaded stuff to the RPI through command line or WinSCP.
I added the path to the Arduino install to my path: export PATH=~/arduino-1.8.1:$PATH
So I try building blink example program, using the command line:
Some of this is not needed now like the preserve... But when I first started this, the command would successfully build the blink.hex file, but the teensy after build will fail to run as it does not have the GUI...
So: I downloaded the sources for: teensy_loader_cli
and built it. I was then able to program the T3.2 with it
But thought it would be nice to be able to do it from the main Arduino command line. First problem I ran into was was not sure how to convert from the build platform names (boards.txt) to the processor type names that this app wanted. So I edited the app and added option to instead use names like:
teensy_loader_cli --mcu:TEENSY31 ...
Edit: Forgot to mention: I put in Pull Request for this: https://github.com/PaulStoffregen/teensy_loader_cli/pull/36
I then edited platform.txt: I commented out the post build section:
And changed the Teensy Loader section:
Right now it is not overly clean but it appeared like it worked
Next up try downloading real program to the RPI3 and see if that works...
Also learn more on proper parameters on command line to specify more of the options like Board, like cpu speed...
But progress!
I am currently using KiTTy on my machine which is simply an updated version of Putty.
There is information about the Arduino Command line up at: https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc
In my current case, I am trying to build for a Teensy 3.2 connected up to an RPI3 board. On the RPI3 I setup Arduino and Teensyduino (beta 2 as 3 was not up when I last tried). I setup Arduino using a VNC window to begin with. I then downloaded stuff to the RPI through command line or WinSCP.
I added the path to the Arduino install to my path: export PATH=~/arduino-1.8.1:$PATH
So I try building blink example program, using the command line:
Code:
arduino --verbose-build --upload --preserve-temp-files --port /dev/ttyACM0 ~/arduino-1.8.1/examples/01.Basics/Blink/Blink.ino
So: I downloaded the sources for: teensy_loader_cli
and built it. I was then able to program the T3.2 with it
But thought it would be nice to be able to do it from the main Arduino command line. First problem I ran into was was not sure how to convert from the build platform names (boards.txt) to the processor type names that this app wanted. So I edited the app and added option to instead use names like:
teensy_loader_cli --mcu:TEENSY31 ...
Edit: Forgot to mention: I put in Pull Request for this: https://github.com/PaulStoffregen/teensy_loader_cli/pull/36
I then edited platform.txt: I commented out the post build section:
Code:
## Post Build - inform Teensy Loader of new file
#recipe.hooks.postbuild.1.pattern="{compiler.path}/teensy_post_compile" "-file={build.project_name}" "-path={build.path}" "-tools={compiler.path}" "-board={build.board}"
And changed the Teensy Loader section:
Code:
## Teensy Loader
#tools.teensyloader.cmd.path={runtime.hardware.path}/../tools
#tools.teensyloader.upload.params.quiet=
#tools.teensyloader.upload.params.verbose=-verbose
#tools.teensyloader.upload.pattern="{cmd.path}/teensy_post_compile" -test "-file={build.project_name}" "-path={build.path}" "-tools={cmd.path}" "-board={build.board}" -reboot
## Teensy Loader Command line
# ~/teensy_loader_cli/teensy_loader_cli --mcu=TEENSY31 -v -w -s /tmp/arduino_build_629456/Blink.ino.hex
tools.teensyloader.cmd.path={runtime.hardware.path}/../tools
tools.teensyloader.upload.params.quiet=
tools.teensyloader.upload.params.verbose=-verbose
tools.teensyloader.upload.pattern=/home/pi/teensy_loader_cli/teensy_loader_cli "--mcu={build.board}" -v -w -s "{build.path}/{build.project_name}.hex"
Right now it is not overly clean but it appeared like it worked
Next up try downloading real program to the RPI3 and see if that works...
Also learn more on proper parameters on command line to specify more of the options like Board, like cpu speed...
But progress!
Last edited: