-
Notifications
You must be signed in to change notification settings - Fork 34
Additional board definitions for #89 #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Added entry for Arduino mega1280 boards
Added additional board entries, change due uC
Fixing improper name for due microcontroller Added in arduino nano_v2
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 define
s, 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)?
Squashed commit Setup for Travis-CI integration Tweaked misc/default.yml * Due now builds with defines for ATmega2560 as that is closer to the ATSAM3X8E (ATSAM3X8E causes Godmode tests to fail currently), was originally using ATmega328
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not necessarily opposed to whatever is happening here but if you could give some context on how this relates to the problem being solved, that would be helpful (up to and including opening an issue).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am indifferent to it ultimately, that is there because my CI is defaulting to bundler 2.01, which complains about not being compatible with the older version. I set the version so that I don't cause any issues with anyone else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm understanding you correctly, there is a more recent version of bundler that we could be using? I wouldn't mind taking some time to update that if it's causing problems -- please open an issue with the details of what you're seeing and I'll take a look at it.
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 #define
s 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?
RobTillaart
commented
Jan 2, 2023
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Doom4535 can you explain this comment a bit? I'm not sure why the fix belongs here and not in Godmode.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's been a while since I looked at this, I believe I made that change because the Arduino Duo is most like an Arduino Mega based on pinout. Updating godmode.h
to include the equivalent for the SAM board would be the technically correct result, and allow for including support for any extra features the SAM board supports that can't be done with the AVR board.
I'm not sure what the replacement should be, on windows it would likely be something inside of %LocalAppData%\Arduino15\packages\arduino\hardware\sam
, maybe %LocalAppData%\Arduino15\packages\arduino\hardware\sam1円.6.12\variants\arduino_due_x\variant.h
?
Uh oh!
There was an error while loading. Please reload this page.
Highlights
Added entries for additional boards listed in #89 :
Issues Fixed
Changed processor used for Arduino due from atmega/avr to atmel sam
Notes