Lockable MicroMod Teensy not properly entering bootloader

nool

New member
I have a lockable MicroMod Teensy, which has been successfully locked by successively flashing the fuse write, verify and lock sketches; and my own firmware has been loaded onto it and works properly. However, I can't update the firmware anymore: it's never properly recognized by Teensy loader. For the purposes of troubleshooting, I've put the Teensy inside an ATP carrier board, there's no custom PCB or electronics involved.

When I connect the carrier board to a PC, it powers up properly and runs the currently flashed firmware. The serial port is recognized by Windows and I can communicate with it. When I press the "boot" (program) button on the carrier board, two things happen: the blue STAT LED on the Teensy starts blinking; and Teensy loader shows the chip with a lock next to it for about two seconds before reverting back to the homescreen. It never goes to the "regular" programming screen like it does for all my other (lockable or not) Teensy's I've used so far. After about 25 seconds the process repeats itself: the chip with a lock reappears for two seconds. When I powercycle the Teensy, it properly starts the old firmware again.

Does anybody know what causes this problem, and is there any way I can recover from this?

The verbose log output from Teensy loader is as follows:
Code:
14:15:57.659 (loader): handle 66c
14:15:57.662 (loader): Device came online, code_size = 100
14:15:57.663 (loader): Board is: NXP IMXRT1062 ROM
14:15:57.664 (loader): begin operation
14:15:57.703 (loader): File "<redacted>.ehex", 115713 bytes, and 5536 loader utility
14:15:57.707 (loader): ehex is valid, public key hash: <redacted>
14:15:57.707 (loader): File "<redacted>.ehex". 115713 bytes
14:15:57.767 (loader): set background IMG_ONLINE
14:15:57.774 (loader): nxp_write: success
14:15:57.776 (loader): HAB locked secure mode
14:15:57.778 (loader): sending ehex loader utility, 5536 bytes
14:15:57.780 (loader): nxp_write: success
14:15:57.781 (loader): nxp_write: success
14:15:57.784 (loader): nxp_write: success
14:15:57.785 (loader): nxp_write: success
14:15:57.786 (loader): nxp_write: success
14:15:57.788 (loader): nxp_write: success
14:15:57.789 (loader): nxp_write: success
14:15:57.792 (loader): run it..
14:15:57.793 (loader): nxp_write: success
14:15:57.810 (loader): ehex loader utility sucessfully started
14:15:57.815 (loader): end operation, total time = 0.150 seconds
14:15:57.831 (loader): redraw timer set, image 80 to show for 2000 ms
14:15:57.901 (loader): HID/win32:  vid:03F0 pid:0269 ver:0017  usb:20000/0/0/1/3/5/8
14:15:57.903 (loader): HID/win32:  vid:04F2 pid:3F41 ver:0903  usb:20000/0/0/1/3/2/3
14:15:57.904 (loader): HID/win32:  vid:03F0 pid:0269 ver:0017  usb:20000/0/0/1/3/5/8
14:15:57.906 (loader): HID/win32:  vid:04F2 pid:3F41 ver:0903  usb:20000/0/0/1/3/2/3
14:15:57.908 (loader): HID/win32:  vid:03F0 pid:0269 ver:0017  usb:20000/0/0/1/3/5/8
14:15:57.910 (loader): HID/win32:  vid:03F0 pid:0269 ver:0017  usb:20000/0/0/1/3/5/8
14:15:57.912 (loader): HID/win32:  vid:03F0 pid:0667 ver:0100  usb:20000/0/0/1/3/7/8
14:15:57.913 (loader): HID/win32:  vid:0001 pid:0001 ver:0001
14:15:57.915 (loader): HID/win32:  vid:06CB pid:CE08 ver:3104
14:15:57.917 (loader): HID/win32:  vid:06CB pid:CE08 ver:3104
14:15:57.919 (loader): HID/win32:  vid:03EB pid:2141 ver:0101  usb:20000/0/0/2/3/1/1
14:15:57.921 (loader): HID/win32:  vid:06CB pid:CE08 ver:3104
14:15:57.924 (loader): HID/win32:  vid:8087 pid:0A1E ver:0200
14:15:57.930 (loader): HID/win32:  vid:8087 pid:0A1E ver:0200
14:15:57.933 (loader): HID/win32:  vid:8087 pid:0A1E ver:0200
14:15:57.936 (loader): HID/win32:  vid:8087 pid:0A1E ver:0200
14:15:57.941 (loader): HID/win32:  vid:8087 pid:0A1E ver:0200
14:15:57.945 (loader): HID/win32:  vid:8087 pid:0A1E ver:0200
14:15:57.948 (loader): HID/win32:  vid:8087 pid:0A1E ver:0200
14:15:57.951 (loader): HID/win32:  vid:8087 pid:0A1E ver:0200
14:15:57.954 (loader): HID/win32:  vid:8087 pid:0A1E ver:0200
14:15:59.842 (loader): redraw, image 9

I can see that after I press the program button, the Teensy enumerates over USB as a "NXP SemiConductors SP Blank RT Family" HID device (1FC9:0135 VID:pID). If Teensy loader is active, it only enumerates for a fraction of a second before it disappears and nothing else enumerates again on that port until the ~25 second reboot timeout. When Teensy loader isn't active, it stays in that state forever (and the status LED also doesn't start blinking).
 
Are you sure you're using the same key.pem file as was originally used to write the key before locking?

This behavior looks like what would happen if the new .ehex file is created using a different key.
 
Yes, the .ehex file is signed with the same key as used to lock the Teensy. I can update other Teensy's that I made in the same batch fine.

Nevertheless, to verify that, I tried to flash a .ehex file signed with a different key and I get different behaviour, both on this "broken" Teensy and other working ones: instead of just the chip with a lock, I get a message ".EHEX File Not For This Locked Chip":
teensy-wrong-key-redacted.png
I think it also shows for longer.

For reference, this is the screen I see with the correct .ehex:
teensy-correct-key-redacted.png
 
Back
Top