PlatformIO Community

Teensy 4.0 fails in the serial monitor after upload

Hi everyone,

Recently I was experimenting with the Python serial library, now when I try uploading my code two things happen:-

  1. The actual code doesn’t upload
  2. I get this error when I open my serial monitor
    image

My setup -
Board - Teensy 4.0
Platform - Arduino
OS - Ubuntu 22.04

My question is why it doesn’t work, apologies if this is the category for this question

Thanks.

Do you stop any other programs that access the teensy’s serial port before you upload, and only open one serial monitor program after the program was uploaded?

Is the upload succesfull in the log?

Yep. It works with the Arduino IDE seems like PIO is the problem

I don’t think the upload is successful in the log

Can you show these logs?

Yep, here they are

image

And there are not other programs accessing /dev/ttyACM0? What’s the exact sketch running on it?

Pretty sure that no other programs are accessing /dev/ttyACM0, this is the exact sketh just a Teensy 4.0 hooked up to a Bosch BMI088 IMU sensor (side note I can’ even run a simple Serial.println("Hello World") either)

 #include "BMI088.h"

Bmi088Accel accel(Wire,0x18);
Bmi088Gyro gyro(Wire,0x68);

void setup() 
{
  /* USB Serial to print data */
  Serial.begin(9600);
  while(!Serial) {}

  /* start the sensors */
  accel.begin();
  gyro.begin();
}


void loop() 
{
  // read the sensors
  accel.readSensor();
  gyro.readSensor();

  Serial.println(accel.getAccelX_mss());

  /* delay to help with printing */
  delay(20);
}

What version of Teensyduino are you using there? (Arduino IDE → Tools → Board Manager- > teensy)?

PIO’s Udev rules are installed?

Using Teensyduino 1.57 (the latest version I believe). Wasn’t sure about PIO Udev rules so I followed the steps but I’m still getting the same result.
image

Hm, if the Udev rules are installed and you rebooted, there shouldn’t be any Linxu modem manager trying to access the device anymore… Not sure what’s going on there, maybe try filing an issue at Issues · platformio/platform-teensy · GitHub.

Alright. Will do, thanks for the help @maxgerhardt