seeed-studio / arduinocore-samd Goto Github PK
View Code? Open in Web Editor NEWThis project forked from lynnl4/arduinocore-samd
This project forked from lynnl4/arduinocore-samd
Hi, I encounter some strange error, when I try to compile a sketch with I2S library it gives me '#error "I2S is not supported on your board!" ', which is a defined error in the .h file of the lib, but I'm using Seeeduino LoRaWAN, which is based on Arduino Zero, and it uses SAMD21D controller, which supports I2S, so I think this is a bug in the code.
Best regards,
Viktor
The Wio Terminal has a buzzer on Arduino pin 12, but it doesn't seem to work with the Arduino tone() function.
For example, uploading the standard example file toneMelody and changing the first parameter of tone() to 12 doesn't produce any sound.
Any suggestions?
Where do I find details on how to build this repo?
Hello,
recently bought 3 different models of xioa, rp2040, nrf51840 and samd21, the first two installed in arduino fine on my arm64 machine including the bossac dependency, but samd21 failed bossac not available for your arch. Kinda weird since all three came from same url/boards package json https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json seems likely its a silly mistake/over site hopefully easily remedied
I am trying to use my XIAO to program an ESP32, but esptool.py requires flow control, it is expecting an FTDI chip.
How can I achieve flow control (NAK, etc), to handle large amounts of data, using one of the USB libraries provided with your Arduino lib?
While investigating about lost steps with rotary encoders, a possible bug was found in Winterrupt.c, leading to lost interrupts.
Sorry, don't know how to to a proper PR yet, please see:
WakeUpOnRTCInterrupt项目编译时提示缺少RTCInt.h文件
https://stackoverflow.com/questions/12703307/arm-none-eabi-gcc-printing-float-number-using-printf
Maybe need linker option -u _printf_float -u _scanf_float
.
CMSIS-Atmel
in the current toolchain used by ArduinoCore-samd has a bug which the "atsamd51p19a.h" contains wrong definition of __NVIC_PRIO_BITS
.
This causes that applications can not use interrupt priority other than 3, which limits the interrupt usage in applications.
The description of the mechanism is written in my article (Sorry, it's only in Japanese. )
The code to reproduce the problem is here
In order to fix this issue, please change the definition of __NVIC_PRIO_BITS
from 2 to 3 in "atsamd51p19a.h" in CMSIS-Atmel
(Updating CMSIS-Atmel
also solves the issue, but the structure of CMSIS-Atmel
is drastically changed from current version and it's very difficult to update CMSIS-Atmel
. So I think just changing __NVIC_PRIO_BITS
is the easiest way to solve the issue.)
I'm trying to use pwm() on TC4 (D6 on the Seeduino Xiao), but the duty cycle is being calculated incorrectly in wiring_pwm.cpp line 271:
duty = mapResolution(duty, 10, 16);
For samd51 TCx and TCCx, as well as SAMD21 TCCx, it's using:
duty = map(duty, 0, (1<<PWM_API_RESOLUTION), 0, period);
The result is that the counter (in my case duty period = 2000) is being incorrectly.
I've changed the line to match the others and it works fine for my single use case.
@deanm1278 since this was in your original PR, any idea why TCx is treated differently?
Work around is: https://gist.github.com/ciniml/bd2bb4dea22a55c067ca6790ad0c3eae#file-grove_left_uart-ino-L7
Nice to have while loop in Serial.begin().
Is there any plans for adding SDU (Secure Digital Update) capability to seeed samd devices?
Arduino's core-smd already supports it.
Info:
https://www.arduino.cc/en/Reference/SDU
https://github.com/arduino/ArduinoCore-samd/tree/master/libraries/SDU
{runtime.tools.bossac-1.7.0-arduino3.path}/bossac.exe -i -d --port=COM33 -U true -i -e -w -v C:\Users\takashi\AppData\Local\Temp\arduino_build_148209/sketch_may10a.ino.bin -R
java.io.IOException: Cannot run program "{runtime.tools.bossac-1.7.0-arduino3.path}/bossac.exe": CreateProcess error=2, 指定されたファイルが見つかりません。
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:26)
at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:129)
at cc.arduino.packages.uploaders.SerialUploader.runCommand(SerialUploader.java:383)
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:197)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)
at processing.app.SketchController.upload(SketchController.java:732)
at processing.app.SketchController.exportApplet(SketchController.java:703)
at processing.app.Editor$UploadHandler.run(Editor.java:2047)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: CreateProcess error=2, 指定されたファイルが見つかりません。
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 9 more
スケッチの書き込み中にエラーが発生しました
When the Wio Terminal is configured as a slave mode, there is a conflicting definition of the IRQ handler:
In variant.h WIRE_IT_HANDLER is defined as SERCOM4 handler whatever the ROLE is. This is used by Wire.cpp included library
In variant.c Depends on ROLE, SERCOM4 is also defined and associated to Serial port1
As a consequence, you can't compile with Wire included when in slave mode.
The attached video shows PROGRAM #1 simp[le loop turning on / off each LED using digitalWrite() and PROGRAM #2 using analogWrite().
analogWrite() causes crosstalk between A5 and A8 and also between A4 and A10. Please watch the attached video.
Here’s the schematic for the test setup:
Here’s the code used to demonstrate the XIAO problem.
/*
PROGRAM #1
Demonstrate XIAO digitalWrite()
does NOT crosstalk
*/
void setup() {
for(int i = 1; i <= 10; i++) {
pinMode(i, OUTPUT);
digitalWrite(i, HIGH);
}
}
void loop() {
for(int i = 1; i <= 10; i++) {
digitalWrite(i, LOW);
delay(1000);
digitalWrite(i, HIGH);
}
delay(1000);
}
/*
PROGRAM #2
Demonstrate XIAO analogWrite()
DOES crosstalk
*/
void setup() {
for(int i = 1; i <= 10; i++) {
pinMode(i, OUTPUT);
analogWrite(i, 255);
}
}
void loop() {
for(int i = 1; i <= 10; i++) {
analogWrite(i, 0);
delay(1000);
analogWrite(i, 255);
}
delay(1000);
}
When I built Seeeduino XIAO with v1.7.5, the following warning is displayed.
"C:\\...\\Arduino15\\packages\\Seeeduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD "-D__SKETCH_NAME__=\"\"\"Blink.ino\"\"\"" -DF_CPU=48000000L -DARDUINO=10812 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Seeed\"" "-DUSB_PRODUCT=\"Seeed XIAO M0\"" -g "-IC:\\...\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.7.5\\cores\\arduino/TinyUSB" "-IC:\\...\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.7.5\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-IC:\\...\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.7.5\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -g -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Seeed\"" "-DUSB_PRODUCT=\"Seeed XIAO M0\"" -g "-IC:\\...\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.7.5\\cores\\arduino/TinyUSB" "-IC:\\...\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.7.5\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-IC:\\...\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.7.5\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" "-IC:\\...\\Arduino15\\packages\\Seeeduino\\tools\\CMSIS\\4.5.0/CMSIS/Include/" "-IC:\\...\\Arduino15\\packages\\Seeeduino\\tools\\CMSIS-Atmel\\1.2.0/CMSIS/Device/ATMEL/" "-IC:\\...\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.7.5\\cores\\arduino" "-IC:\\...\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.7.5\\variants\\XIAO_m0" "C:\\...\\Arduino15\\packages\\Seeeduino\\hardware\\samd\\1.7.5\\cores\\arduino\\main.cpp" -o "C:\\...\\Temp\\arduino_build_625793\\core\\main.cpp.o"
In file included from C:\...\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21.h:69:0,
from C:\...\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/samd.h:105,
from C:\...\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/sam.h:540,
from C:\...\Arduino15\packages\Seeeduino\hardware\samd\1.7.5\cores\arduino\SERCOM.h:22,
from C:\...\Arduino15\packages\Seeeduino\hardware\samd\1.7.5\cores\arduino\Uart.h:22,
from C:\...\Arduino15\packages\Seeeduino\hardware\samd\1.7.5\cores\arduino\Uart.cpp:19:
C:\...\Arduino15\packages\Seeeduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21g18a.h:226:0: warning: "LITTLE_ENDIAN" redefined
#define LITTLE_ENDIAN 1
Observed symptoms:
Serial.read()
will return -1 frequently. For example if the host sends "Hello World!", Serial.read()
might return 'H', 'e', 'l', -1, 'l', 'o', ' ', 'W', -1, ...Discussion:
This code in USBDeviceClass::recv
(called from _Serial::read
) directly reads data from the USB buffer and only acknowledges the transfer once the code has been read by the app:
I believe this is why there is a zero-slack channel here, and why Serial.read()
gives spurious -1 values as it reaches the end of one buffer and then returns it to the host for more data. Almost every other USB-serial implementation I've seen places some sort of ring buffer in between; USB transfers deposit data into the ring, and the application pulls out of it. That way there is a reasonable amount of "flex" and data can flow smoothly. Is that not something that can be done in this case?
Unable to build projects using Adafruit_USBD_HID with Seeeduino XIAO. It causes following error.
error: cannot declare variable 'usb_hid' to be of abstract type 'Adafruit_USBD_HID'
I build with full warnings, and found a few places where small changes can remove compile warnings.
There are 2 compiler warnings coming from math_helper.c:
https://github.com/Seeed-Studio/ArduinoCore-samd/blob/master/cores/arduino/math_helper.c
These 2 warnings are copied below. I can submit a PR if that's the best approach, but wanted to first check if the primary dev team wishes to address these directly.
There are a few correctness issues in these and other conversion functions in math_helper.c that do not generate compile warnings, for values/ranges where perhaps the functions aren't being used today. Where are the functions in this file being used?
--Don
C:\Users\don\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.2\cores\arduino\math_helper.c: In function 'arm_compare_fixed_q15':
C:\Users\don\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.2\cores\arduino\math_helper.c:175:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(diffCrnt > maxDiff)
^
C:\Users\don\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.2\cores\arduino\math_helper.c: In function 'arm_compare_fixed_q31':
C:\Users\don\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.8.2\cores\arduino\math_helper.c:203:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(diffCrnt > maxDiff)
^
Hello,
On Arduino IDE, I added Seeeduino but when I tried to use the Seeed Studio XIAO SAMD21
board, the IDE warned of missing header files in libraries. package_seeeduino_boards_index.json link. File link. Downgrading to 1.8.3 bypassed this issue.
I've downloaded the 1.8.4 version from github and folders were missing for the submodules.
Seems like the missing folder contents/headers can be caused by not downloading submodules before upload. Please help update the seeedstudio download link used by board manager download for Seeeduino 1.8.4 with the affected files intact.
Thank you.
For all others seeing this, one option to get your seeeduino working is to clone this repo, use git submodule update --init --recursive
and copy the affected files to the library, or directly git clone
the offending repositories to the library, or simply downgrade to 1.8.3.
Compiling the wifi sample code gives an error.
Code:
https://wiki.seeedstudio.com/Wio-Terminal-Wi-Fi#scanning-wi-fi-network-example-code
Error message:
C:\Users\takashi\AppData\Local\arduino15\packages\Seeeduino\hardware\samd\1.8.4\libraries\Seeed_Arduino_FreeRTOS\src\error_hooks.cpp: In function 'void vNopDelayMS(long unsigned int)':
C:\Users\takashi\AppData\Local\arduino15\packages\Seeeduino\hardware\samd\1.8.4\libraries\Seeed_Arduino_FreeRTOS\src\error_hooks.cpp:187:39: error: 'configCAL_FACTOR' was not declared in this scope
unsigned long iterations = millis * configCAL_FACTOR;
^~~~~~~~~~~~~~~~
C:\Users\takashi\AppData\Local\arduino15\packages\Seeeduino\hardware\samd\1.8.4\libraries\Seeed_Arduino_FreeRTOS\src\error_hooks.cpp:187:39: note: suggested alternative: 'configASSERT'
unsigned long iterations = millis * configCAL_FACTOR;
^~~~~~~~~~~~~~~~
configASSERT
Environment:
** Libraries:**
Inside EnergySaving::enable_eic_wake, there is a switch/case that assigns the input pin number to a WAKEUPENx bit. This function mangles them up in a way that will never wake a Seeeduino XIAO correctly. The WAKEUPENx bits are not mixed up like the function suggests. Waking up from external interrupts start's working as soon as you set the WAKEUPENx bit of the pin used to ::begin()
the EnergySaving calls with.
same situation on PlatformIO. -> #8
I want to use STL.
This code got error.
Board: Seeeduino XIAO
Code:
#include <vector>
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Error message:
In file included from c:\users\takashi\documents\arduinodata\packages\seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\vector:60:0,
from C:\Users\takashi\AppData\Local\Temp\arduino_modified_sketch_889764\sketch_apr29a.ino:1:
c:\users\takashi\documents\arduinodata\packages\seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\bits\stl_algobase.h:239:56: error: macro "min" passed 3 arguments, but takes just 2
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
c:\users\takashi\documents\arduinodata\packages\seeeduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\bits\stl_algobase.h:260:56: error: macro "max" passed 3 arguments, but takes just 2
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
exit status 1
"Warning: forced trusting untrusted contributions" on post_install.bat.
Windows 10 64bit, Arduino IDE 1.8.12 Windows Installer version.
Does the new version of the board 1.8.3/1.8.4 support both WiFi and tensorflowlite at the same time?
SoftwareSerial invered logic doesn´t work with Seeduino XIAO in single wire mode (Half Duplex)
#include <SoftwareSerial.h>
const byte rxPin = 0;
const byte txPin = 0;
SoftwareSerial mySerial (rxPin, txPin, true);
no signal on PIN 0
Hi,
I'm trying to read the software version from peripheral device as a sanity check upon software startup and faced with very strange issue. I wrote a bare-bone code to check that, and it still has the same issue.
I'm sending a command 0x70 and I expect two bytes of response. Using a logic analyzer I can clearly see the response arrives and values are meaningful. But at the same time what is returned by SPI.transfer()
it is zero instead of visible on analyzer values. I look through the library code and found out something like that
https://github.com/Seeed-Studio/ArduinoCore-samd/blob/v1.8.4/cores/arduino/SERCOM.cpp#L362
uint8_t SERCOM::transferDataSPI(uint8_t data)
{
sercom->SPI.DATA.bit.DATA = data; // Writing data into Data register
while(sercom->SPI.INTFLAG.bit.RXC == 0); // Waiting Complete Reception
return sercom->SPI.DATA.bit.DATA; // Reading data
}
I do not have too much knowledge about that, but I assume it shall work properly. But in reality it doesn't.
Hardware: Seeeduino XAIO SAMD21
Framework version: 1.8.4 installed via Arduino-IDE (GNU/Linux amd64)
Please add the compiler-flag option to enable/disable the Serial TX/RX LEDs also for the XIAO SAMD21 board, like you already did for the Seeed Wio Terminal by accepting commit c68cc757e623a4b30669e7880a4fb0224bbf6169
Add to boards.txt:
seeed_XIAO_m0.menu.txrxled.on=On
seeed_XIAO_m0.menu.txrxled.off=Off
seeed_XIAO_m0.menu.txrxled.on.build.flags.txrxled=-DTXRXLED_ENABLE
Changes in variants\XIAO_m0\variant.h:
#define PIN_LED2 (12u)
#define PIN_LED3 (11u)
#if defined(TXRXLED_ENABLE)
#define PIN_LED_RXL PIN_LED2
#define PIN_LED_TXL PIN_LED3
#endif
Also, assigning the pin-numbers to PIN_LED2/3 (instead of PIN_LED_RXL/TXL) allows the user to reference the individual LED-pins, while still being able to enable/disable the LEDs with the compiler flag.
Please also correct the copy-paste typo in boards.txt for the Wio Lite MG126
from
# Seeed XIAO M0 (SAMD21)
to
# Wio Lite MG126 (SAMD21)
I think BCM14, BCM15, and BCM18 as defined in variant.h under wio_terminal point to the wrong pins. I think they should be 40ul, 41ul, and 52ul respectively, instead of the current values of 41ul, 40ul, and 17ul.
If you select WioTerminal as the target board, both sample codes included in the FlashStorage library will fail to build.
thank you.
It seems that the SPI it's not working properly with the SD Card Library. For Example I run the CardInfo.ino example on another Arduino Clone and it works fine , when I run the same code on Seeeduino LoRaWAN the card can't be initialized same thing happens with other SPI Peripherals for example ADC (mcp3008). Almost two years ago it used to work on Seeeduino LoRaWAN too.
The build script is broken, and board definitions are missing for Seeed boards.
In the build script, there are not names of Seeed boards.
And, the board definitions are missing.
When i compile with Tinyusb i get SerialUSB was not declared in this scope
in variant.h
I encounter this issue on I2C bus and when I search issues on the main repo, the issue is still there...
SERCOM I2C not working on pins PA08, PA09 arduino#383
arduino#383
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.