arduino_ci
arduino_ci copied to clipboard
Additional board definitions for #89
Highlights
Added entries for additional boards listed in #89 :
- Nano (defaults to v3, includes v2 as well)
- Mega1280
- Adafruit Grand Central M4 Express
Issues Fixed
Changed processor used for Arduino due from atmega/avr to atmel sam
Notes
- No action has been taken as of yet to expose additional analog pins on Nano
- No action has been take to expose additional features of the Grand Central beyond the standard M4 at this time
Issues seem to stem from changing the Due from the avr chip to the sam3x8 I believe the Arduino.h file used by Godmode for this will need to be swapped out for a ARM/SAM version from here: https://github.com/arduino/ArduinoCore-sam/blob/master/cores/arduino/Arduino.h
*Found the section that triggers the errors: bundle exec arduino_ci_remote.rb
Originally posted at https://github.com/ianfixes/arduino_ci/pull/123#issuecomment-496894658
This looks like a good start. Don't be too concerned about the compiler errors, this simply means that we need to do some intelligent mocking out of defines, possibly in cpp/arduino/ArduinoDefines.h.
The most ominous warning (about device type not defined) is coming direction from avr/io.h, where I don't see __AVR_ATSAM3X8E__ listed.
Could it be that I'm using an outdated set of library files from the Arduino library (io.h in particular)?
I believe that the device type not defined warning is related to the ATSAM3X8E not being an AVR board (none of the ARM boards are in io.h). I'm not entirely sure how the Arduino IDE does the build behind the scenes, but I want to say they switch to a separate ARM chain?
The Godmode is probably currently limited to AVR devices only? How are the ESP builds handled? I may try to use the same procedure for SAM devices.
In this project (without official support from Arduino) I'm generating my best guess at the compiler commands from scratch. I have to pull in a lot of the header files from the Arduino library to make this happen.
This makes things a bit strange, because it means that I'm compiling & running the test on a desktop architecture -- not the Arduino target architecture(s). So I need to bring in as many of the board-specific #defines as I can (from the official IDE's package), but not things like data types or other built-ins.
Nothing in Godmode itself should be limited to AVR devices. Or rather, any functions that are limited in such a way should be put behind the appropriate #ifdef directives, just like you would for (e.g.) serial port variable definitions.
Am I answering your questions? I apologize, because faking out the compiler is the most complex and most fragile part of this project, despite all the work put into exposing the definitions via yaml config.
I believe so, the project is impressive. Having an open source software-in-the-loop system is very exciting.
Thanks, that's nice of you to say 😄
Picking up this project again after a hiatus. @RobTillaart or @per1234 can you speak to whether the compiler flags listed here are comprehensive?
@Doom4535 can you rebase this off what I'm working on in the #338 PR?
Picking up this project again after a hiatus. @RobTillaart or @per1234 can you speak to whether the compiler flags listed here are comprehensive?
@ianfixes Not understand your question I'm afraid.
If I need a board unique define (most often to make a library work) I select that board in the IDE. Then I compile the code - verbose mode always on. I copy the output in my editor and search the -D flags to find "Arduino_ARCH_boardname". These defines allows me to add a patch for specific boards relative easily as these defines can be hard to find otherwise. (or I just don't know where to look :)
Does this answer your question?