Teensy 3.6 Upload Issues. Upload fails, USB COM Port disappears (Code 43)

Hello PIO,

I have been using PIO to upload code to Teensy 3.6s all day long for over a year without a problem. Recently they started to fail, which would leave me with an unrecognized USB device on Windows 10. The only way I can recover from this is by disconnecting the T36 from my computer, restarting my computer, and then plugging the teensy back in.

If I use the teensyloader gui by itself to load the hex file I build with PIO, it works without a problem across 25+ uploads, but starting last night I typically get an unrecognized T36 after ~3-5 back to back uploads using PIO.

I am not doing anything crazy with the USB port. Just using it as a serial port. I have done a bunch of tests using two different teensys and I’m seeing what looks like random reboots (random is an assumption) in the middle of the upload when I upload via PIO, but not when I upload using the teensyloader gui in auto-mode and initiating the upload using the button on the teensy.

I have verbose teensy logs that I can share, but they are pretty big and I don’t see a way to upload text files to posts. I am happy to share them with anyone interested. I am seeing some pretty significant differences between the logs I take when uploading using the teensyloader gui, and the logs created when I log an upload using PIO.

For example, this is a selection from a log taken while uploading using the teensyloader gui:

09:00:11.849 (loader): Teensy Loader 1.51, begin program
09:00:11.933 (loader): File “firmware.hex”. 233428 bytes, 22% used
09:00:11.945 (loader): Listening for remote control on port 3149
09:00:11.946 (loader): initialized, showing main window
09:00:12.195 (loader): HID/win32: vid:046D pid:B01E ver:0005
09:00:12.195 (loader): HID/win32: vid:046D pid:C53D ver:4301
09:00:12.196 (loader): HID/win32: vid:046D pid:C53D ver:4301
09:00:12.196 (loader): HID/win32: vid:046D pid:C53D ver:4301
09:00:12.196 (loader): HID/win32: vid:046D pid:C53D ver:4301
09:00:12.197 (loader): HID/win32: vid:046D pid:C53D ver:4301
09:00:12.197 (loader): HID/win32: vid:046D pid:C53D ver:4301
09:00:12.197 (loader): HID/win32: vid:0000 pid:0000 ver:0000
09:00:12.198 (loader): HID/win32: vid:0000 pid:0000 ver:0000
09:00:20.212 (loader): Open File event
09:00:39.809 (loader): File “firmware.hex”. 233428 bytes, 22% used
09:00:51.684 (loader): Device came online, code_size = 1048576
09:00:51.684 (loader): Board is: Teensy 3.6 (MK66FX1M0), version 1.03
09:00:51.715 (loader): File “firmware.hex”. 233428 bytes, 22% used
09:00:51.718 (loader): set background IMG_ONLINE
09:00:51.932 (loader): HID/win32: HidD_GetPreparsedData ok, device still online :slight_smile:
09:01:31.760 (loader): Auto Button event
09:01:31.760 (loader): Auto mode: enabled
09:01:31.790 (loader): File “firmware.hex”. 233428 bytes, 22% used
09:01:31.804 (loader): elf appears to be for Teensy 3.6 (MK66FX1M0) (1048576 bytes)
09:01:31.804 (loader): elf binary data matches hex file
09:01:31.804 (loader): elf file is for Teensy 3.6 (MK66FX1M0)
09:01:31.806 (loader): begin operation
09:01:31.819 (loader): flash, block=0, bs=1024, auto=1
09:01:31.822 (loader): gauge old value = 0
09:01:31.822 (loader): flash, block=1, bs=1024, auto=1
09:01:31.824 (loader): gauge old value = 1
09:01:31.824 (loader): flash, block=2, bs=1024, auto=1
09:01:31.825 (loader): gauge old value = 2
09:01:31.826 (loader): flash, block=3, bs=1024, auto=1
09:01:32.148 (loader): gauge old value = 3
09:01:32.149 (loader): flash, block=4, bs=1024, auto=1
09:01:32.151 (loader): gauge old value = 4
09:01:32.154 (loader): flash, block=5, bs=1024, auto=1
09:01:32.155 (loader): gauge old value = 5
09:01:32.158 (loader): flash, block=6, bs=1024, auto=1

It continues on transferring blocks without issues until it finishes transferring blocks and ends the upload.

End of a teensyloader gui upload:

