Illegal Instruction [.pio/build/teensy40/src/main.cpp.o] Error 132

It is done.

grafik

It was able to finish the compilation process. I then sticked a package.json into the generated GCC package and repackaged it with pio package pack, creating the toolchain package. Then I copied it to the pi locally in its home directory and refernced it in the platformio.ini using the file:// “protocol”.

[env:teensy40]
platform = teensy
board = teensy40
framework = arduino
platform_packages =
   toolchain-gccarmnoneeabi@file:///home/pi/toolchain-gccarmnoneeabi-linux_armv6l-1.90301.201121.tar.gz
   tool-teensy@https://github.com/maxgerhardt/pio-tool-teensy-arm/archive/master.zip

That file is downloadable from my Google Drive: toolchain-gccarmnoneeabi-linux_armv6l-1.90301.200408.tar.gz - Google Drive. You have to download the file, transfer it the the Pi (SCP / WinSCP) and then reference the local path to to it per above.

Compiling a blinky example code then gives

pi@raspberrypi:~/teensy_test $ pio run
Processing teensy40 (platform: teensy; board: teensy40; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy40.html
PLATFORM: Teensy (4.11.0) > Teensy 4.0
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 1.94MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
 - framework-arduinoteensy 1.153.0 (1.53)
 - tool-teensy 1.152.200516 (1.52)
 - toolchain-gccarmnoneeabi 1.90301.201121 (9.3.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 89 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/teensy40/src/main.cpp.o
[..]
Indexing .pio/build/teensy40/libFrameworkArduino.a
Linking .pio/build/teensy40/firmware.elf
Building .pio/build/teensy40/firmware.hex
Checking size .pio/build/teensy40/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]   7.9% (used 41660 bytes from 524288 bytes)
Flash: [          ]   0.6% (used 12080 bytes from 2031616 bytes)
============================ [SUCCESS] Took 207.13 seconds ============================

A success :slight_smile:

I then followed the instructions on copying the udev rules and rebooted my Pi. I can upload to my Teensy as soon as I get a USB-OTG cable at the local shop which I somehow don’t have yet…

Update:

Attempting to upload gives

 $ pio run -t upload
Processing teensy40 (platform: teensy; board: teensy40; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy40.html
PLATFORM: Teensy (4.11.0) > Teensy 4.0
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 1.94MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
 - framework-arduinoteensy 1.153.0 (1.53)
 - tool-teensy 1.152.200516 (1.52)
 - toolchain-gccarmnoneeabi 1.90301.201121 (9.3.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 89 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Linking .pio/build/teensy40/firmware.elf
Building .pio/build/teensy40/firmware.hex
Checking size .pio/build/teensy40/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]   7.9% (used 41660 bytes from 524288 bytes)
Flash: [          ]   0.6% (used 12960 bytes from 2031616 bytes)
Configuring upload protocol...
AVAILABLE: jlink, teensy-cli, teensy-gui
CURRENT: upload_protocol = teensy-cli
Rebooting...
Uploading .pio/build/teensy40/firmware.hex
Teensy Loader, Command Line, Version 2.1
Read ".pio/build/teensy40/firmware.hex": 12964 bytes, 0.6% usage
Found HalfKay Bootloader
Programming..........
Booting
============================ [SUCCESS] Took 27.35 seconds ============================

and a blinking LED :slight_smile:

EDIT: Remove old link https://bintray.com/maxgerhardt/pio-tools/toolchain-gccarmnoneeabi/toolchain-gccarmnoneeabi-linux_armv6l-1.90301.201121/view/files#files that expired since BinTray went down for GoogleDrive.

1 Like