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

Thread: Issues with serial initialisation with teensy 3.6

  1. #1
    Junior Member
    Join Date
    Oct 2018
    Posts
    3

    Issues with serial initialisation with teensy 3.6

    Hi,

    I'm trying to make serial logging work with a teensy 3.6 under arch linux. It used to work a few months ago but as I just reopened my project I can not make it work anymore.
    I use platformio with teensyduino 1.44, but I have the same issue using arduino IDE.

    Here is my test code :
    Code:
    #include <Arduino.h>
    
    void setup()
    {
      // initialize LED digital pin as an output.
      pinMode(LED_BUILTIN, OUTPUT);
    
      digitalWrite(LED_BUILTIN, HIGH);
      delay(500);
      digitalWrite(LED_BUILTIN, LOW);
    
      Serial.begin(9600);
      while(!Serial);
    
      Serial.println("Serial ready");
    }
    
    void loop()
    {
      // turn the LED on (HIGH is the voltage level)
      digitalWrite(LED_BUILTIN, HIGH);
      Serial.println("High");
      // wait for a second
      delay(1000);
      // turn the LED off by making the voltage LOW
      digitalWrite(LED_BUILTIN, LOW);
      Serial.println("Low");
       // wait for a second
      delay(1000);
    }
    The led blinks once during init, as expected, but then it will stop. The program seems to be stuck waiting for the serial to init.
    Removing the while instruction fixes the issue (the led will blink) but the serial communication will not work.

    Did I missed something ? I use "-D USB_SERIAL" build flag, the device seems to be well recognized by the system, and I can see the usb serial port (ttyS0).

    Thanks.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,697
    Quote Originally Posted by risq View Post
    and I can see the usb serial port (ttyS0).
    Linux names the port /dev/ttyACM0.

    /dev/ttyS0 is almost certainly a (non-USB) serial port built into your PC's motherboard.

    With all Linux systems, the first thing to double check is you've installed the udev rules file properly.

    If that doesn't clear everything up, the way to troubleshoot is watching the kernel's logging. On Ubuntu using "tail -f /var/log/syslog" works. Arch certainly has something similar, so you can watch the kernel's messages as you plug and unplug USB cable.

  3. #3
    Junior Member
    Join Date
    Oct 2018
    Posts
    3
    Oh, you are right ! Thanks for pointing this out.

    Well, I have already added the udev rules, here is my journalctl output:
    Code:
    Oct 12 09:47:54 arch kernel: usb 2-11: USB disconnect, device number 84
    Oct 12 09:47:57 arch kernel: usb 2-11: new full-speed USB device number 86 using xhci_hcd
    Oct 12 09:47:57 arch kernel: usb 2-11: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.77
    Oct 12 09:47:57 arch kernel: usb 2-11: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    Oct 12 09:47:57 arch kernel: usb 2-11: Product: USB Serial
    Oct 12 09:47:57 arch kernel: usb 2-11: Manufacturer: Teensyduino
    Oct 12 09:47:57 arch kernel: usb 2-11: SerialNumber: 4824440
    lsusb -v:
    Code:
    Bus 002 Device 086: ID 16c0:0483 Van Ooijen Technische Informatica Teensyduino Serial
    Device Descriptor:
      bLength                18
      bDescriptorType         1
      bcdUSB               1.10
      bDeviceClass            2 Communications
      bDeviceSubClass         0 
      bDeviceProtocol         0 
      bMaxPacketSize0        64
      idVendor           0x16c0 Van Ooijen Technische Informatica
      idProduct          0x0483 Teensyduino Serial
      bcdDevice            2.77
      iManufacturer           1 Teensyduino
      iProduct                2 USB Serial
      iSerial                 3 4824440
      bNumConfigurations      1

  4. #4
    Junior Member
    Join Date
    Oct 2018
    Posts
    3
    Well, I just reboot my computer, which I had not done since I upgraded teensyduino 1.42 to 1.44 and now it works perfectly... Can't believe I spent 3 hours on that !!
    Really sorry for the inconvenience... Thanks Paul !

Posting Permissions

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