I don't understand what this error message means

C:\Users\Abdullah\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21g18a.h:237:10: fatal error: core_cm0plus.h: No such file or directory

What does this error mean?

I have searched and found the folder ATMEL/samd21/include/samd21g18a.h
So what does the other part mean: :237:10: fatal error:core_com0plus.h: No such file or directory

Because the file seems to be there.

The file may be there where you found it, but it is NOT where that long path that is in the message is looking.
Possibly an incorrect path in your code.
Paul

I found it in the exact same place as the path described.

Also I did not try to include this file in the code. It seems to be a file that is automatically included when uploading code to an SAMD-21 based board.

Check your program and libraries. The message says the line of your code is number 237 and begins 10 characters from the beginning of the line.
Paul

I see forward slashes in the path for the file. Did you copy some code that was meant for Linux or non-windows libraries?
Paul

It's complaining that core_cm0plus.h does not exist.

@Paul_KD7HB, a mix of forward and back slashes is quite normal.

Does Windoz care?
Paul

No (or maybe better, not anymore).

Or, even more accurately, never.

1 Like

I think that maybe some parts of the Arduino IDE, the SAMD core or the drivers were not installed properly. I'll try reinstalling the IDE.

It's not really accurate to say "your" because this is referencing a line in this file:

C:\Users\Abdullah\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21g18a.h

which is part of the toolchain. Since many thousands of people are using this toolchain with no problems, it's not likely that the problem is with the code in that file, and thus not something I would send a user to look at for troubleshooting purposes.

That's correct.

The source of the mixture of path separators in the compilation commands is found here:
https://github.com/arduino/ArduinoCore-samd/blob/1.8.11/platform.txt#L73

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/"

The runtime.tools.CMSIS-Atmel-1.2.0.path path is provided by the operating system and so it uses the native path separators. The other part of the path is hardcoded, and thus must be compatible with all operating systems. Since POSIX-compliant systems require the forward slash, and Windows supports it, this is the universal path separator. The Arduino build system does allow defining properties for a specific operating system (documented here), which would avoid this fairly common source of confusion, but this is only one of many properties that would need to be done to in order to completely avoid all use of forward slash on Windows systems, which would make the platform configuration more difficult to maintain due to all the duplicated content.

I think you are on the right track with suspecting the SAMD core installation is incomplete. However, reinstalling the IDE won't help with this because the SAMD core and toolchain is installed to a different location on your computer which persists even after you uninstall the IDE:

C:\Users\Abdullah\AppData\Local\Arduino15\packages

So you will be better off to delete that folder. You can try to be more surgical by deleting only the relevant subfolders of that path in order to avoid the loss of all the cores you have installed via the Arduino IDE's Boards Manager, but it's easy enough to reinstall them.

I deleted the whole Arduino15 folder and when I reinstalled the IDE (I'm using 2.0 now) and added the SAMD core, it was there.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.