09:01:34.042 (loader): flash, block=227, bs=1024, auto=1
09:01:34.065 (loader): gauge old value = 227
09:01:34.071 (loader): sending reboot
09:01:34.073 (loader): begin wait_until_offline
09:01:34.190 (loader): offline, waited 2
09:01:34.208 (loader): end operation, total time = 2.401 seconds
09:01:34.225 (loader): set background IMG_REBOOT_OK
09:01:34.226 (loader): redraw timer set, image 14 to show for 1200 ms
09:01:34.268 (loader): HID/win32: vid:046D pid:B01E ver:0005
09:01:34.269 (loader): HID/win32: vid:046D pid:C53D ver:4301
09:01:34.269 (loader): HID/win32: vid:046D pid:C53D ver:4301
09:01:34.269 (loader): HID/win32: vid:046D pid:C53D ver:4301
09:01:34.269 (loader): HID/win32: vid:046D pid:C53D ver:4301
09:01:34.270 (loader): HID/win32: vid:046D pid:C53D ver:4301
09:01:34.270 (loader): HID/win32: vid:046D pid:C53D ver:4301
09:01:34.270 (loader): HID/win32: vid:0000 pid:0000 ver:0000
09:01:34.270 (loader): HID/win32: vid:0000 pid:0000 ver:0000
09:01:35.425 (loader): redraw, image 9

If I upload using PIO I get a log that looks like this:

