Comments: SAMD21 Mini/Dev Breakout Hookup Guide
Looking for answers to technical questions?
We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.
-------------------- Tech Support Tips/Troubleshooting/Common Issues --------------------
If you are having issues connecting to an I2C sensor and you are doing error checks on the I2C operations, be aware that the SAMD21's I2C operations already has the "Atmel API performs its own error checking." There was a case where customers had issues connecting to a MLX90614 IR Sensor through I2C due to this reasoning.
Arduino IDE Upload Issues
If you are selecting the correct COM port on a Windows 10 computer and you are trying to upload to the SAMD21, and you see an error similar to this:
Set Binary Mode No device found on COM8/?98½ù(██±'þ█ Send auto-baud Set binary mode An error occurred while uploading the sketch
, it's possible that the computer is automatically trying to upload to the other COM ports. There was a case where someone had selected COM3 but it would not upload. They were using Arduino IDE v1.6.2 with the SAMD21 board add-ons ( Arduino SAMD Boards v1.6.11 and SparkFun SAMD Boards v1.3.2). They had to disabled COM8 & COM9 (if I remember correctly, that is a bluetooth's COM ports on a Windows 10 computer) and hit the SAMD21 Dev Breakout's reset button to upload before they were able to get their computer to upload code.
Arduino Compile Error
If you are seeing these errors below, it's possible that the Arduino SAMD or SparkFun SAMD board definitions were not installed correctly. Try uninstalling and reinstalling the board add-ons. You might also want to try deleting your Arduino temporary files:
Arduino: 1.6.5 (Windows 7), Board: "SparkFun SAMD21 Dev Breakout" In file included from sketch_feb14b.ino:33:0: C:\Users\...\AppData\Roaming\Arduino15\packages\SparkFun\hardware\samd\1.2.2\cores\arduino/Arduino.h:48:17: fatal error: sam.h: No such file or directory #include "sam.h" ^ compilation terminated. Error compiling.
Arduino: 1.8.0 (Windows 7), Board: "SparkFun SAMD21 Dev Breakout" In file included from sketch\sketch_feb14a.ino.cpp:1:0: C:\Users\...\AppData\Local\Arduino15\packages\SparkFun\hardware\samd\1.2.2\cores\arduino/Arduino.h:48:17: fatal error: sam.h: No such file or directory #include "sam.h" ^ compilation terminated. exit status 1 Error compiling for board SparkFun SAMD21 Dev Breakout.
A customer was able to get it working after deleting their Arduino's temporary files and reinstalling the board add-ons.
I am having the "fatal error: sam.h" issue. Where can I find the temp files so that I can delete them? Thanks!
I'm sorry but I do not usually monitor the comments. I happened to notice your comment just now. They are somewhere in your local user data. If you dig a little it will be in two locations. You can find them by going to your File>Preferences and click on the directory at the end. They also talk about how to do this in the Arduino.cc forums => [ https://forum.arduino.cc/index.php?topic=420348.msg2971099#msg2971099 ].
Does the mini also have an integrated LiPo charger? This page makes it sound like it does NOT, but the produc page for the mini makes it sound like it does. That product page says "With a Micro-B USB and the power switch in the off position, the Pro RF will charge the attached battery!"
How do I store variables when power is removed from the board? Do I have to store them in FLASH? If flash is needed, does anybody know of examples?
it is possible connect and use USB bluetooth dongle with this SAMD21 microcontroller directly to USB Host? Have a anybody any experience with this ? because in this case, it is not necessary using a USB host shield, it is great added value.
and work with this: https://www.sparkfun.com/products/9434
some like this: https://www.ebay.com/itm/Mini-USB2-0-EDR-Wireless-Bluetooth-Dongle-Adapter-for-Laptop-PC-Win-Xp-Win7-8/152627190302?epid=8025390228&hash=item23894a1a1e:g:VmoAAOSwDtpZbFE3:rk:2:pf:0
Windows 10 sees the device however there is no "other" entry in the Device Manager. Also the driver download appears only to contain the setup information file.
Seems this is not an issue at all. Downloading the IDE and connecting to the serial port and starting the Serial Monitor starts splashing data from the IMU so Never mind
How easy is it to run FreeRTOS on this or to run the FreeRTOS port that was ported to arduino on this? Can you please provide some advice.
The instructions make it sound like you need to connect to those 3 shortcuts and install those 3 things from those sites and then to the Board Manager step. You need to make it clearer that you just need to do the Board Manager step....
First, you’ll need to install a variety of tools, including low-level ARM Cortex libraries full of generic code, arm-gcc to compile your code, and bossa to upload over the bootloader. These tools can be downloaded and installed alongside Arduino’s board definitions for the Arduino Zero.
To install the Arduino Zero board definitions, navigate to your board manager (Tools > Board > Boards Manager…), then find an entry for Arduino SAMD Boards (32-bits ARM Cortex-M0+). Select it, and install the latest version – 1.6.2.
I am a little confused with your SERCOM chart and the available ports. If I understand it correctly, does this mean that I can have more than one i2C or more than 1 SPI for example? Also I am not clear on the "DEV ONLY" category - could you please clarify that and lastly you mentioned " That leaves SERCOM1 and SERCOM3 that you can bend to your will .." should that be SERCOM1 and SERCOM2 since SERCOM3 is already I2C.
Correct. You each SERCOM port can be configured as either I2C, SPI or a UART -- and you can set up multiple of the same interface on different SERCOM's.
"Dev Only" is short for "SAMD21 Development Board only" -- they're pins that aren't broken out on the SAMD21 Mini Breakout. I'll make that more clear in the table.
Good catch on that last bit. Fixed it. Thanks!
Oh hmm... SERCOM0/PAD2 should probably also be "D8" (it's PA06, page 21 of datasheet).
Good catches. Looks like I missed D6 (PA20) and D7 (PA21) on SERCOM5 as well. Table should be fixed now...too much abstraction.
I think you have a bug in your "SERCOM – Configurable Serial Ports" table for SERCOM2 PAD2. I think this should be "D2", at least on the mini (probably for dev as well). The datasheet for PA14 (page 22) shows "SERCOM2/PAD" and "SERCOM4/PAD". The schematic for the mini shows PA14 wired to D2.
If you've found an issue with this tutorial content, please send us your feedback!
Hi. I would like to share my experience following the Hook-up guide and how I got the drivers to install on my Windows 7 machine.
Firstly, I have a Mini and Dev board. When I plugged either in I got a red LED power indicator and a blue LED that pulses brighter then dimmer. This means the board is in bootloader mode. The guide says that a yellow LED flashes, but this is not the case.
I then followed the instructions under "Hardware setup" but the drivers did not install properly. The first time I did it Windows said the driver installed successfully, and port 17 showed up in the IDE. But when I selected this port and tried to upload blink it did not work, saying no device was found at port 17. The device was still showing up under "other devices" in device manager. I tried to update the driver software again as per the hook-up guide, but when I browsed to where the drivers were Windows would say "no device driver software found".
These are the steps I took to get it to work:
1: Open Device manager as administrator.
2: Right click on SparkFun SAMD21 which is under "other devices".
3: Select: Update driver software.
4: Select: Browse my computer for driver software.
5: Select: Let me pick from a list of device drivers on my computer
6: Click "Have Disk"
7: Browse to the driver location and click OK. A screen appears saying "Select the device driver you want to install for this hardware". There are two choices SparkFun SAMD21 Bootloader, and Sparkfun SAMD21 Breakout.
8: Select Sparkfun SAMD21 Bootloader and click next. A pop-up says something along the lines of "This is not recommended as cannot be verified .. blah blah. Click Yes. The drivers installed.
Now if a sketch is running on my Mini I get port 20, for the Dev breakout it is port 21, and if either board is in bootloader mode they show up as port 22. Happy days.