-
-
Notifications
You must be signed in to change notification settings - Fork 37
adding support for SAMD51 #8
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
|
Hi @deanm1278 ! may I ask you where these files comes from? is there a source archive from Atmel somewhere? |
|
The SAMD51 CMSIS files are from the SAMD51 DFP distributed through Atmel Studio. The sam.h and samd.h files were modified by me instead of replacing entirely to ensure everything that already works using these files continues to work. |
|
I'm currently using the SAMD51 CMSIS files with the Arduino IDE, but they're causing compiler warnings. I noticed that in the SAMD51 Atmel CMSIS files, they've chosen to define _U(x), _L(x) and _UL(x) macros, instead of the simple "ul" (unsigned long) suffix that they previously used for the SAMD21. However, this naming appears rather unfortunate, as the _U and _L macros are have been already defined in the ARM GCC toolchain file "ctype.h". This double definition is causing the warnings. |
|
I amended the _U and _L macro names in the SAMD51 Atmel CMSIS to _UI (unsigned int) and _SL (signed long) respectively. The blank sketch now compiles without warnings or errors. |
|
hi Martin, I'm not seeing those warnings when using this with the most recent version of the core in this branch: would you be able to post the code you are using? |
|
hi @cmaglie, is there any update on whether or not this could be merged? We at Adafruit are getting ready to launch our SAMD51 based line soon :) |
|
Hi @deanm1278
I'm just compiling a blank sketch, using the code from your most recent branch, https://github.com/adafruit/ArduinoCore-samd/tree/samd51. I'm using version 1.8.4 of the Arduino IDE, with compiler warnings set to default. I'm also using the SAMD51, Atmel CMSIS files "sam.h", "samd.h" and the directory "samd51" taken from https://github.com/adafruit/ArduinoModule-CMSIS-Atmel. They're stored in my .../Arduino15/packages/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL directory. The compiler warnings I'm getting are due to the fact that the ARM toolchain file, "ctype.h" defines the macros _U and _L: (that's file "ctype.h" in the directory .../Arduino15/packages/arduino/tools/arm-non-eabi-gcc/4.8.3-2014q1/arm-none-eabi/include/...). ...but these macros are also defined in the SAMD51 Atmel CMSIS: By removing the additional _U, _L and _UL macro definitions added to bottom of "Arduino.h" for this (SAMD51) branch and replacing the SAMD51 Atmel CMSIS _U and _L macros with unique names, (_UI and _SL), removes the compiler warnings. In addition, if I uncomment the _U, _L and _UL macros at the bottom of "Arduino.h" and compile for the Feather M0, I also get compiler warnings, again because "Arduino.h" is trying to redefine the macros already defined in "ctype.h". |
|
Furthermore, if I just cut and paste the _U, _L and _UL macros at the bottom of the SAMD51 branch's "Arduino.h" and paste them into the Arduino Zero's "Arduino.h", I get the same warnings. |
|
Hi @deanm1278 My compiler's also generating warnings for the FPU support code. It's warning about the double definition of the __FPU_USED flag, that's first defined in the "boards.txt" file for the compiler command line flags:
...and then later on line 151 of the "core_cm4.h" file:
The "core_cm4.h" file is located in the directory .../Arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/... Removing the __FPU_USED flag from the compiler command line, allows it to compile without warnings or errors. |
|
ok silly me, I had accidentally turned off the compiler warnings. They are fixed now. |
|
Hi @deanm1278 I'd just like to say thank you for the work that you and Adafruit are doing to bring the SAMD51 to the Arduino IDE, much appreciated. |
|
Hi @deanm1278 I attempted to burn the SAMD51's bootloader using the Arduino IDE and an Atmel-ICE. The attempt failed, (although it could be my hardware). However, I noticed that OpenOCD is saying that the target is a SAMD21J18A. Please could you tell me if you're also using OpenOCD's SAMD21 configuration to upload the SAM51's bootloader? |
|
hey @martinl1 I'd like to move other issues unrelated to CMSIS files to the issues section on the SAMD51 core repo here if you don't mind: Thanks! |
|
hi @cmaglie we emailed the team and did not hear back, this is a pull request that 1) does not break anything 2) makes things better 3) shows arduino WANTSS pull requests to make the IDE better for makers. what is the status of merging pull requests? 4) does arduino still accept pulled requests? 5) if not, why? if there a new policy you can link to? about pull requests? thanks, |
|
Thank you! It's now available as version 1.2.0 in the package manager. 👍 |
this adds support for samd51 devices without modifying cmsis files of other devices