Teensy 3.6 Serial Not working

Status
Not open for further replies.

yandreev3

Member
I just got my 3.6 and It is replacing a different ARM board in a project. All the device does is read a bunch of I2C devices, a few GPS modules, and report it over serial and wireless. I tested it with a simple blink and Serial hello world program and it was fine (after a few unplugs and replugs since the serial port was not being found) Anyway I went to upload my program which ran on a different board and compiled fine and nothing. It took a long time to compile which is normal but uploaded as quickly as the two small test programs which was weird. One of the first lines in the code is the serial begin line and then shortly a test serial print. after it is done uploading, the teensy just sits there and blinks (My program does not use the LED) and does not create a serial port. I'm not sure what to do and I am getting relatively annoyed with it.

This is a teensy 3.6, teensyloader 1.32-beta2, arduino 1.6.13

Here is the verbose output:
Code:
20:37:28: Teensy Loader 1.32-beta2, begin program
20:37:28: File "OBDCU.ino.hex". 57948 bytes, 6% used
20:37:28: Listening for remote control on port 3149
20:37:28: initialized, showing main window
20:37:28: remote connection opened
20:37:28: remote cmd: "comment: Teensyduino 1.32-beta2 - WINDOWS (teensy_post_compile)"
20:37:28: remote cmd: "status"
20:37:28: status data sent
20:37:28: remote cmd: "dir:C:\Users\yandr\AppData\Local\Temp\arduino_build_333308\"
20:37:28: remote cmd: "file:OBDCU.ino.hex"
20:37:28: File "OBDCU.ino.hex". 57948 bytes, 6% used
20:37:28: remote cmd: "status"
20:37:28: status data sent
20:37:28: remote cmd: "auto:on"
20:37:28: remote connection closed
20:37:29: HID/win32:  vid:1B96 pid:0F06 ver:0004
20:37:29: HID/win32:  vid:1B96 pid:0F06 ver:0004
20:37:29: HID/win32:  vid:1B96 pid:0F06 ver:0004
20:37:29: HID/win32:  vid:0000 pid:0000 ver:0000
20:37:29: HID/win32:  vid:0000 pid:0000 ver:0000
20:37:29: HID/win32:  vid:045E pid:07E4 ver:0207
20:37:29: HID/win32:  vid:045E pid:07E4 ver:0207
20:37:29: HID/win32:  vid:045E pid:07E4 ver:0207
20:37:29: HID/win32:  vid:045E pid:07E4 ver:0207
20:37:29: HID/win32:  vid:045E pid:07E4 ver:0207
20:37:29: HID/win32:  vid:1B96 pid:0F06 ver:0004
20:37:29: HID/win32:  vid:045E pid:07E4 ver:0207
20:37:29: HID/win32:  vid:045E pid:07E4 ver:0207
20:37:29: HID/win32:  vid:1B96 pid:0F06 ver:0004
20:37:29: HID/win32:  vid:045E pid:0915 ver:0001
20:37:29: HID/win32:  vid:045E pid:0915 ver:0001
20:37:29: remote connection opened
20:37:29: remote cmd: "comment: Teensyduino 1.32-beta2 - WINDOWS (teensy_post_compile)"
20:37:29: remote cmd: "status"
20:37:29: status data sent
20:37:29: remote cmd: "dir:C:\Users\yandr\AppData\Local\Temp\arduino_build_333308\"
20:37:29: remote cmd: "file:OBDCU.ino.hex"
20:37:29: File "OBDCU.ino.hex". 57948 bytes, 6% used
20:37:29: remote cmd: "status"
20:37:29: status data sent
20:37:29: remote connection closed
20:37:29: remote connection opened
20:37:29: remote cmd: "comment: Teensyduino 1.32-beta2 - WINDOWS (teensy_reboot)"
20:37:29: remote cmd: "status"
20:37:29: status data sent
20:37:29: remote cmd: "status"
20:37:29: status data sent
20:37:29: remote cmd: "status"
20:37:29: status data sent
20:37:29: remote cmd: "status"
20:37:29: status data sent
20:37:29: remote cmd: "status"
20:37:29: status data sent
20:37:29: remote cmd: "status"
20:37:29: status data sent
20:37:29: remote cmd: "status"
20:37:29: status data sent
20:37:29: remote cmd: "status"
20:37:29: status data sent
20:37:29: remote cmd: "status"
20:37:29: status data sent
20:37:30: remote cmd: "status"
20:37:30: status data sent
20:37:30: remote cmd: "status"
20:37:30: status data sent
20:37:30: remote cmd: "status"
20:37:30: status data sent
20:37:30: remote cmd: "status"
20:37:30: status data sent
20:37:30: remote cmd: "status"
20:37:30: status data sent
20:37:30: remote cmd: "status"
20:37:30: status data sent
20:37:30: remote cmd: "status"
20:37:30: status data sent
20:37:30: remote cmd: "status"
20:37:30: status data sent
20:37:30: remote cmd: "status"
20:37:30: status data sent
20:37:30: remote cmd: "status"
20:37:30: status data sent
20:37:31: remote cmd: "status"
20:37:31: status data sent
20:37:31: remote cmd: "status"
20:37:31: status data sent
20:37:31: remote cmd: "status"
20:37:31: status data sent
20:37:31: remote cmd: "status"
20:37:31: status data sent
20:37:31: remote cmd: "status"
20:37:31: status data sent
20:37:31: remote cmd: "status"
20:37:31: status data sent
20:37:31: remote cmd: "status"
20:37:31: status data sent
20:37:31: remote cmd: "status"
20:37:31: status data sent
20:37:31: Device came online, code_size = 1048576
20:37:31: Board is: Teensy 3.6 (MK66FX1M0), version 1.03
20:37:31: File "OBDCU.ino.hex". 57948 bytes, 6% used
20:37:31: set background IMG_ONLINE
20:37:31: File "OBDCU.ino.hex". 57948 bytes, 6% used
20:37:31: elf size appears to be 1048576
20:37:31: elf binary data matches hex file
20:37:31: Code size from .elf file = 1048576
20:37:31: begin operation
20:37:31: remote cmd: "status"
20:37:31: status data sent
20:37:31: flash, block=0, bs=1024, auto=1
20:37:31: flash, block=1, bs=1024, auto=1
20:37:31: flash, block=2, bs=1024, auto=1
20:37:31: flash, block=3, bs=1024, auto=1
20:37:31: HID/win32: waiting for device
20:37:31: HID/win32: waiting for device
20:37:31: HID/win32: waiting for device
20:37:31: HID/win32: waiting for device
20:37:31: HID/win32: waiting for device
20:37:32: HID/win32: waiting for device
20:37:32: HID/win32: waiting for device
20:37:32: HID/win32: waiting for device
20:37:32: HID/win32: waiting for device
20:37:32: HID/win32: waiting for device
20:37:32: HID/win32: waiting for device
20:37:32: HID/win32: waiting for device
20:37:32: HID/win32: waiting for device
20:37:32: HID/win32: waiting for device
20:37:32: HID/win32: waiting for device
20:37:32: HID/win32: waiting for device
20:37:32: HID/win32: waiting for device
20:37:32: remote cmd: "status"
20:37:32: status data sent
20:37:32: flash, block=4, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: flash, block=5, bs=1024, auto=1
20:37:32: flash, block=6, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: flash, block=7, bs=1024, auto=1
20:37:32: flash, block=8, bs=1024, auto=1
20:37:32: flash, block=9, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: remote cmd: "status"
20:37:32: status data sent
20:37:32: flash, block=10, bs=1024, auto=1
20:37:32: flash, block=11, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: flash, block=12, bs=1024, auto=1
20:37:32: flash, block=13, bs=1024, auto=1
20:37:32: flash, block=14, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: flash, block=15, bs=1024, auto=1
20:37:32: flash, block=16, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: remote cmd: "status"
20:37:32: status data sent
20:37:32: flash, block=17, bs=1024, auto=1
20:37:32: flash, block=18, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: flash, block=19, bs=1024, auto=1
20:37:32: flash, block=20, bs=1024, auto=1
20:37:32: flash, block=21, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: flash, block=22, bs=1024, auto=1
20:37:32: flash, block=23, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: remote cmd: "status"
20:37:32: status data sent
20:37:32: flash, block=24, bs=1024, auto=1
20:37:32: flash, block=25, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: flash, block=26, bs=1024, auto=1
20:37:32: flash, block=27, bs=1024, auto=1
20:37:32: flash, block=28, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: flash, block=29, bs=1024, auto=1
20:37:32: flash, block=30, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: remote cmd: "status"
20:37:32: status data sent
20:37:32: flash, block=31, bs=1024, auto=1
20:37:32: flash, block=32, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: flash, block=33, bs=1024, auto=1
20:37:32: flash, block=34, bs=1024, auto=1
20:37:32: flash, block=35, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: flash, block=36, bs=1024, auto=1
20:37:32: flash, block=37, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: remote connection closed
20:37:32: flash, block=38, bs=1024, auto=1
20:37:32: flash, block=39, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: flash, block=40, bs=1024, auto=1
20:37:32: flash, block=41, bs=1024, auto=1
20:37:32: flash, block=42, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: flash, block=43, bs=1024, auto=1
20:37:32: flash, block=44, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: flash, block=45, bs=1024, auto=1
20:37:32: flash, block=46, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: flash, block=47, bs=1024, auto=1
20:37:32: flash, block=48, bs=1024, auto=1
20:37:32: flash, block=49, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: flash, block=50, bs=1024, auto=1
20:37:32: flash, block=51, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: flash, block=52, bs=1024, auto=1
20:37:32: flash, block=53, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: flash, block=54, bs=1024, auto=1
20:37:32: flash, block=55, bs=1024, auto=1
20:37:32: HID/win32: waiting for device
20:37:32: flash, block=56, bs=1024, auto=1
20:37:32: sending reboot
20:37:32: begin wait_until_offline
20:37:32: offline, waited 2
20:37:32: end operation
20:37:32: set background IMG_REBOOT_OK
20:37:32: redraw timer set, image 14 to show for 1200 ms
20:37:32: HID/win32:  vid:1B96 pid:0F06 ver:0004
20:37:32: HID/win32:  vid:1B96 pid:0F06 ver:0004
20:37:32: HID/win32:  vid:1B96 pid:0F06 ver:0004
20:37:32: HID/win32:  vid:0000 pid:0000 ver:0000
20:37:32: HID/win32:  vid:0000 pid:0000 ver:0000
20:37:32: HID/win32:  vid:045E pid:07E4 ver:0207
20:37:32: HID/win32:  vid:045E pid:07E4 ver:0207
20:37:32: HID/win32:  vid:045E pid:07E4 ver:0207
20:37:32: HID/win32:  vid:045E pid:07E4 ver:0207
20:37:32: HID/win32:  vid:045E pid:07E4 ver:0207
20:37:32: HID/win32:  vid:1B96 pid:0F06 ver:0004
20:37:32: HID/win32:  vid:045E pid:07E4 ver:0207
20:37:32: HID/win32:  vid:045E pid:07E4 ver:0207
20:37:32: HID/win32:  vid:1B96 pid:0F06 ver:0004
20:37:32: HID/win32:  vid:045E pid:0915 ver:0001
20:37:32: HID/win32:  vid:045E pid:0915 ver:0001
20:37:33: redraw, image 9
20:37:35: Verbose Info event
 
I'm not comfortable posting my sketch up for a few reasons but I'll say what I ended up doing was making most of my code unreachable and only allowing the serial printing to run but that did not solve anything. It would upload and the teensy just blinked and I got no serial communication. I just update to the new version I'll see of theres any change.
 
A simple example showing the problem is better than a complicated sketch - perhaps start with sketch linked in post #4 - but without code at best you'll get speculation [ see page top :: Forum Rule: Always post complete source code & details to reproduce any issue! ]... can't see if code was ported or rewritten from the alternate ARM - properly adapting to Teensy ... even as far as the Serial usage for startup. Having the LED blink if not used or set to output isn't possible without that - or having a crash of some sort.
 
I attempted to update to 1.33 and was not able to. I got a permissions error even running it as admin. As for the source code, I can probably post the main setup and thread once I get to my other pc. I have not tried what you posted in your first reply yet. I will do that tomorrow and report back.
 
Is Tools > USB Type set to Serial? Does Windows detect a COM port when you upload something simple, like File > Examples > 01.Basics > Blink?
 
As mentioned by Defragster, it is pretty hard to give you any suggestions on what to do here.

Especially with information like: "All the device does is read a bunch of I2C devices, a few GPS modules, and report it over serial and wireless."

So the only clue we have is you are using I2C. Which pins, which buss? Do you have Pullup resistors, if so how much... Which library.

Which other ARM board? Is there code specifically setup for that ARM board, things like #ifdef...

Again with so little information, the first things I would suggest is, try to get Serial.print to work at startup.

Example have:
Code:
while (!Serial && (millis < 3000)) ;  // wait up to 3 seconds for Serial port to be created.
Serial.begin(115200);
delay(250);
Serial.println("Program Start");
Serial.flush();  // optional but makes sure the output is done before the next stuff

Again your comments are confusing, you say:
It took a long time to compile which is normal but uploaded as quickly as the two small test programs which was weird. One of the first lines in the code is the serial begin line and then shortly a test serial print. after it is done uploading, the teensy just sits there and blinks (My program does not use the LED) and does not create a serial port. I'm not sure what to do and I am getting relatively annoyed with it.
So did you do a Serial.begin? I am assuming your comment about not creating a Serial port? Or are you saying that you did not get any output? Again try with the above like setup, as the Serial port takes awhile for your processor to have USB reenum it after a restart.

Again no idea which devices you are using. For example GPI and/or wireless? Are any of your devices using SPI? If so on which pins? Default ones? Then PIN 13 is used, which when you are doing SPI operations, the LED will blink... If not???

IF you do the above and the Program Start type message is not printed, then your program may be killing the processor before the setup() is being called.

Things that I have run into that can do this include having global objects which have constructors which do things. Two problems I have seen include, an object assumes that another objects constructor has been called before it's own has, which there is no way to control this. The other is the constructor tries to talk to hardware before that hardware has been initialized. I ran into that recently when I added some Serial.print calls to some class functions and one of these was called from the constructor... In this one case, I hacked it to get around this, like: if (Serial) Serial.println("foo called");

In other cases I have changed the code to two part initialization. The constructor just initializes some variables and then a start or begin method initializes any hardware or order requirements...

Again could be other issues as well, but...
 
I figured out why I couldn't update to the latest teensy 1.33 - the teensyloader app was closed yet stuck running in the background maxing out my cpu usage. Once I killed that, my fans turned off and I was able to update.

Is Tools > USB Type set to Serial? Does Windows detect a COM port when you upload something simple, like File > Examples > 01.Basics > Blink?

Yes. The USB type is set to serial. I've made some progress and am getting all of the individual components of my program working individually but not together. I can see this is an issue with just m code but I cannot seem to understand why. I have finals now however so I cannot do much to figure this out.

I tested all of the program's components separately:
Serial printing - works
IIC reading of all of the device on bus0 (18,19 pins with 10k pullups) - works
Wireless communication - works

However, combining the 3, it seems the teensy does not want to run THIS SPECIFIC code.


So what I did was in my setup block do a serial begin and a serial print and then a while loop after that does nothing and I still got the same issue. Blinking light and no serial connection. It does not even show up as a serial port in windows. The led pin is not used by anything. Not even SPI.

Things that I have run into that can do this include having global objects which have constructors which do things. Two problems I have seen include, an object assumes that another objects constructor has been called before it's own has, which there is no way to control this. The other is the constructor tries to talk to hardware before that hardware has been initialized. I ran into that recently when I added some Serial.print calls to some class functions and one of these was called from the constructor... In this one case, I hacked it to get around this, like: if (Serial) Serial.println("foo called");

In other cases I have changed the code to two part initialization. The constructor just initializes some variables and then a start or begin method initializes any hardware or order requirements...

I'll take a look at my code see if this is the case with it.

I'll end up probably posting the code after I am done with my finals if I don't figure this out. You guys are very helpful and thank you for putting up with me haha
 
Maybe try adding some lengthy delays in various places. If something in your program is messing up the USB, if you just delay it long enough (several seconds), hopefully that will give your computer enough time to complete the USB enumeration process. Even if that doesn't "solve" the problem, maybe it can give you some idea which part(s) are causing the issue?
 
I had the same issue, some interruptions in my code were messing up with TEENSY usb coms so i cleared the interrupts while setting up serial coms
Code:
cli();
Serial.begin(115200);
Serial.println("FFT example : ");
sei();

it works now
 
Status
Not open for further replies.
Back
Top