How to repair this: compiling for LGT8F328 - compiler looks up the Teensy-path?

Hello,

I bought some LGT8F328 boards (externally similar dimensions to Arduino Nano.

Installed a LGT8F board package. Added additional board URL.
Flashing a simple blink sketch also worked.

Meanwhile, the Arduino IDE 1.8.19 wanted to update boards (ESP32) .
And now I get an error message when compiling:

Arduino: 1.8.19 (Windows 10), Board: "LGT8F328, 64 (normal), External 16MHz, 1, 328P-LQFP32 (e.g. MiniEVB nano-style or WAVGAT), 57600"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\dipl-\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\dipl-\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries F:\myData\Arduino\libraries -fqbn=lgt8fx:avr:328:arduino_isp=disable,clock_source=external_16,clock_div=1,variant=modelP,upload_speed=57600 -ide-version=10819 -build-path C:\Users\dipl-\AppData\Local\Temp\arduino_build_291688 -warnings=default -build-cache C:\Users\dipl-\AppData\Local\Temp\arduino_cache_333883 -prefs=build.warn_data_percentage=75 -verbose F:\myData\Arduino\LGT8F328-Blink-Test-001\LGT8F328-Blink-Test-001.ino

C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\dipl-\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\dipl-\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries F:\myData\Arduino\libraries -fqbn=lgt8fx:avr:328:arduino_isp=disable,clock_source=external_16,clock_div=1,variant=modelP,upload_speed=57600 -ide-version=10819 -build-path C:\Users\dipl-\AppData\Local\Temp\arduino_build_291688 -warnings=default -build-cache C:\Users\dipl-\AppData\Local\Temp\arduino_cache_333883 -prefs=build.warn_data_percentage=75 -verbose F:\myData\Arduino\LGT8F328-Blink-Test-001\LGT8F328-Blink-Test-001.ino

Using board '328' from platform in folder: C:\Users\dipl-\AppData\Local\Arduino15\packages\lgt8fx\hardware\avr\2.0.6

Using core 'lgt8f' from platform in folder: C:\Users\dipl-\AppData\Local\Arduino15\packages\lgt8fx\hardware\avr\2.0.6

Detecting libraries used...

"C:\Users\dipl-\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3.1\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DSERIAL_RX_BUFFER_SIZE=64 -DCLOCK_SOURCE=2 -DF_CPU=(16000000L/1) -DF_OSC=16000000L -DF_DIV=1 -DARDUINO=10819 -DARDUINO_AVR_LARDU_328E -DARDUINO_ARCH_AVR "-IC:\Users\dipl-\AppData\Local\Arduino15\packages\lgt8fx\hardware\avr\2.0.6\cores\lgt8f" "-IC:\Users\dipl-\AppData\Local\Arduino15\packages\lgt8fx\hardware\avr\2.0.6\variants\lgt8fx8p" "C:\Users\dipl-\AppData\Local\Temp\arduino_build_291688\sketch\LGT8F328-Blink-Test-001.ino.cpp" -o nul

Error while detecting libraries included by C:\Users\dipl-\AppData\Local\Temp\arduino_build_291688\sketch\LGT8F328-Blink-Test-001.ino.cpp

Generating function prototypes...

"C:\Users\dipl-\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3.1\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DSERIAL_RX_BUFFER_SIZE=64 -DCLOCK_SOURCE=2 -DF_CPU=(16000000L/1) -DF_OSC=16000000L -DF_DIV=1 -DARDUINO=10819 -DARDUINO_AVR_LARDU_328E -DARDUINO_ARCH_AVR "-IC:\Users\dipl-\AppData\Local\Arduino15\packages\lgt8fx\hardware\avr\2.0.6\cores\lgt8f" "-IC:\Users\dipl-\AppData\Local\Arduino15\packages\lgt8fx\hardware\avr\2.0.6\variants\lgt8fx8p" "C:\Users\dipl-\AppData\Local\Temp\arduino_build_291688\sketch\LGT8F328-Blink-Test-001.ino.cpp" -o "C:\Users\dipl-\AppData\Local\Temp\arduino_build_291688\preproc\ctags_target_for_gcc_minus_e.cpp"

avr-g++: error: device-specs/specs-atmega328p: No such file or directory

exit status 1

What strikes me as very strange is that when compiling for a LGT8F328 board, the path for Teensy is checked.

Generating function prototypes...

"C:\Users\dipl-\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3. 1\avr/bin/avr-g++" ...

What do I have to do to repair this
so the compiler looks up the correct subfolder that must be used when compiling for LGT8F328 boards ?

best regards Stefan

I can't give you advice how to solve the problem.

One reason why I use IDE 1.8.x is that it supports portable installs. For each processor/board, I create a portable install. Portable installs don't interfere with each other. So you can have a portable install for AVR, for Teensies (plus AVR), a portable install for LGT8F328 (plus AVR), portable install for ESP8266 (plus AVR), portable install for ESP32 (plus AVR) etc.

Yes, it chews a bit of diskspace (basically a full IDE installation per install) but you will never run into the issue that you have.

Added benefit:
If you backup a portable install, you have ALL relevant stuff (IDE, compiler, board package used, libraries) in the backup.

Hi @StefanL38. Most Arduino boards platforms specify the toolchain dependencies that should be installed along with the platform via Arduino IDE Boards Manager. The "LGT8fx Boards" platform doesn't do that. It instead assumes that usable dependencies will have already been installed through the installation of a different platform (e.g., "Arduino AVR Boards"). It has a dependency on the avr-gcc compiler, but leaves the choice of where to find it to Arduino IDE:

https://github.com/dbuezas/lgt8fx/blob/v2.0.6/lgt8f/platform.txt#L21

compiler.path={runtime.tools.avr-gcc.path}/bin/

This leaves for some ambiguity in the case where you have installed multiple platforms that each installed a candidate tool.

Although using this approach in a platform always risks that an unsuitable tool might be chosen, Arduino IDE 1.x was especially unsmart, inconsistent, and buggy in the tool selection under these conditions. These problems have already been resolved in Arduino IDE 2.x

But I know you prefer Arduino IDE 1.x. Despite quite some efforts, I didn't find any way to make the "LGT8fx Boards" platform coexist with the "Teensy" boards platform in Arduino IDE 1.x due to that bug. Fortunately this isn't a problem after all because Arduino IDE 1.x is not even compatible with the "Teensy" boards platform (you must use Teensyduino instead). I'll provide instructions you can follow to workaround this bug in Arduino IDE:

  1. Select File > Preferences... from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Remove the URL for the "Teensy" boards platform from the "Additional Boards Manager URLs" field.
  3. Click the OK button.
  4. Select File > Quit from the Arduino IDE menus if it is running.

Arduino IDE 1.x had a quirk that it doesn't recognize installed platforms if you remove their URL from that preferences field. This means that we can cause it to ignore the "Teensy" boards platform entirely, which doesn't do any harm since that platform couldn't be used in Arduino IDE anyway. This means you can keep the "Teensy" boards platform installed in case you feel like using it with Arduino CLI or Arduino IDE 2.x.

Now start Arduino IDE and try compiling a sketch for the "LGT8F328" board again. Hopefully this time an appropriate avr-gcc will be selected and the sketch will compile without any unexpected errors.

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