-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add or update board definitions -- arduino mega at least #89
Comments
from https://www.microchip.com/webdoc/avrlibcreferencemanual/using_tools_1using_avr_gcc_mach_opt.html via @per1234 (https://github.com/ianfixes/arduino_ci/issues/86#issuecomment-454173396)
|
I guess I already had a bunch of this via https://github.com/ianfixes/arduino_ci/blob/master/cpp/arduino/avr/io.h ... the trick is correlating them all to Arduino platforms |
I bought and received recently an Arduino MKRZero which is using a SAMD21 Cortex-M0+ 32bit low power ARM MCU. Any chance to have this MCU supported by arduino_ci ? Here is the list of Arduino boards (from https://www.arduino.cc/en/products.compare )
Others boards
(1) currently defined in |
Do these platforms have official identifiers (something that can be used in code, like |
Maybe @per1234 can tell us if Arduino platforms have official identifiers. |
Note to self, combine with this info from #7 This looks like a good resource for what https://arduino.stackexchange.com/questions/21137/arduino-how-to-get-the-board-type-in-code #if defined(TEENSYDUINO)
// --------------- Teensy -----------------
#if defined(__AVR_ATmega32U4__)
#define BOARD "Teensy 2.0"
#elif defined(__AVR_AT90USB1286__)
#define BOARD "Teensy++ 2.0"
#elif defined(__MK20DX128__)
#define BOARD "Teensy 3.0"
#elif defined(__MK20DX256__)
#define BOARD "Teensy 3.2" // and Teensy 3.1 (obsolete)
#elif defined(__MKL26Z64__)
#define BOARD "Teensy LC"
#elif defined(__MK64FX512__)
#define BOARD "Teensy 3.5"
#elif defined(__MK66FX1M0__)
#define BOARD "Teensy 3.6"
#else
#error "Unknown board"
#endif
#else // --------------- Arduino ------------------
#if defined(ARDUINO_AVR_ADK)
#define BOARD "Mega Adk"
#elif defined(ARDUINO_AVR_BT) // Bluetooth
#define BOARD "Bt"
#elif defined(ARDUINO_AVR_DUEMILANOVE)
#define BOARD "Duemilanove"
#elif defined(ARDUINO_AVR_ESPLORA)
#define BOARD "Esplora"
#elif defined(ARDUINO_AVR_ETHERNET)
#define BOARD "Ethernet"
#elif defined(ARDUINO_AVR_FIO)
#define BOARD "Fio"
#elif defined(ARDUINO_AVR_GEMMA)
#define BOARD "Gemma"
#elif defined(ARDUINO_AVR_LEONARDO)
#define BOARD "Leonardo"
#elif defined(ARDUINO_AVR_LILYPAD)
#define BOARD "Lilypad"
#elif defined(ARDUINO_AVR_LILYPAD_USB)
#define BOARD "Lilypad Usb"
#elif defined(ARDUINO_AVR_MEGA)
#define BOARD "Mega"
#elif defined(ARDUINO_AVR_MEGA2560)
#define BOARD "Mega 2560"
#elif defined(ARDUINO_AVR_MICRO)
#define BOARD "Micro"
#elif defined(ARDUINO_AVR_MINI)
#define BOARD "Mini"
#elif defined(ARDUINO_AVR_NANO)
#define BOARD "Nano"
#elif defined(ARDUINO_AVR_NG)
#define BOARD "NG"
#elif defined(ARDUINO_AVR_PRO)
#define BOARD "Pro"
#elif defined(ARDUINO_AVR_ROBOT_CONTROL)
#define BOARD "Robot Ctrl"
#elif defined(ARDUINO_AVR_ROBOT_MOTOR)
#define BOARD "Robot Motor"
#elif defined(ARDUINO_AVR_UNO)
#define BOARD "Uno"
#elif defined(ARDUINO_AVR_YUN)
#define BOARD "Yun"
// These boards must be installed separately:
#elif defined(ARDUINO_SAM_DUE)
#define BOARD "Due"
#elif defined(ARDUINO_SAMD_ZERO)
#define BOARD "Zero"
#elif defined(ARDUINO_ARC32_TOOLS)
#define BOARD "101"
#else
#error "Unknown board"
#endif
#endif |
There is a standard convention that a macro be created Reference: |
Fixing improper name for due microcontroller Added in arduino nano_v2
Looking at how arduino handles boards:
It looks like it gives each architecture has its own 'core' (located in The naming for the IO definitions does not seem to follow a convention between architectures, with sam Arduino.h including For the Godmode virtual core, it would be nice if we had a way to remove the |
I've been looking through the project to come up with a plan, and noticed that there is support for installing libraries and boards included in It would appear that the main difference between the Here is some sample output without the micro-controller defined: I'm thinking that this will need to be modified to include something along the lines of: Where would be a good entry point to try to add an addition include flag into the code, possibly More info on arduino board names: arduino/Arduino#8716 and here: https://github.com/arduino/arduino-cli and here: arduino/Arduino#6165 |
Just so we're on the same page about the differences:
The crux of the issue here is that I'm subverting the normal compilation of a library & sketch -- I want all the board-specific items like registers, ports, etc, but not the actual Arduino architecture. There's probably a far easier way to do all of this, but I'm not familiar enough with the source code of the Arduino IDE to know where to look or what to do there. |
As far as defining your own flags, the quickest way to experiment would be to just put them in |
This adds relevant defines that identify the architecture and board currently compiled for. Most of these are usually set by the platform's platform.txt and boards.txt, except for the __AVR* defines that are set by avr-gcc internally. This only adds extra defines, except for the Arduino Due, which previously incorrectly identified as an ATmega328p. This seems to fix part of Arduino-CI#89.
This adds relevant defines that identify the architecture and board currently compiled for. Most of these are usually set by the platform's platform.txt and boards.txt, except for the __AVR* defines that are set by avr-gcc internally. This only adds extra defines, except for the Arduino Due, which previously incorrectly identified as an ATmega328p. This seems to fix part of Arduino-CI#89.
This adds relevant defines that identify the architecture and board currently compiled for. Most of these are usually set by the platform's platform.txt and boards.txt, except for the __AVR* defines that are set by avr-gcc internally. This only adds extra defines, except for the Arduino Due, which previously incorrectly identified as an ATmega328p. This seems to fix part of Arduino-CI#89.
This adds relevant defines that identify the architecture and board currently compiled for. Most of these are usually set by the platform's platform.txt and boards.txt, except for the __AVR* defines that are set by avr-gcc internally. This only adds extra defines, except for the Arduino Due, which previously incorrectly identified as an ATmega328p. This seems to fix part of Arduino-CI#89.
This adds relevant defines that identify the architecture and board currently compiled for. Most of these are usually set by the platform's platform.txt and boards.txt, except for the __AVR* defines that are set by avr-gcc internally. This only adds extra defines, except for the Arduino Due, which previously incorrectly identified as an ATmega328p. This seems to fix part of Arduino-CI#89.
This can be made easier by arduino/arduino-cli#1090 |
Add new board definitions based on this gist
The text was updated successfully, but these errors were encountered: