"include sam.h" no file or directory after installing Arduino SAMD Boards

I'm trying to upload some firmware to an IMU I am using.

The hookup guide I am following is: 9DoF Razor IMU M0 Hookup Guide - SparkFun Learn

I follow all the steps and install the the Arduino SAMD Boards (32 bits ARM Cortex M0+). But when I try and upload I get the following error:

In file included from sketch/Razor_AHRS.ino.cpp:1:0:
/home/nvidia/.arduino15/packages/SparkFun/hardware/samd/1.5.3/cores/arduino/Arduino.h:48:10: fatal error: sam.h: No such file or directory
 #include "sam.h"
          ^~~~~~~
compilation terminated.
exit status 1
Error compiling for board SparkFun 9DoF Razor IMU M0.

I have the Razor IMU selected as my board.

Everything I am seeing online suggests this error is because the SAMD Boards package is not installed. But I installed it. Does anyone know why else this could be occurring?

VERSIONS INSTALLED:
Arduino IDE 1.8.9
Sparkfun SAMD Boards (Arduino SAMD Dependency 1.8.1) 1.5.3
Arduino SAMD Boards (32 bits ARM Cortex M0+) 1.8.1

EDIT: After downloading the Arduino SAMD boards without issue, I cannot download the latest Sparkfun SAMD boards package. It displays an error saying "tool bossac is not available for your operating system". I can download version 1.5.3 without issue though.

I am on Ubuntu 16.04 running on ARM architecture.

This indicates something has gone wrong with your Arduino SAMD Boards installation. To make sure it has been fully uninstalled you need to take some drastic action. Be aware this is somewhat advanced and will remove all boards you have installed via Boards Manager:

  • Click the link on the line following File > Preferences > More preferences can be edited directly in the file. This will open the Arduino15 (or similar name depending on OS) folder.
  • Delete all files and folders under the Arduino15 folder except for preferences.txt. Please be very careful when deleting things from your computer. When in doubt, back up!
  • (In the Arduino IDE) Tools > Board > Boards Manager
  • Wait for the downloads to finish.
  • Scroll down until you see the Arduino SAMD Boards entry. Click on it.
  • Click "Install".
  • Wait for installation to finish.
  • Click "Close"

After that, hopefully you'll be able to compile your sketch.

I followed your outlined steps and reinstalled the SAMD packages (both Arduino and Sparkfun). No luck, same issue.

I investigated the issue and it turns out that the older versions of Sparkfun SAMD Boards were not configured correctly, thus the error you encountered with the sam.h file from CMSIS. The new versions of SparkFun SAMD Boards are configured less incorrectly and will not have that problem. However, as you discovered, the tool dependency of bossac 1.8.0-48-gb176eee has not been released by Arduino for the Linux ARM 64 bit host you're using. Fortunately, that bossac tool is only used for the SparkFun SAMD51 Thing Plus board. All the other boards of SparkFun SAMD Boards use bossac 1.7.0-arduino3, which is available for Linux ARM 64 bits. So what I did was publish a copy of the SparkFun boards JSON file for Boards Manager, which has the bossac tool dependency version changed from 1.8.0-48-gb176eee to 1.7.0-arduino3 (actually they should have had dependency definitions for both versions but it appears the folks at SparkFun don't have a very good understanding of how this stuff works). There are no other changes. This will work as long as you don't need to use the SparkFun SAMD51 Thing Plus board.

Instructions:

You should now be able to compile and upload to your board.