I am new to PlatformIO having moved over from the Teensyduino IDE. I have a Teensy 4.1 and code that works correctly when uploaded through Teensyduinio. When I try to upload this code using PlatformIO, I get the following message.
Processing teensy41 (platform: teensy; board: teensy41; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy41.html
PLATFORM: Teensy (4.15.0) > Teensy 4.1
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 7.75MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
- framework-arduinoteensy 1.156.0 (1.56)
- tool-teensy 1.155.0 (1.55)
- toolchain-gccarmnoneeabi 1.50401.190816 (5.4.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 93 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Linking .pio/build/teensy41/firmware.elf
Checking size .pio/build/teensy41/firmware.elf
Building .pio/build/teensy41/firmware.hex
Configuring upload protocol...
AVAILABLE: jlink, teensy-cli, teensy-gui
CURRENT: upload_protocol = teensy-cli
Rebooting...
Uploading .pio/build/teensy41/firmware.hex
Teensy Loader, Command Line, Version 2.2
Read ".pio/build/teensy41/firmware.hex": 21504 bytes, 1.1% usage
Unable to soft reboot with USB error: No such file or directory
Waiting for Teensy device...
(hint: press the reset button)
Found HalfKay Bootloader
Read ".pio/build/teensy41/firmware.hex": 21504 bytes, 1.1% usage
Programming..................
Booting
=========================================================================================================================================================================================================================================== [SUCCESS] Took 1.48 seconds ===========================================================================================================================================================================================================================================
But the Teensy does nothing from this point. I am running MacOS on an M1 chip and connect to the Teensy using USB. My configuration is as follows:
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
upload_protocol = teensy-cli
build_flags = -D USB_SERIAL