09:12:59.410 (post_compile 4): Begin, version=1.51, high-res time
09:12:59.411 (loader): remote connection 1316 opened
09:12:59.413 (loader): remote cmd from 1316: “comment: Teensyduino 1.51 - WINDOWS (teensy_post_compile)”
09:12:59.413 (post_compile 4): Sending command: comment: Teensyduino 1.51 - WINDOWS (teensy_post_compile)
09:12:59.414 (loader): remote cmd from 1316: “status”
09:12:59.415 (loader): file changed
09:12:59.448 (loader): File “firmware.hex”. 233428 bytes, 22% used
09:12:59.454 (post_compile 4): Status: 1, 1, 0, 1, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:12:59.454 (post_compile 4): Sending command: dir:C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36
09:12:59.455 (loader): remote cmd from 1316: "dir:C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36"
09:12:59.456 (loader): remote cmd from 1316: “file:firmware.hex”
09:12:59.457 (post_compile 4): Sending command: file:firmware.hex
09:12:59.489 (loader): File “firmware.hex”. 233428 bytes, 22% used
09:12:59.492 (loader): remote cmd from 1316: “status”
09:12:59.498 (post_compile 4): Status: 1, 1, 0, 1, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:12:59.498 (post_compile 4): Disconnect
09:12:59.512 (loader): remote connection 1316 closed
09:12:59.512 (loader): remote connection 1316 opened
09:12:59.512 (post_compile 5): Running teensy_reboot: “C:\Users\email.platformio\packages\tool-teensy\teensy_reboot.exe” teensy_reboot.exe “-board=TEENSY36”
09:12:59.523 (reboot 6): Begin, version=1.51, high-res time
09:12:59.523 (reboot 6): LoadLibrary cfgmgr32 ok
09:12:59.523 (reboot 6): LoadLibrary ntdll ok
09:12:59.523 (reboot 6): found_usb_device, id=\?\usb#vid_16c0&pid_0483#6283920#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
09:12:59.523 (reboot 6): found_usb_device, loc=usb:1C0000/0/0/4/1/1 Port_#0001.Hub_#0013
09:12:59.523 (reboot 6): found_usb_device, hwid=USB\VID_16C0&PID_0483&REV_0277
09:12:59.523 (reboot 6): found_usb_device, devinst=00000004
09:12:59.523 (reboot 6): add: loc=usb:1C0000/0/0/4/1/1, class=Ports, vid=16C0, pid=0483, ver=0277, serial=6283920, dev=\?\usb#vid_16c0&pid_0483#6283920#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
09:12:59.523 (reboot 6): comport_from_devinst_list attempt
09:12:59.523 (reboot 6): found Ports in classguid_list at index=0
09:12:59.523 (reboot 6): port COM11 found from devnode
09:12:59.523 (reboot 6): found_usb_device complete
09:12:59.525 (loader): remote connection 1512 opened
09:12:59.526 (loader): remote cmd from 1512: “show:arduino_attempt_reboot”
09:12:59.527 (reboot 6): found Teensy Loader, version 1.51
09:12:59.527 (reboot 6): Sending command: show:arduino_attempt_reboot
09:12:59.528 (loader): got request to show arduino rebooting message
09:12:59.528 (loader): remote cmd from 1512: “comment: Teensyduino 1.51 - WINDOWS (teensy_reboot)”
09:12:59.528 (loader): remote cmd from 1512: “status”
09:12:59.531 (reboot 6): Sending command: comment: Teensyduino 1.51 - WINDOWS (teensy_reboot)
09:12:59.535 (reboot 6): Status: 1, 1, 0, 1, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:12:59.535 (reboot 6): do_reset (serial) COM11
09:12:59.538 (loader): remote cmd from 1512: “status”
09:12:59.543 (reboot 6): Status: 1, 1, 0, 1, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:12:59.543 (reboot 6): status read, retry 0
09:12:59.652 (loader): remote cmd from 1512: “status”
09:12:59.656 (reboot 6): Status: 1, 1, 0, 1, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:12:59.656 (reboot 6): status read, retry 1
09:12:59.762 (loader): remote cmd from 1512: “status”
09:12:59.764 (reboot 6): Status: 1, 1, 0, 1, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:12:59.764 (reboot 6): status read, retry 2
09:12:59.869 (loader): remote cmd from 1512: “status”
09:12:59.871 (reboot 6): Status: 1, 1, 0, 1, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:12:59.871 (reboot 6): status read, retry 3
09:12:59.972 (loader): remote cmd from 1512: “status”
09:12:59.975 (reboot 6): Status: 1, 1, 0, 1, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:12:59.975 (reboot 6): status read, retry 4
09:13:00.082 (loader): remote cmd from 1512: “status”
09:13:00.082 (loader): Device came online, code_size = 1048576
09:13:00.082 (loader): Board is: Teensy 3.6 (MK66FX1M0), version 1.03
09:13:00.112 (loader): File “firmware.hex”. 233428 bytes, 22% used
09:13:00.122 (loader): set background IMG_ONLINE
09:13:00.152 (loader): File “firmware.hex”. 233428 bytes, 22% used
09:13:00.152 (loader): elf appears to be for Teensy 3.6 (MK66FX1M0) (1048576 bytes)
09:13:00.152 (loader): elf binary data matches hex file
09:13:00.162 (loader): elf file is for Teensy 3.6 (MK66FX1M0)
09:13:00.162 (loader): begin operation
09:13:00.174 (reboot 6): Status: 1, 1, 1, 2, 0, 1, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:00.175 (loader): flash, block=0, bs=1024, auto=1
09:13:00.175 (loader): gauge old value = 0
09:13:00.175 (loader): flash, block=1, bs=1024, auto=1
09:13:00.185 (loader): gauge old value = 1
09:13:00.185 (loader): flash, block=2, bs=1024, auto=1
09:13:00.185 (loader): gauge old value = 2
09:13:00.185 (loader): flash, block=3, bs=1024, auto=1
09:13:00.491 (loader): gauge old value = 3
09:13:00.493 (loader): remote cmd from 1512: “status”
09:13:00.494 (loader): flash, block=4, bs=1024, auto=1
09:13:00.494 (reboot 6): Status: 1, 1, 1, 2, 0, 1, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:00.520 (loader): gauge old value = 4
09:13:00.521 (loader): flash, block=5, bs=1024, auto=1
09:13:00.529 (loader): gauge old value = 5
09:13:00.530 (loader): flash, block=6, bs=1024, auto=1
09:13:00.530 (loader): gauge old value = 6
09:13:00.540 (loader): flash, block=7, bs=1024, auto=1
09:13:00.540 (loader): gauge old value = 7
09:13:00.540 (loader): flash, block=8, bs=1024, auto=1
09:13:00.550 (loader): gauge old value = 8
09:13:00.550 (loader): remote cmd from 1512: “status”
09:13:00.560 (loader): flash, block=9, bs=1024, auto=1
09:13:00.560 (loader): gauge old value = 9
09:13:00.560 (loader): flash, block=10, bs=1024, auto=1
09:13:00.561 (reboot 6): Status: 1, 1, 1, 2, 0, 1, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex

The upload has reboots sprinkled throughout the transfer. Eventually after a few uploads I end up with a log that looks like this:

