Automated Builds

Status
Not open for further replies.

yeahtuna

Well-known member
Has anyone found a way to do this? I'm currently building the same project for three different Teensy boards, and for each board 6 slightly different USB types. It ends up being a lot of work with the Arduino software.

Basically I would like to automate setting the 'board type' and the 'usb type', and then compile. Does anyone know if there's a way to do this?

Regards,
Rob
 
I have done something like that with Visual Studio running the Visual Micro Addin.

Visual Studio has the configuration feature -> see Configuration Manager. With Visual Micro there are two standard configs "Release" and "Debug", which work just the usual way.
But you can create new configurations (best as a copy of the existing ones) and edit the Visual Micro Projekt properties (in the lower right corner, when you have your project selected in the Solution explorer).
In project properties -> Micro general (Current Configuration) you can add specific defines and flags for the configuration.

I used this to activated code with the #ifdef preprocessor makro depending on a define specified in the configuration.
To build a specific configuration you select it and press "Start".

When the builds worked I created a batch script which would run MSBuild for the different configurations. See https://msdn.microsoft.com/en-gb/library/dd393573.aspx and used tycmd (https://github.com/Koromix/tytools) to automatically upload to the Teensys.

I know this explanation isn't very extensive but i don't have the time to write more.
Maybe there is also a way using the http://platformio.org/ build environment, but i haven't tried it yet.
 
I have done something like that with Visual Studio running the Visual Micro Addin.

Visual Studio has the configuration feature -> see Configuration Manager. With Visual Micro there are two standard configs "Release" and "Debug", which work just the usual way.
But you can create new configurations (best as a copy of the existing ones) and edit the Visual Micro Projekt properties (in the lower right corner, when you have your project selected in the Solution explorer).
In project properties -> Micro general (Current Configuration) you can add specific defines and flags for the configuration.

I use similar configurations under eclipse (e.g. Release_32, Release_36) where all the symbols (F:CPU, board type, link file, etc) are preset to my taste.
 
Newer versions of Arduino can be run from the command line. I haven't personally tried it since they first added this feature, so I can't say for sure if it really works for Teensy in 1.8.1. But it's there and ought to work. I'm not sure if they've ever really documented it. The only "documentation" might be the source code in BaseNoGui.java.

If you give this a try, please let me know how it works?
 
I believe the command line is described at: https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc

With starting with I believe 1.8.0 on linux, you can run this without requiring X11 display. I tried it with Teensy on linux and the compile completed and the like, but upload failed as Teensy program would not load without display... Also note: before I tried this I had the GUI setup the correct board and other parameters to make it easier. So not sure how hard it would be to do things like change the USB type and the like.
 
Using arduino 1.6.7 on Windows, I just did the simplest example to verify a sketch from the command line and it worked perfectly. Should be able to write a simple batch file to complete reinvent my work flow.
 
I made a batch file and compiled 6 versions of my firmware in one go!

Here's my batch file:
Code:
cd "c:\Program Files (x86)\Arduino"
START /W arduino_debug --board teensy:avr:teensy31:speed=48,usb=MIDIExpIORed
START /W arduino_debug --verify "E:\My Documents\Arduino\quatro\quatro.ino"
START /W arduino_debug --board teensy:avr:teensy31:speed=48,usb=MIDIExpIOBlue
START /W arduino_debug --verify "E:\My Documents\Arduino\quatro\quatro.ino"
START /W arduino_debug --board teensy:avr:teensy31:speed=48,usb=MIDIExpIOGreen
START /W arduino_debug --verify "E:\My Documents\Arduino\quatro\quatro.ino"
START /W arduino_debug --board teensy:avr:teensy31:speed=48,usb=MIDIExpIOOrange
START /W arduino_debug --verify "E:\My Documents\Arduino\quatro\quatro.ino"
START /W arduino_debug --board teensy:avr:teensy31:speed=48,usb=MIDIExpIOWhite
START /W arduino_debug --verify "E:\My Documents\Arduino\quatro\quatro.ino"
START /W arduino_debug --board teensy:avr:teensy31:speed=48,usb=MIDIExpIOBlack
START /W arduino_debug --verify "E:\My Documents\Arduino\quatro\quatro.ino"
 
Status
Not open for further replies.
Back
Top