6474 - MachXO2: In Mico8, I got this error when building:../LM8_LEDTest.c:21: error: `gpio_LED' undeclared (first use in this function) Where is that variable supposed to be defined? How can I get this to build?

6474 - MachXO2: In Mico8, I got this error when building:../LM8_LEDTest.c:21: error: `gpio_LED' undeclared (first use in this function) Where is that variable supposed to be defined? How can I get this to build?

The procedure 2.a in the Mico8 tutorial (To add the GPIO to the platform) should address your concern.

In the Instance Name box, change the name of the GPIO to LED. For this tutorial, the GPIO block must be named LED. Failure to name the GPIO block LED will cause mismatches in the FPGA I/O pin names. The example C source code uses this instance name to access the GPIO registers.

It should process and you might then experience something like this: makefile:123: recipe for target '< >.elf' failed
The issue is caused by not having enough memory for the executable. You will either need to increase the memory for the Mico8 or optimized the code (i.e. using -0s, using Assembly or removing printf).
 
In addition, we are moving toward Lattice Propel which is the newer version of Mico8. Mico software is outdated with limited to no-support already. In line this, we recommend that you explore about Lattice Propel which is the most recent development that Lattice can offer. To know more about Lattice Propel please visit this webpage: https://www.latticesemi.com/en/Products/DesignSoftwareAndIP/FPGAandLDS/LatticePropel