Skip to content

can't compile/upload for two teensies simultaneously #78

@defenestrated

Description

@defenestrated

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

  1. create two files, primary.cpp and secondary.cpp
  2. set up platformio.ini as below
  3. 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);
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions