Missing include files for my board


I'm trying to compile/upload GRBL to my WeMos D1R2 (ESP8266) board. The library is intended for Uno/328p chip.

With that said I really want it to work with my board, and it's a possibility that it will with a few pin changes. But, the Arduino IDE won't let me compile it when my board is selected due to missing Include/avr/io.h file, that exist and compile work if i select the Uno board.

So how do I trick the IDE to ignore the board type and compile as it was an UNO board?


This is from the GRBL repository on Github. It doesn't sound too hopeful for an Esp8266 installation :

Grbl is a no-compromise, high performance, low cost alternative to parallel-port-based motion control for CNC milling. It will run on a vanilla Arduino (Duemillanove/Uno) as long as it sports an Atmega 328

Machine code generated for an 8bit 386 target architecture is unlikely to run optimally on a 32 bit Esp8266, even if you could trick the IDE into generating it.

Yeah, but I was reading some were that it might work on other types of boards, but that there wasn't any support for this. And I can't see why not, the code is just supposed to send on/off signals to the steppers motors. But I won't find out unless the IDE allow me to try, and that is the problem.

So how do I trick the IDE to ignore the board type and compile as it was an UNO board?

You don't. They're completely different architecture and there's no way that avr/io.h would have a chance of working on the ESP8266 since the files included by io.h are AVR specific.

That's not to say it would be impossible to add ESP8266 support to GRBL. You might search around to see if anyone has done it or is working on it. However, to do this requires digging into the source code of GRBL, understanding how it works and understanding the equivalent ESP8266 code. The esp8266 Arduino core does a fairly good job of allowing you to program an ESP8266 with the same or similar code to an Uno but once you get to lower level code needed for high performance on AVR it's a different story.

Allright. I guess I lack knowledge about how these chips works. Figure the usage for a devloper was just plain C++ and the pins. I can't even imagine what the low level code could be? I mean what is it that you can't do with standard C++ in an Ardurino environment.

I'm not arguing here just trying to understand..