One project, two boards, two codebases with src_filter

Yeah sadly it’s the same deal with the teensy-cli – same thing happens even if I specifically target individual boards via upload_port (the 4.1 works fine but the 3.6 gets stuck in bootloader).

The only reason I mention the GUI is that I thought maybe that modal would be a clue as to why it’s not uploading properly.

It’s possible that yes, this is an issue with teensy. But I kind of doubt it, since if I don’t specify a port in the teensyduino IDE, the GUI correctly finds the appropriate port based on which board is selected.

Here’s the output with a more explicit platformio.ini and teensy-cli:

[env:one]
platform = teensy
board = teensy36
framework = arduino
upload_protocol = teensy-cli
upload_port = /dev/cu.usbmodem102538701 ; the 3.6 is on this port
src_filter = +<*> -<.git/> -<.svn/> -<example/> -<examples/> -<test/> -<tests/> -<secondary.cpp*>

[env:two]
platform = teensy
board = teensy41
framework = arduino
upload_protocol = teensy-cli
upload_port = /dev/cu.usbmodem89957801 ; the 4.1 is on this port
src_filter = +<*> -<.git/> -<.svn/> -<example/> -<examples/> -<test/> -<tests/> -<primary.cpp*>
Summary
Processing one (platform: teensy; board: teensy36; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy36.html
PLATFORM: Teensy (4.13.1) > Teensy 3.6
HARDWARE: MK66FX1M0 180MHz, 256KB RAM, 1MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES: 
 - framework-arduinoteensy 1.154.0 (1.54) 
 - tool-teensy 1.154.210805 (1.54) 
 - toolchain-gccarmnoneeabi 1.50401.190816 (5.4.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 92 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Linking .pio/build/one/firmware.elf
Checking size .pio/build/one/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   1.6% (used 4204 bytes from 262144 bytes)
Flash: [          ]   1.2% (used 12624 bytes from 1048576 bytes)
Building .pio/build/one/firmware.hex
Configuring upload protocol...
AVAILABLE: jlink, teensy-cli, teensy-gui
CURRENT: upload_protocol = teensy-cli
Rebooting...
Uploading .pio/build/one/firmware.hex
Teensy Loader, Command Line, Version 2.2
Read ".pio/build/one/firmware.hex": 12628 bytes, 1.2% usage
Error opening USB device: Operation timed out
Waiting for Teensy device...
 (hint: press the reset button)
Found HalfKay Bootloader
Read ".pio/build/one/firmware.hex": 12628 bytes, 1.2% usage
Programming.............
Booting
======================================================================================================================= [SUCCESS] Took 4.96 seconds =======================================================================================================================

Processing two (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.13.1) > Teensy 4.1
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 7.75MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES: 
 - framework-arduinoteensy 1.154.0 (1.54) 
 - tool-teensy 1.154.210805 (1.54) 
 - toolchain-gccarmnoneeabi 1.50401.190816 (5.4.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 92 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Linking .pio/build/two/firmware.elf
Checking size .pio/build/two/firmware.elf
Building .pio/build/two/firmware.hex
Configuring upload protocol...
AVAILABLE: jlink, teensy-cli, teensy-gui
CURRENT: upload_protocol = teensy-cli
Rebooting...
Uploading .pio/build/two/firmware.hex
Teensy Loader, Command Line, Version 2.2
Read ".pio/build/two/firmware.hex": 22528 bytes, 1.1% usage
Found HalfKay Bootloader
Programming...................
Booting
======================================================================================================================= [SUCCESS] Took 1.08 seconds =======================================================================================================================

Environment    Status    Duration
-------------  --------  ------------
one            SUCCESS   00:00:04.963
two            SUCCESS   00:00:01.084
======================================================================================================================= 2 succeeded in 00:00:06.048 =======================================================================================================================