Description of problem
When uploading to two teensy boards, either a 4.1 & 3.6 or two 3.6's, platformio can't compile / upload for the correct boards, even when explicit upload_ports are set. See https://community.platformio.org/t/one-project-two-boards-two-codebases-with-src-filter/23586/6 for a more thorough explanation.
Sketches build apparently successfully and can be uploaded via TyCommander no problem.
Steps to Reproduce
- create two files,
primary.cpp and secondary.cpp
- set up platformio.ini as below
- run
platformio-upload
Actual Results
- with two 3.6's,
primary.cpp is uploaded to the first board at /dev/cu.usbmodem102538701, then secondary.cpp is also uploaded to that board.
- with one 3.6 and one 4.1 (as described in the
.ini file above), primary.cpp uploads correctly but secondary.cpp does not, despite printing "SUCCESS" in the compilation output (see here for full output).
Expected Results
PlatformIO builds each env correctly and uploads to the appropriate board. Teensy CLI should be able to figure out which board is which if they're different versions at least.
If problems with PlatformIO Build System:
The content of platformio.ini:
[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*>
Source file to reproduce issue:
// primary.cpp
int led = LED_BUILTIN;
void setup() {
pinMode(led, OUTPUT);
Serial.begin(9600);
while(!Serial && millis() < 4000);
Serial.println("\n" __FILE__ " " __DATE__ " " __TIME__);
Serial.println("hi i'm primary");
}
void loop() {
digitalWrite(led, HIGH);
delay(100);
digitalWrite(led, LOW);
delay(200);
}
// secondary.cpp
int led = LED_BUILTIN;
void setup() {
pinMode(led, OUTPUT);
Serial.begin(9600);
while(!Serial && millis() < 4000);
Serial.println("\n" __FILE__ " " __DATE__ " " __TIME__);
Serial.println("hi i'm secondary");
}
void loop() {
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(2000);
}
Description of problem
When uploading to two teensy boards, either a 4.1 & 3.6 or two 3.6's, platformio can't compile / upload for the correct boards, even when explicit upload_ports are set. See https://community.platformio.org/t/one-project-two-boards-two-codebases-with-src-filter/23586/6 for a more thorough explanation.
Sketches build apparently successfully and can be uploaded via TyCommander no problem.
Steps to Reproduce
primary.cppandsecondary.cppplatformio-uploadActual Results
primary.cppis uploaded to the first board at /dev/cu.usbmodem102538701, thensecondary.cppis also uploaded to that board..inifile above),primary.cppuploads correctly butsecondary.cppdoes not, despite printing "SUCCESS" in the compilation output (see here for full output).Expected Results
PlatformIO builds each
envcorrectly and uploads to the appropriate board. Teensy CLI should be able to figure out which board is which if they're different versions at least.If problems with PlatformIO Build System:
The content of
platformio.ini:Source file to reproduce issue: