Skip to content
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

Missing sam.h file while compiling #6

Open
thebigcath opened this issue Nov 15, 2017 · 14 comments
Open

Missing sam.h file while compiling #6

thebigcath opened this issue Nov 15, 2017 · 14 comments

Comments

@thebigcath
Copy link

Hi! I operate the Brunel hand through the Arduino Serial monitor interface without problem. However I fail to compile either Beetroot or the MyoWare_Sensor_Test due to a missing file. The error message is copied below.

I tried the following debug steps:
-Tried without sucess to find the missing "sam.h"
-Tried to comment out the line "include sam.h" in the file mentioned in the error message. But then it gives me the same error for another related file

thanks for your help!
Cath

ERROR MESSAGE AFTER TRYING TO COMPILE IN ARDUINO:

Arduino: 1.8.3 (Windows 10), Board: "Chestnut"

In file included from sketch\MyoWare_Sensor_Test_V1.1.ino.cpp:1:0:

C:\Users\Catherine\AppData\Local\Arduino15\packages\openbionics\hardware\samd\1.2.12\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 Chestnut.

@thebigcath
Copy link
Author

UPDATE:
-I updated my Arduino IDE to the latest version (1.8.5) --> No change

  • Using this thread as a reference (https://forum.arduino.cc/index.php?topic=382953.0), I transfered the sam.h file from the arduino package to the openbionics package direction given in the error message. It then asked me for a samd.h, which I transfered as well. Then it asked me for a samd21.h which I can seem to get recognize even if I transfer.

At this point I think the whole "ATMEL" files might be missing from your openbionic package...?

here is my latest error message when I try to compile:
Arduino: 1.8.5 (Windows 10), Board: "Chestnut"

In file included from C:\Users\Catherine\AppData\Local\Arduino15\packages\openbionics\hardware\samd\1.2.12\cores\arduino/sam.h:581:0,

             from C:\Users\Catherine\AppData\Local\Arduino15\packages\openbionics\hardware\samd\1.2.12\cores\arduino/Arduino.h:48,

             from sketch\MyoWare_Sensor_Test_V1.1.ino.cpp:1:

C:\Users\Catherine\AppData\Local\Arduino15\packages\openbionics\hardware\samd\1.2.12\cores\arduino/samd.h:91:35: fatal error: samd21/include/samd21.h: No such file or directory

#include "samd21/include/samd21.h"

                               ^

compilation terminated.

exit status 1
Error compiling for board Chestnut.

@Doc-Magee
Copy link

We had the same issue. We fixed it by installing the following board package in the board manager:

Arduino SAMD Boards (32-bits ARM Cortex-M0+) by Arduino

If you copied and pasted the samd and other files you will need to uninstall and reinstall the openbionics board packages.

If this works for you I think they need to add a section to their Quick Start guide.

@thebigcath
Copy link
Author

Thanks MinIBCI, it works fine with the SAMD package installed.
I agree they should mention it somewhere

@DanielArnett
Copy link

What package versions are you using for SAMD and Open Bionics? I've gone so far as to reinstall arduino, install package Open Bionics, install package SAMD, and it still doesn't work. I've then repeated the process on a Windows and Linux machine, all give the same errors after rechecking my work.

@Doc-Magee
Copy link

Doc-Magee commented Jul 25, 2019 via email

@a98-smith
Copy link

I'm having the same problem, I've installed and reinstalled the all the suggested packages (including the SMAD boards, which is now in the start-up guide) and the IDE on multiple machines on Linux and Windows and I cannot for the life of me get anything to compile.
I've tried copying and pasting to no avail, I've tried altering the include so that it's looking in the ATMEL folders for the files it needs but nothing is budging.

Any suggestions would be greatly appreciated?

@biogoly
Copy link

biogoly commented Nov 30, 2019

Go back to Arduino IDE 1.8.9, reinstall all the packages (SAMD, etc...) and it should compile correctly.

@a98-smith
Copy link

Go back to Arduino IDE 1.8.9, reinstall all the packages (SAMD, etc...) and it should compile correctly.

Thanks for that, I managed to get past the missing sam.h file by rolling back to 1.8.7. 1.8.9 and 1.8.8 didn't work for me.

@a98-smith
Copy link

Go back to Arduino IDE 1.8.9, reinstall all the packages (SAMD, etc...) and it should compile correctly.

Thanks for that, I managed to get past the missing sam.h file by rolling back to 1.8.7. 1.8.9 and 1.8.8 didn't work for me.

Tell a lie, still receiving the same error I had just forgotten to change the board.

@aaronwoodcox
Copy link

I am encountering the same error:
In file included from sketch/OpenBionics_Beetroot.ino.cpp:1:0:
/home/aaron/.arduino15/packages/openbionics/hardware/samd/1.2.21/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 Chestnut.

Versions:
Arduino 1.8.10
Arduino SAMD 1.8.4
Open Bionics 1.2.21
FingerLib 2.1.0

I have also tried uninstalling and reinstalling the SAMD and Open Bionics packages to no avail. Recommendations on how to proceed?

@aaronwoodcox
Copy link

Enabling verbose output was a big help -- discovered that the include path to the Atmel CMSIS is incorrect.

Arduino: 1.8.10 (Linux), Board: "Chestnut"

/home/aaron/Projects/brunelHand2.0/arduino-1.8.10-linux64/arduino-1.8.10/arduino-builder -dump-prefs -logger=machine -hardware /home/aaron/Projects/brunelHand2.0/arduino-1.8.10-linux64/arduino-1.8.10/hardware -hardware /home/aaron/.arduino15/packages -tools /home/aaron/Projects/brunelHand2.0/arduino-1.8.10-linux64/arduino-1.8.10/tools-builder -tools /home/aaron/Projects/brunelHand2.0/arduino-1.8.10-linux64/arduino-1.8.10/hardware/tools/avr -tools /home/aaron/.arduino15/packages -built-in-libraries /home/aaron/Projects/brunelHand2.0/arduino-1.8.10-linux64/arduino-1.8.10/libraries -libraries /home/aaron/Arduino/libraries -fqbn=openbionics:samd:ob_chestnut -ide-version=10810 -build-path /tmp/arduino_build_834318 -warnings=none -build-cache /tmp/arduino_cache_928624 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=/home/aaron/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1 -prefs=runtime.tools.arm-none-eabi-gcc-4.8.3-2014q1.path=/home/aaron/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1 -prefs=runtime.tools.CMSIS.path=/home/aaron/.arduino15/packages/arduino/tools/CMSIS/4.0.0-atmel -prefs=runtime.tools.CMSIS-4.0.0-atmel.path=/home/aaron/.arduino15/packages/arduino/tools/CMSIS/4.0.0-atmel -prefs=runtime.tools.openocd.path=/home/aaron/.arduino15/packages/arduino/tools/openocd/0.9.0-arduino -prefs=runtime.tools.openocd-0.9.0-arduino.path=/home/aaron/.arduino15/packages/arduino/tools/openocd/0.9.0-arduino -prefs=runtime.tools.bossac.path=/home/aaron/.arduino15/packages/arduino/tools/bossac/1.6.1-arduino -prefs=runtime.tools.bossac-1.6.1-arduino.path=/home/aaron/.arduino15/packages/arduino/tools/bossac/1.6.1-arduino -verbose /home/aaron/Projects/brunelHand2.0/Beetroot/OpenBionics_Beetroot/OpenBionics_Beetroot/OpenBionics_Beetroot.ino
/home/aaron/Projects/brunelHand2.0/arduino-1.8.10-linux64/arduino-1.8.10/arduino-builder -compile -logger=machine -hardware /home/aaron/Projects/brunelHand2.0/arduino-1.8.10-linux64/arduino-1.8.10/hardware -hardware /home/aaron/.arduino15/packages -tools /home/aaron/Projects/brunelHand2.0/arduino-1.8.10-linux64/arduino-1.8.10/tools-builder -tools /home/aaron/Projects/brunelHand2.0/arduino-1.8.10-linux64/arduino-1.8.10/hardware/tools/avr -tools /home/aaron/.arduino15/packages -built-in-libraries /home/aaron/Projects/brunelHand2.0/arduino-1.8.10-linux64/arduino-1.8.10/libraries -libraries /home/aaron/Arduino/libraries -fqbn=openbionics:samd:ob_chestnut -ide-version=10810 -build-path /tmp/arduino_build_834318 -warnings=none -build-cache /tmp/arduino_cache_928624 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=/home/aaron/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1 -prefs=runtime.tools.arm-none-eabi-gcc-4.8.3-2014q1.path=/home/aaron/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1 -prefs=runtime.tools.CMSIS.path=/home/aaron/.arduino15/packages/arduino/tools/CMSIS/4.0.0-atmel -prefs=runtime.tools.CMSIS-4.0.0-atmel.path=/home/aaron/.arduino15/packages/arduino/tools/CMSIS/4.0.0-atmel -prefs=runtime.tools.openocd.path=/home/aaron/.arduino15/packages/arduino/tools/openocd/0.9.0-arduino -prefs=runtime.tools.openocd-0.9.0-arduino.path=/home/aaron/.arduino15/packages/arduino/tools/openocd/0.9.0-arduino -prefs=runtime.tools.bossac.path=/home/aaron/.arduino15/packages/arduino/tools/bossac/1.6.1-arduino -prefs=runtime.tools.bossac-1.6.1-arduino.path=/home/aaron/.arduino15/packages/arduino/tools/bossac/1.6.1-arduino -verbose /home/aaron/Projects/brunelHand2.0/Beetroot/OpenBionics_Beetroot/OpenBionics_Beetroot/OpenBionics_Beetroot.ino
Using board 'ob_chestnut' from platform in folder: /home/aaron/.arduino15/packages/openbionics/hardware/samd/1.2.21
Using core 'arduino' from platform in folder: /home/aaron/.arduino15/packages/openbionics/hardware/samd/1.2.21
Detecting libraries used...
/home/aaron/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10810 -DARDUINO_SAMD_CHESTNUT -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -DUSB_VID=0x1209 -DUSB_PID=0xAA0B -DUSBCON "-DUSB_MANUFACTURER="Open Bionics"" "-DUSB_PRODUCT="Chestnut"" -I/home/aaron/.arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/ -I/CMSIS/Device/ATMEL/ -I/home/aaron/.arduino15/packages/openbionics/hardware/samd/1.2.21/cores/arduino -I/home/aaron/.arduino15/packages/openbionics/hardware/samd/1.2.21/variants/chestnut /tmp/arduino_build_834318/sketch/OpenBionics_Beetroot.ino.cpp -o /dev/null
Alternatives for sam.h: []
ResolveLibrary(sam.h)
-> candidates: []
In file included from /tmp/arduino_build_834318/sketch/OpenBionics_Beetroot.ino.cpp:1:0:
/home/aaron/.arduino15/packages/openbionics/hardware/samd/1.2.21/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 Chestnut.

Discovered that at least on my system (with versions per my previous comment), I had sam.h files at the following locations:
~/.arduino15/packages$ find . -name sam.h
./arduino/tools/CMSIS/4.0.0-atmel/Device/ATMEL/sam.h
./arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/sam.h
./arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd51/include/sam.h
./arduino/hardware/sam/1.6.12/system/CMSIS/Device/ATMEL/sam.h

After noticing that the include paths specified during compilation DO NOT point to any of the sam.h files on my system I tried updating the path. I am able to successfully compile by updating the include path, editing the following file:
.arduino15/packages/openbionics/hardware/samd/1.2.21/platform.txt

Replacing the following:
compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-4.5.0.path}/CMSIS/Include/" "-I{runtime.tools.CMSIS-Atmel-1.1.0.path}/CMSIS/Device/ATMEL/"

