Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: "Error opening USB device: No error" while programming by teensy_loader_cli

  1. #1
    Junior Member
    Join Date
    Apr 2021
    Posts
    4

    "Error opening USB device: No error" while programming by teensy_loader_cli

    Hi,

    I don't have any prior experience with Teensy boards and I'm pretty newbie. I have one Teensy 4.0 board connected to a laptop which I don't have physical access to it but I have a ssh connection to the laptop so the only option for me to program the device is using teensy_loader_cli package.

    I've successfully installed teensy_loader_cli and programmed the device for the first time using the following command with the available hex file example in the directory:

    /teensy_loader_cli --mcu=TEENSY40 -s blink_slow_Teensy40.hex

    and I confirmed that the LED toggles and every thing's OK.

    In the next step I opened an example in Arduino:

    /examples/Teensy/Tutorial3/HelloSerialMonitor


    void setup() {
    Serial.begin(38400);
    }

    void loop()
    {
    Serial.println("Hello World");
    delay(1000);
    }

    I verify/compiled the code and export compiled binary file to the laptop and used the previous cli command to program the board, but I got this error and cli hangs in there:

    "Error opening USB device: No error"

    Well I know this was a bad code and I have to press the push button or reset the USB cable but why is it a bad code? Here is the Arduino Tools parameters for this sketch:

    Board : "Teensy 4.0"
    USB Type: "Serial"
    ...

  2. #2
    Senior Member
    Join Date
    Oct 2019
    Location
    Calgary
    Posts
    121
    There is a problem with the blink_slow_Teensy40.hex file and the soft reset option. It'll load once, but after that it does as you describe.

    If you compile your own blink sketch, it'll work.

  3. #3
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,488
    It seems the precompiled HEX was built without Serial - so it requires a Button press for the next upload. This is how Teensy units ship due to some prior issue when the PC first sees it.

    As noted building simple Blink with Serial will enable the Auto Upload.

  4. #4
    Junior Member
    Join Date
    Apr 2021
    Posts
    4
    Thanks a lot, I really appreciate your hint. That's right, it worked with a fresh new sketch.

  5. #5
    Junior Member
    Join Date
    Apr 2021
    Posts
    4
    Thanks alot, you saved my time. That works.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •