Comments: SAMD21 Mini/Dev Breakout Hookup Guide

Pages

Comments 12 comments

  • ——————– Tech Support Tips/Troubleshooting/Common Issues ——————–

    I2C Sensors

    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.
    

    or

    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 ].

  • 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

  • FreeRTOS

    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.

    Thanks!

    • 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.

      Thanks!

  • 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[2]” and “SERCOM4/PAD[2]”. The schematic for the mini shows PA14 wired to D2.


If you've found a bug or have other constructive feedback for our tutorial authors, please send us your feedback!