with
compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-4.5.0.path}/CMSIS/Include/" "-I{runtime.tools.CMSIS-Atmel-1.2.0.path}/CMSIS/Device/ATMEL/"

This seems to work. Is this the proper fix or should something else be done to fix this permanently / correctly?

@DanielArnett
Copy link

Thanks @aaronwoodcox ! That led me to the next error, one about Cannot run program "{runtime.tools.bossac- 1.7.0.path}/bossac", which was fixed by this StackOverflow answer.

@OllyMcBrideOB
Copy link
Contributor

This issue may now have been fixed within 'Open Bionics Boards V1.2.22'.

The Arduino Boards Manager file 'package_openbionics_index.json' uses the tool dependencies installed by the Samd boards (as the Board Manager does not allow us to automatically run the 'post_install.bat' script as we are not a signed distributor). The directory structure of the Samd tool dependencies appears to have changed. The 'package_openbionics_index.json' has now been updated to reflect this and appears to have fixed the issue.

@TomasBuchta
Copy link

TomasBuchta commented Mar 24, 2022

For anyone still facing this issue with Brunel Hand V1.0 after trying previously described solutions: Resolved by downgrading SAMD to 1.6.21.

Arduino IDE 1.8.5
Chesnut 1.2.21
Firmware 1.1
Pop!OS 20.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants