Toolchain-gccarmnoneeabi header issues

Hello, i am getting the following error while compiling in my Macbook M1
Users/$$$$$/.platformio/packages/toolchain-gccarmnoneeabi@1.70201.0/arm-none-eabi/include/termios.h:4:10: fatal error: sys/termios.h: No such file or directory

When i check in the sys folder of toolchain-gccarmnoneeabi indeed there is no termios.h file, but i do have one in my OS (which has different identifiers)

I checked and i have Rossetta installed, so i don’t think it’s related to that. Any ideas?

Mhmm okay I get an idea of why that is now. The file is in gd2-lib/spidriver.cpp at master · jamesbowman/gd2-lib · GitHub. I think the entire pc/ folder should not be compiled for an embedded target.

In the compilation log, do you see PlatformIO trying to compile anything from that pc/ folder, like spidriver.cpp?

Yes exactly! that file is the problem. I am still not using the arduino board, i am just trying to see if it compiles but it gives me that error

With what microcontroller are you using that Gameduino 2 “shield”? Based on your post it must be an ARM based one (Teensy X), but which board = .. do you have selected in the platformio.ini?

I have “due” board selected. The project is very very poorly documented. Some of the other platformio.ini files even had a “duelow” and “duehigh” boards that i replaced with “due” because i could’t find any boards with those names

Well yes the problem is that PlatformIO is trying to compile a file that should not be compiled for the embedded target (anything in PC).

Usually a library has a library.json (Redirecting...) that controls such build options. I have created a library.json with

  "name": "gd2-lib",
  "version": "1.3.4",
    "type": "git",
    "url": ""
  "build": {
    "srcDir": ".",
    "srcFilter": "+<*> -<**/pc>"

that works around this problems and allowed me to compile for a Teensy.

A Due is a different story. The library / examples e.g. need EEPROM.h, which is not available by default in the Due’s Arduino core (but fill-in libraries like GitHub - PhiJu5/DueFlashStorage: Due EEPROM emulation exist, but they use a different header name). Did you already encounter / solve that?

If the original platformio.ini referenced duehigh and duelow then there must be a duelow.json etc. JSON file somewhere. Is that there?

1 Like

For reference, when I do

platform = teensy
board = teensy40
framework = arduino
lib_deps =

with a src/main.cpp filled with the content of gd2-lib/helloworld.ino at master · jamesbowman/gd2-lib · GitHub, it compiles.

Calculating size .pio\build\teensy40\firmware.elf
Building .pio\build\teensy40\firmware.hex
teensy_size: Memory Usage on Teensy 4.0:
teensy_size:   FLASH: code:24812, data:2968, headers:9080   free for files:1994756
teensy_size:    RAM1: variables:3680, code:23104, padding:9664   free for local variables:487840
teensy_size:    RAM2: variables:12384  free for malloc/new:511904
============================================= [SUCCESS] Took 1.39 seconds =============================================

I’ll try with that library.json trick

I see i’m going trhough the path my predessesor went through. He actually forked that Repo and made this one. And i already installed that.

This project had different github repos for each part of the project. Now i am just trying to compile the “OS” that was created. Other repos did have a platformio.ini, and some of those had a “duelow” board selected. But the one i am trying to compile had no more files than the .cpp and .h

Okay, I definitely got the hello world example compiling for a Due with the latest library version. The EEPROM.h include was just from an example which didn’t need it after all. What was holding it back was a type conversion error for SPI.transfer() between a char* and a byte* (aka unsigned char*).


platform = atmelsam
board = due
framework = arduino
lib_deps =

I can get the hello-world.ino example linked above but without the #include <EEPROM.h> line to build correctly.

Linking .pio\build\due\firmware.elf
Checking size .pio\build\due\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   2.8% (used 2728 bytes from 98304 bytes)
Flash: [          ]   2.9% (used 15436 bytes from 524288 bytes)
Building .pio\build\due\firmware.bin
============================================= [SUCCESS] Took 11.49 seconds =============================================

My fork already includes the library.json which ignores the pc/ folder.

1 Like

Yeah, i think that did the trick. I’m not 100% sure just because now there are other issues coming up. Let me check again

Yes, i think it worked. There’s just so many instalation issues. It’s asking me for dependencies i already installed. This is too much for a platformio/arduino newbie.

But i think we got this issue fixed. Thanks again!!

Do you have the source code for the application and the target board & version information / original files / libraries uploaded somewhere? Or they publishable?

1 Like

It’s actually a private repository. I think i am going to have to find the previous developer because now i just found out he defined a debug.h file that isn’t anywhere and is super integrated in the code.

But even if i could send you the code it does give much information. I think i have conceptual things i need to understand about platformio and arduino, but if i can boil them down to a question ill surely post it here

1 Like