09:13:31.647 (post_compile 10): Begin, version=1.51, high-res time
09:13:31.647 (loader): remote connection 1488 opened
09:13:31.649 (loader): remote cmd from 1488: “comment: Teensyduino 1.51 - WINDOWS (teensy_post_compile)”
09:13:31.650 (post_compile 10): Sending command: comment: Teensyduino 1.51 - WINDOWS (teensy_post_compile)
09:13:31.650 (loader): remote cmd from 1488: “status”
09:13:31.651 (loader): file changed
09:13:31.684 (loader): File “firmware.hex”. 233428 bytes, 22% used
09:13:31.690 (post_compile 10): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:31.690 (post_compile 10): Sending command: dir:C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36
09:13:31.691 (loader): remote cmd from 1488: "dir:C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36"
09:13:31.693 (post_compile 10): Sending command: file:firmware.hex
09:13:31.693 (loader): remote cmd from 1488: “file:firmware.hex”
09:13:31.725 (loader): File “firmware.hex”. 233428 bytes, 22% used
09:13:31.731 (loader): remote cmd from 1488: “status”
09:13:31.735 (post_compile 10): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:31.735 (post_compile 10): Disconnect
09:13:31.751 (loader): remote connection 1488 closed
09:13:31.751 (loader): remote connection 1488 opened
09:13:31.751 (post_compile 11): Running teensy_reboot: “C:\Users\email.platformio\packages\tool-teensy\teensy_reboot.exe” teensy_reboot.exe “-board=TEENSY36”
09:13:31.769 (reboot 12): Begin, version=1.51, high-res time
09:13:31.769 (reboot 12): LoadLibrary cfgmgr32 ok
09:13:31.769 (reboot 12): LoadLibrary ntdll ok
09:13:31.770 (reboot 12): found_usb_device, id=\?\usb#vid_16c0&pid_0483#6283920#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
09:13:31.770 (reboot 12): found_usb_device, loc=usb:1C0000/0/0/4/1/1 Port_#0001.Hub_#0013
09:13:31.770 (reboot 12): found_usb_device, hwid=USB\VID_16C0&PID_0483&REV_0277
09:13:31.770 (reboot 12): found_usb_device, devinst=00000004
09:13:31.770 (reboot 12): add: loc=usb:1C0000/0/0/4/1/1, class=Ports, vid=16C0, pid=0483, ver=0277, serial=6283920, dev=\?\usb#vid_16c0&pid_0483#6283920#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
09:13:31.770 (reboot 12): comport_from_devinst_list attempt
09:13:31.770 (reboot 12): found Ports in classguid_list at index=0
09:13:31.770 (reboot 12): port COM11 found from devnode
09:13:31.770 (reboot 12): found_usb_device complete
09:13:31.771 (loader): remote connection 1596 opened
09:13:31.771 (loader): remote cmd from 1596: “show:arduino_attempt_reboot”
09:13:31.774 (reboot 12): found Teensy Loader, version 1.51
09:13:31.774 (reboot 12): Sending command: show:arduino_attempt_reboot
09:13:31.775 (loader): got request to show arduino rebooting message
09:13:31.776 (loader): remote cmd from 1596: “comment: Teensyduino 1.51 - WINDOWS (teensy_reboot)”
09:13:31.776 (loader): remote cmd from 1596: “status”
09:13:31.778 (reboot 12): Sending command: comment: Teensyduino 1.51 - WINDOWS (teensy_reboot)
09:13:31.782 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:31.782 (reboot 12): do_reset (serial) COM11
09:13:31.860 (loader): remote cmd from 1596: “status”
09:13:31.871 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:31.871 (reboot 12): status read, retry 0
09:13:31.973 (loader): remote cmd from 1596: “status”
09:13:31.977 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:31.977 (reboot 12): status read, retry 1
09:13:32.090 (loader): remote cmd from 1596: “status”
09:13:32.093 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:32.093 (reboot 12): status read, retry 2
09:13:32.199 (loader): remote cmd from 1596: “status”
09:13:32.201 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:32.201 (reboot 12): status read, retry 3
09:13:32.304 (loader): remote cmd from 1596: “status”
09:13:32.307 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:32.307 (reboot 12): status read, retry 4
09:13:32.424 (loader): remote cmd from 1596: “status”
09:13:32.428 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:32.428 (reboot 12): status read, retry 5
09:13:32.534 (loader): remote cmd from 1596: “status”
09:13:32.537 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:32.537 (reboot 12): status read, retry 6
09:13:32.644 (loader): remote cmd from 1596: “status”
09:13:32.647 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:32.647 (reboot 12): status read, retry 7
09:13:32.750 (loader): remote cmd from 1596: “status”
09:13:32.753 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:32.753 (reboot 12): status read, retry 8
09:13:32.860 (loader): remote cmd from 1596: “status”
09:13:32.863 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:32.863 (reboot 12): status read, retry 9
09:13:32.970 (loader): remote cmd from 1596: “status”
09:13:32.974 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:32.974 (reboot 12): status read, retry 10
09:13:33.077 (loader): remote cmd from 1596: “status”
09:13:33.080 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:33.080 (reboot 12): status read, retry 11
09:13:33.187 (loader): remote cmd from 1596: “status”
09:13:33.189 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:33.189 (reboot 12): status read, retry 12
09:13:33.304 (loader): remote cmd from 1596: “status”
09:13:33.307 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:33.307 (reboot 12): status read, retry 13
09:13:33.413 (loader): remote cmd from 1596: “status”
09:13:33.416 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:33.416 (reboot 12): status read, retry 14
09:13:33.524 (loader): remote cmd from 1596: “status”
09:13:33.527 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:33.527 (reboot 12): status read, retry 15
09:13:33.641 (loader): remote cmd from 1596: “status”
09:13:33.644 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:33.644 (reboot 12): status read, retry 16
09:13:33.750 (loader): remote cmd from 1596: “status”
09:13:33.753 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:33.753 (reboot 12): status read, retry 17
09:13:33.859 (loader): remote cmd from 1596: “status”
09:13:33.862 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:33.862 (reboot 12): status read, retry 18
09:13:33.968 (loader): remote cmd from 1596: “status”
09:13:33.971 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:33.971 (reboot 12): status read, retry 19
09:13:34.077 (loader): remote cmd from 1596: “status”
09:13:34.079 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:34.079 (reboot 12): status read, retry 20
09:13:34.182 (loader): remote cmd from 1596: “status”
09:13:34.185 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:34.185 (reboot 12): status read, retry 21
09:13:34.287 (loader): remote cmd from 1596: “status”
09:13:34.289 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:34.289 (reboot 12): status read, retry 22
09:13:34.391 (loader): remote cmd from 1596: “status”
09:13:34.394 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:34.394 (reboot 12): status read, retry 23
09:13:34.496 (loader): remote cmd from 1596: “status”
09:13:34.498 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:34.498 (reboot 12): status read, retry 24
09:13:34.600 (loader): remote cmd from 1596: “status”
09:13:34.603 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:34.603 (reboot 12): status read, retry 25
09:13:34.705 (loader): remote cmd from 1596: “status”
09:13:34.707 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:34.707 (reboot 12): status read, retry 26
09:13:34.809 (loader): remote cmd from 1596: “status”
09:13:34.812 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:34.812 (reboot 12): status read, retry 27
09:13:34.914 (loader): remote cmd from 1596: “status”
09:13:34.916 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:34.916 (reboot 12): status read, retry 28
09:13:35.028 (loader): remote cmd from 1596: “status”
09:13:35.031 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:35.031 (reboot 12): status read, retry 29
09:13:35.133 (loader): remote cmd from 1596: “status”
09:13:35.136 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:35.136 (reboot 12): status read, retry 30
09:13:35.238 (loader): remote cmd from 1596: “status”
09:13:35.240 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:35.240 (reboot 12): status read, retry 31
09:13:35.342 (loader): remote cmd from 1596: “status”
09:13:35.345 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:35.345 (reboot 12): status read, retry 32
09:13:35.447 (loader): remote cmd from 1596: “status”
09:13:35.449 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:35.449 (reboot 12): status read, retry 33
09:13:35.551 (loader): remote cmd from 1596: “status”
09:13:35.554 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:35.554 (reboot 12): status read, retry 34
09:13:35.666 (loader): remote cmd from 1596: “status”
09:13:35.670 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:35.670 (reboot 12): status read, retry 35
09:13:35.781 (loader): remote cmd from 1596: “status”
09:13:35.783 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:35.783 (reboot 12): status read, retry 36
09:13:35.885 (loader): remote cmd from 1596: “status”
09:13:35.888 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:35.888 (reboot 12): status read, retry 37
09:13:35.990 (loader): remote cmd from 1596: “status”
09:13:35.993 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:35.993 (reboot 12): status read, retry 38
09:13:36.095 (loader): remote cmd from 1596: “status”
09:13:36.097 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:36.097 (reboot 12): status read, retry 39
09:13:36.199 (loader): remote cmd from 1596: “status”
09:13:36.202 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:36.202 (reboot 12): status read, retry 40
09:13:36.304 (loader): remote cmd from 1596: “status”
09:13:36.306 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:36.306 (reboot 12): status read, retry 41
09:13:36.408 (loader): remote cmd from 1596: “status”
09:13:36.411 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:36.411 (reboot 12): status read, retry 42
09:13:36.523 (loader): remote cmd from 1596: “status”
09:13:36.525 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:36.525 (reboot 12): status read, retry 43
09:13:36.627 (loader): remote cmd from 1596: “status”
09:13:36.630 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:36.630 (reboot 12): status read, retry 44
09:13:36.732 (loader): remote cmd from 1596: “status”
09:13:36.734 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:36.734 (reboot 12): status read, retry 45
09:13:36.847 (loader): remote cmd from 1596: “status”
09:13:36.849 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:36.849 (reboot 12): status read, retry 46
09:13:36.951 (loader): remote cmd from 1596: “status”
09:13:36.954 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:36.954 (reboot 12): status read, retry 47
09:13:37.066 (loader): remote cmd from 1596: “status”
09:13:37.068 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:37.068 (reboot 12): status read, retry 48
09:13:37.170 (loader): remote cmd from 1596: “status”
09:13:37.173 (reboot 12): Status: 1, 1, 0, 3, 0, 0, C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36, firmware.hex
09:13:37.173 (reboot 12): status read, retry 49
09:13:37.275 (reboot 12): Teensy did not respond to a USB-based request to automatically reboot.
09:13:37.305 (loader): remote connection 1596 closed
09:13:37.308 (loader): remote connection 1488 closed

This will result in the problem I described. A teensy that is not recognized by Windows 10.

Device Manager:

Device USB\VID_0000&PID_0002\8&16d84b90&0&1 was not migrated due to partial or ambiguous match.

Last Device Instance Id: USB\VID_0000&PID_0002\7&11816842&0&4
Class Guid: {36fc9e60-c465-11cf-8056-444553540000}
Location Path:
Migration Rank: 0xF00000000000F100
Present: false
Status: 0xC0000451

Windows Event Viewer:

Error:

Info:

Warning:

I wanted to note that the timestamp on those messages are from last night, around the time I first saw the error. I have been recreating the problem all morning today, but that event log isn’t being updated. Perhaps that is expected, I don’t look at a lot of windows event logs.

platformio.ini:

[env:teensy36]
platform = teensy
board = teensy36
framework = arduino
upload_protocol = teensy-gui
board_build.f_cpu = 72000000L

This is my verbose upload output for the last upload that caused the problem:

MethodWrapper([“checkprogsize”], [“.pio\build\teensy36\firmware.elf”])
arm-none-eabi-objcopy -O ihex -R .eeprom .pio\build\teensy36\firmware.elf .pio\build\teensy36\firmware.hex
Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
RAM: [= ] 10.4% (used 27152 bytes from 262144 bytes)
Flash: [== ] 22.3% (used 233416 bytes from 1048576 bytes)
.pio\build\teensy36\firmware.elf :

section size addr

.text 226272 0

.fini 4 226272

.ARM.exidx 8 226276

.usbdescriptortable 160 536805376

.dmabuffers 464 536805888

.usbbuffers 864 536806352

.data 7144 536807216

.bss 18520 536814360

.ARM.attributes 48 0

.comment 110 0

.debug_frame 4432 0

Total 258026
([“upload”], [“.pio\build\teensy36\firmware.hex”])
AVAILABLE: jlink, teensy-cli, teensy-gui
CURRENT: upload_protocol = teensy-gui
teensy_post_compile -file=firmware -path=“C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler.pio\build\teensy36” -tools=C:\Users\email.platformio\packages\tool-teensy -board=TEENSY36 -reboot
Teensy did not respond to a USB-based request to enter program mode.
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.

From Troubleshooting common problems with the Teensy USB development board

Windows 7: Unknown Device (Code 43)
Windows “Code 43” is a mystery. Other devices, even Apple iPod, have experienced this problem. The solution seem to be be completely powering down, and if a latop, remove the battery for a few minutes. This same solution has been reported multiple times with success.
This code 43 error is a mystery. It might be related to laptops entering suspend mode? If you have any insight, please contact us!

Pieter Rautenbach found a case where programming the wrong HEX file (compiled for a different chip) causes error 43.

Seems like code 43 is a mystery, so I wanted to share my information and see if anyone had any advice.

Are you running all the latest versions? Try opening a CLI and do a pio platform update teensy and retry.

Hi Max, thanks for your response.

Apparently I was due for some updates:

PS C:\Workspace\3_24_21_Gen3\Gen3_Source_Code\T36_Gen3_Sampler> pio platform update teensy
Platform teensy

Updating teensy 4.6.0 [Updating to 4.12.0]
Platform Manager: Installing teensy @ 4.12.0
Downloading [####################################] 100%
Platform Manager: teensy @ 4.12.0 has been installed!
Tool Manager: toolchain-atmelavr @ 1.50400.190710 is already installed
Tool Manager: toolchain-gccarmnoneeabi @ 1.50401.190816 is already installed
Updating platformio/toolchain-atmelavr 1.50400.190710 @ ~1.50400.0 [Up-to-date]
Updating platformio/toolchain-gccarmnoneeabi 1.50401.190816 @ ~1.50401.0 [Up-to-date]
Updating platformio/tool-teensy 1.151.200304 @ <2 [Updating to 1.152.200516]
Tool Manager: Installing platformio/tool-teensy @ 1.152.200516
Downloading [####################################] 100%
Tool Manager: tool-teensy @ 1.152.200516 has been installed!
Tool Manager: Removing tool-teensy @ 1.151.200304
Tool Manager: tool-teensy @ 1.151.200304 has been removed!
Updating platformio/tool-jlink 1.65200.0 @ ^1.63208.0 [Updating to 1.68801.0]
Tool Manager: Installing platformio/tool-jlink @ 1.68801.0
Downloading [####################################] 100%
Unpacking [####################################] 100%
Tool Manager: tool-jlink @ 1.68801.0 has been installed!
Tool Manager: Removing tool-jlink @ 1.65200.0
Tool Manager: tool-jlink @ 1.65200.0 has been removed!
Tool Manager: Installing platformio/framework-arduinoteensy @ ~1.153.0
Downloading [####################################] 100%
Unpacking [####################################] 100%

I rebooted my machine after that and was able to reproduce the problem after a few uploads. I’m still seeing similar log activity with reboot entries in the middle of block transfers. FWIW my coworker mentioned this was happening to him yesterday while working on the same project. I started the project over a year ago. I am going to see if I can recreate the problem with a new project.

If you have any more advice I am all ears, I will report back if I come up with any new information.

Hm yeah it did update tool-teensy but apparently it hasn’t made a difference. Since you don’t have a problem with Arduino IDE but in PIO, there must be a difference there… Please file a bug in Issues · platformio/platform-teensy · GitHub.

No problem, I’ll head over there in a little bit. While I am here I thought I’d give an update.

I have two USB hubs “Atolla USB 3.0 Hub”. I have a few of these and have never had a problem with them. Both are the same model, bought at the same time. Each are plugged into a USB 3 port on my motherboard.

“USB Hub A” - I am able to do ~25 back to back PIO updates from there without a problem. Teensyloader GUI uploads have always succeeded when I manually load the hex file.

“USB Hub B” - I just moved some stuff around on my desk and started using this hub. While using this hub I can recreate the problem within a few back to back uploads. Teensyloader GUI uploads have always succeeded.

If I plug into a USB 3 port on the front of my PC I can’t recreate the problem.

I will head over to Github and write up a bug report after I try to narrow it down a little more. Thanks for the help so far.

Hmm :confused: Seems like a Windows quirk or a timing bug then. But regerdless, the same versions should produce the same results, so maybe that can be equalized.

Just following up.

This seems to be a problem between windows and a USB connection. I was also able top recreate the problem using the Arduino IDE. If you are having the same problem, using a different USB connection fixed the problem for me. If that doesn’t help, using PIO to build your project and then loading the hex file using the teensyloader program worked for me every time regardless of my USB connection.