Teensyduino 1.55 Beta #1

Status
Not open for further replies.
@Tim - so you have to manually upload an encrypted sketch????

Oh by the way TyCommander is going to have to get updated at some point to upload an encrypted sketch I guess.

Yes, to get .eHex - ( as noted above ) - File / Open in tLoader. So yours is not yet 'LOCKED'

Not sure TyCommander will get the 'tech' for encrypt upload? And if exposed and easy enough for Kurt to hack - or @koromix to have time for - it seems involved to handle some of the added bootloader overhead ... maybe.
 
Pinned the UnFused beta - and even closing TLoader before uplaod - then doing IDE Upload - the first thing it does it look at PRIOR file and ID Test the T_4.0 and then BLOCKS UPLOAD with 1062 image ... even though the new upload should have been passing in a fresh .hex.

Same closing TLoader and uploading alternate sketch.

Pinned UnFused beta for use on T_4.0 final beta board to get SD and USB_Host access.

to be clear: This isn't just Button press needed ... even when last upload was .hex that works. But if last upload was .eHex ONLY a Fuse set T_4.0 can allow TLoader to function.

I have not Fused both yet - and pinned the UnFused top be sure I keep them straight.
 
Pinned the UnFused beta - and even closing TLoader before uplaod - then doing IDE Upload - the first thing it does it look at PRIOR file and ID Test the T_4.0 and then BLOCKS UPLOAD with 1062 image ... even though the new upload should have been passing in a fresh .hex.

Same closing TLoader and uploading alternate sketch.

Pinned UnFused beta for use on T_4.0 final beta board to get SD and USB_Host access.

to be clear: This isn't just Button press needed ... even when last upload was .hex that works. But if last upload was .eHex ONLY a Fuse set T_4.0 can allow TLoader to function.

I have not Fused both yet - and pinned the UnFused top be sure I keep them straight.

Yeah I only have the one fusedWrite and unlocked until we get this all confirmed by Paul. Seems like there should be an easier way.
 
So after FuseWrite and VerifyEncrypted buttons the steps have to be to load an encrypted sketch:

Code:
[B]Step 1. Verify sketch

Step 2. File -> Open Hex File -> Arduino Build folder and open ehex file created in Step 1 (Verbose will give you the location)

Step 3. Hit PGM button on the Teensy[/B]
 
Not sure. What I did was open a different sketch with the pem.key file in the Arduino Directory. Compile verbose showed:
Code:
"F:\\arduino-1.8.15\\hardware\\teensy/../tools/teensy_secure" encrypthex TEENSY40 "C:\\Users\\Merli\\AppData\\Local\\Temp\\arduino_build_228995/uncannyEyes_async_st7789_240x240.ino.hex"
No key .pem file found, skipping .ehex encryption

It's always supposed to run teensy_secure to create .ehex if you have key.pem in the right place.

I tried here and couldn't reproduce the problem.

capture4.png
 
Interesting though is that the ehex is smaller than the hex :)

Intel hex is an ascii-only format. You can open the files and look at them with any text editor.

Every line has 11 non-data bytes, plus the newline character(s).

The compiler creates some lines with 32 bytes of binary data (64 ascii chars), other lines with 16 bytes, and others with smaller odd amounts. No matter how much actual binary data, every line has 11 bytes + NL or CR/NL of overhead.

After teensy_secure does its work, it writes the .ehex file with 32 binary data bytes on each line. It adds a 2nd section after the main program. I'll explain in more detail when I start writing the official documentation. Even with the extra section added, for larger programs the total file size often ends up smaller because it's putting 32 binary bytes on every line, so there are a fewer of those 11+NL bytes overhead.
 
It's always supposed to run teensy_secure to create .ehex if you have key.pem in the right place.

I tried here and couldn't reproduce the problem.

@Paul - in Teensy_Loader where filename is shown. With IDE Upload do you see .hex or .ehex?

Here on standard Upload I only ever get .hex - and as shown in Verbose above that seems to be what transfer by default.

Seems the same for Mike - only way to have eHex sent is to manually open the file and select it. Then as noted above p#13 the verbose indicates some hiccups - error and dislikes ELF.
 
So it looks like if there is no valid ehex file in the builder folder then it will just use the .hex, if not it uses the ehex - I think???????

For 1.55-beta2, looks like I need to add more explicit statements about which file Teensy Loader is actually using.

It's giving that info now, but it's not strongly worded and in the verbose info it's mixed together with lots of other messages regarding detection of which board, communication of update from Arduino, etc. The info is lacking a clear and unmistakable message about which file is actually being used.

This is the line which inadequately tells which file Teensy Loader is actually using.

Code:
11:49:01.838 (loader): using encrypted ehex (optional - secure mode not yet locked)

But this line can change into many different messages, like "no valid ehex file, use hex" or "using hex file - Teensy not configured for encryption" depending on the circumstances that caused Teensy Loader to choose the .hex file rather than .ehex.

For 1.55-beta2 I will add a more definitive message.
 
For 1.55-beta2, looks like I need to add more explicit statements about which file Teensy Loader is actually using.

It's giving that info now, but it's not strongly worded and in the verbose info it's mixed together with lots of other messages regarding detection of which board, communication of update from Arduino, etc. The info is lacking a clear and unmistakable message about which file is actually being used.

This is the line which inadequately tells which file Teensy Loader is actually using.

Code:
11:49:01.838 (loader): using encrypted ehex (optional - secure mode not yet locked)

But this line can change into many different messages, like "no valid ehex file, use hex" or "using hex file - Teensy not configured for encryption" depending on the circumstances that caused Teensy Loader to choose the .hex file rather than .ehex.

For 1.55-beta2 I will add a more definitive message.

Cool.

So currently we are running Fuse Set but not Locked, so it defaults to '.hex'
< This is wrong - when there is an eHex it will use it >

If locked it would use '.eHex'

Link to p#13 shows other 'verbose' notes on error when manually selecting .eHex

Also noted p#21 that once .eHex is specified - it refuses ANY 1062 teensy a chance to upload that is not provided with 'Fuses set'. I didn't try with a T_3.x.
 
Last edited:
With IDE Upload do you see .hex or .ehex?

Here on standard Upload I only ever get .hex - and as shown in Verbose above that seems to be what transfer by default.

If you open a .hex file, or if Arduino tells Teensy Loader about a new .hex file, Teensy Loader will automatically look for a matching .ehex files and maybe use it instead of the .hex file.

This is meant to be convenient and automatic, but yes, it is confusing if you want to know which file is actually being used. This is exactly the sort of thing we're looking for in this beta test (well, and also anything which completely bricks a lockable board). For 1.55-beta2 I'll work on making better visible feedback on whether the .ehex or .hex file is actually being used.
 
However, if you open a .ehex file (which can only be done from File > Open - never by Arduino), the reverse is not true. Teensy Loader will only use the .ehex file and not automatically look for a .hex.

But it seems another bug exists (this is still beta, afterall) where explicitly opening a .ehex file and then programming a board which can't use .ehex is causing Teensy Loader to erase and then not program anything. That's definitely wrong behavior. It should know that no .hex file was actually loaded and refuse to start the programming process, because it will always result in an unbootable Teensy which needs a button press to recover.

Another bug I will fix in 1.55-beta2.
 
However, if you open a .ehex file (which can only be done from File > Open - never by Arduino), the reverse is not true. Teensy Loader will only use the .ehex file and not automatically look for a .hex.

But it seems another bug exists (this is still beta, afterall) where explicitly opening a .ehex file and then programming a board which can't use .ehex is causing Teensy Loader to erase and then not program anything. That's definitely wrong behavior. It should know that no .hex file was actually loaded and refuse to start the programming process, because it will always result in an unbootable Teensy which needs a button press to recover.

Another bug I will fix in 1.55-beta2.

Not seen that where starts upload to not Fuse set 1062 Teensy resulting in blanked flash.

Problem is: pushing .eHex as appropriate then swapping Teensy - if not Fuse set 1062 the TLoader locks out until it sees a Fuse set Teensy. Even restarting TLoader it relinks to .eHex and continues blocking even with new sketch upload. The File Open is grayed and there is no way to continue.

Indeed - beta 1 - we are evolving and so is the code.
 
Problem is: pushing .eHex as appropriate then swapping Teensy - if not Fuse set 1062 the TLoader locks out until it sees a Fuse set Teensy. Even restarting TLoader it relinks to .eHex and continues blocking even with new sketch upload. The File Open is grayed and there is no way to continue.

I can't reproduce this. I've tried File > Open on a .ehex file, then swapping boards without fuses set, order boards, etc. Every time I unplug the board, File > Open comes back. Can't find the steps to reproduce a problem where it's not disabled when no hardware is connected.

Can you tell me the exact sequence of clicks and board connects? Maybe also clear the verbose info window (click Log > Clear) and then do the steps, to capture the verbose info for just that sequence of actions?
 
Plug Unlocked but FuseWrite Beta T_4 as only attached Teensy
Open IDE SerMon - Clear Verbose

Upload sketch - TLoader shows it is the .hex version that is uploaded - no problem so far, .eHex is ignored.
Code:
15:44:03.801 (loader): File "C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\Code4Code.ino.hex", 38912 bytes
15:44:03.809 (loader): File "C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\Code4Code.ino.ehex", 38912 bytes, 4960 extra

Loader File Open .eHex
Push Button
All good - seems to have uploaded .eHex:
Code:
15:49:32.874 (loader): Board is: Teensy 4.0 (IMXRT1062), version 1.07
15:49:32.887 (loader): File "C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\Code4Code.ino.ehex", 38912 bytes, 4960 extra

Unplug Fused T_4b
Clear Verbose

Plug in 2nd Beta T_4 : Not yet done 'FuseWrite'
okay.
Clear Verbose

Press Button
TLoader will not work again until it sees T_4 with FuseWrite.
No File / Open, No Upload from IDE
Code:
"T:\\Arduino_1.8.15td155\\hardware\\teensy/../tools/teensy_post_compile" -file=Code4Code.ino "-path=C:\\Users\\Tim\\AppData\\Local\\Temp\\arduino_build_652487" "-tools=T:\\Arduino_1.8.15td155\\hardware\\teensy/../tools/" -board=TEENSY40
Teensy Loader is currently busy with another operation (p).  Please try again in a few seconds, or restart Teensy Loader.
quitexit status 1
Error compiling for board Teensy 4.0.

Verbose since last Clear::
Code:
15:54:54.596 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
15:54:54.598 (ports 2): found_usb_device, id=\\?\usb#vid_16c0&pid_0483#10379960#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
15:54:54.598 (ports 2): found_usb_device, loc=usb:0/140000/0/6/1/4    Port_#0004.Hub_#0008
15:54:54.598 (ports 2): found_usb_device, devinst=00000020
15:54:54.598 (ports 2): found_usb_device, hwid=USB\VID_16C0&PID_0483&REV_0279
15:54:54.598 (ports 2): add: loc=usb:0/140000/0/6/1/4, class=USB, vid=16C0, pid=0483, ver=0279, serial=10379960, dev=\\?\usb#vid_16c0&pid_0483#10379960#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
15:54:54.599 (ports 2):   comport_from_devinst_list attempt
15:54:54.599 (ports 2): found_usb_device complete
15:54:54.600 (ports 2): usb_add: usb:0/140000/0/6/1/4  [no_device] (Teensy 4.0) Serial
15:54:54.600 (ports 2): WM_DEVICECHANGE DBT_DEVICEARRIVAL
15:54:54.624 (ports 2): WM_DEVICECHANGE DBT_DEVICEARRIVAL
15:54:54.625 (ports 2): update_usb_device, devinst list change, old had 1, new has 2
15:54:54.625 (ports 2):   comport_from_devinst_list attempt
15:54:54.625 (ports 2):   found Ports in classguid_list at index=1
15:54:54.625 (ports 2):   port COM8 found from devnode
15:54:54.625 (ports 2): usb_add: usb:0/140000/0/6/1/4  COM8 (Teensy 4.0) Serial
15:54:54.868 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
15:54:54.868 (ports 2): nothing new, skipping HID & Ports enum
15:54:54.875 (serialmon 82): Begin, version=1.55-beta1, high-res time
15:54:54.875 (serialmon 82): listening for location: usb:0/140000/0/6/1/4
15:54:54.875 (serialmon 82): LoadLibrary cfgmgr32 ok
15:54:54.875 (serialmon 82): LoadLibrary ntdll ok
15:54:54.880 (serialmon 82): callback 0024
15:54:54.880 (serialmon 82): callback 0081
15:54:54.883 (serialmon 82): callback 0083
15:54:54.883 (serialmon 82): hWnd = 9834842
15:54:54.883 (serialmon 82): loop stdin, ready=262143
15:54:54.886 (serialmon 82): found_usb_device, id=\\?\usb#vid_16c0&pid_0483#10379960#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
15:54:54.886 (serialmon 82): found_usb_device, loc=usb:0/140000/0/6/1/4    Port_#0004.Hub_#0008
15:54:54.886 (serialmon 82): found_usb_device, hwid=USB\VID_16C0&PID_0483&REV_0279
15:54:54.886 (serialmon 82): found_usb_device, devinst=00000005
15:54:54.886 (serialmon 82): add: loc=usb:0/140000/0/6/1/4, class=USB, vid=16C0, pid=0483, ver=0279, serial=10379960, dev=\\?\usb#vid_16c0&pid_0483#10379960#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
15:54:54.886 (serialmon 82):   comport_from_devinst_list attempt
15:54:54.886 (serialmon 82):   found Ports in classguid_list at index=1
15:54:54.886 (serialmon 82):   port COM8 found from devnode
15:54:54.886 (serialmon 82): found_usb_device complete
15:54:54.890 (serialmon 82): usb_add: usb:0/140000/0/6/1/4
15:54:54.890 (serialmon 82): translate "COM8" -> "\\.\COM8"
15:54:54.948 (serialmon 82): GetDefaultCommConfig success
15:54:55.006 (serialmon 82): SetDefaultCommConfig success
15:54:55.006 (serialmon 82): Opened \\.\COM8 Serial
15:54:55.009 (ports 2): callback 001A
15:54:55.059 (loader): remote connection 2624 opened
15:54:55.074 (serialmon 82): callback 001A
15:54:56.983 (serialmon 82): teensy read ov error
15:54:56.983 (serialmon 82): teensy read error
15:54:56.997 (serialmon 82): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
15:54:56.997 (serialmon 82): remove: loc=usb:0/140000/0/6/1/4
15:54:56.997 (serialmon 82): usb_remove: usb:0/140000/0/6/1/4
15:54:56.997 (serialmon 82): Disconnect \\.\COM8
15:54:56.998 (serialmon 82): nothing new, skipping HID & Ports enum
15:54:57.037 (ports 2): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
15:54:57.038 (ports 2): remove: loc=usb:0/140000/0/6/1/4
15:54:57.038 (ports 2): usb_remove: usb:0/140000/0/6/1/4
15:54:57.038 (ports 2): nothing new, skipping HID & Ports enum
15:54:57.038 (serialmon 82): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
15:54:57.045 (serialmon 82): nothing new, skipping HID & Ports enum
15:54:57.062 (serialmon 82): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
15:54:57.062 (serialmon 82): nothing new, skipping HID & Ports enum
15:54:57.080 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
15:54:57.080 (ports 2): nothing new, skipping HID & Ports enum
15:54:57.109 (ports 2): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
15:54:57.110 (ports 2): nothing new, skipping HID & Ports enum
15:54:57.495 (serialmon 82): WM_DEVICECHANGE DBT_DEVICEARRIVAL
15:54:57.496 (ports 2): WM_DEVICECHANGE DBT_DEVICEARRIVAL
15:54:57.496 (serialmon 82): found_usb_device, id=\\?\usb#vid_16c0&pid_0478#000fd6ac#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
15:54:57.496 (serialmon 82): found_usb_device, loc=usb:0/140000/0/6/1/4    Port_#0004.Hub_#0008
15:54:57.496 (serialmon 82): found_usb_device, hwid=USB\VID_16C0&PID_0478&REV_0107
15:54:57.496 (serialmon 82): found_usb_device, devinst=00000019
15:54:57.496 (serialmon 82): add: loc=usb:0/140000/0/6/1/4, class=HID, vid=16C0, pid=0478, ver=0107, serial=000fd6ac, dev=\\?\usb#vid_16c0&pid_0478#000fd6ac#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
15:54:57.496 (serialmon 82): hiddev_from_devinst_list: iface=0
15:54:57.497 (serialmon 82): found_usb_device complete
15:54:57.497 (serialmon 82): usb_add: usb:0/140000/0/6/1/4
15:54:57.497 (serialmon 82): ignoring partial USB device discovery (Windows XP issue?)
15:54:57.500 (ports 2): found_usb_device, id=\\?\usb#vid_16c0&pid_0478#000fd6ac#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
15:54:57.500 (ports 2): found_usb_device, loc=usb:0/140000/0/6/1/4    Port_#0004.Hub_#0008
15:54:57.500 (ports 2): found_usb_device, hwid=USB\VID_16C0&PID_0478&REV_0107
15:54:57.500 (ports 2): found_usb_device, devinst=00000022
15:54:57.500 (ports 2): add: loc=usb:0/140000/0/6/1/4, class=HID, vid=16C0, pid=0478, ver=0107, serial=000fd6ac, dev=\\?\usb#vid_16c0&pid_0478#000fd6ac#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
15:54:57.500 (ports 2): hiddev_from_devinst_list: iface=0
15:54:57.501 (ports 2): found_usb_device complete
15:54:57.501 (ports 2): usb_add: usb:0/140000/0/6/1/4  [no_device] (Teensy 4.0) Bootloader
15:54:57.604 (loader): encryption is possible on this Teensy, but not yet configured
15:54:57.611 (loader): Device came online, code_size = 2031616
15:54:57.624 (loader): Board is: Teensy 4.0 (IMXRT1062), version 1.07
15:54:57.643 (loader): File "C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\Code4Code.ino.ehex", 38912 bytes, 4960 extra
15:54:57.651 (loader): ehex is valid, key hash: 85A79CC1 B7C7F866 7F5BB3ED 0F9C9BA5 B4149EE2 72846D35 86B63863 B0699942
15:54:57.758 (serialmon 82): retry device discovery (Windows XP workaround)
15:54:57.758 (serialmon 82): update_usb_device, devinst list change, old had 1, new has 2
15:54:57.758 (serialmon 82): hiddev_from_devinst_list: iface=0
15:54:57.759 (serialmon 82): hid, found devinst=0000001A
15:54:57.760 (serialmon 82): usb_add: usb:0/140000/0/6/1/4
15:54:57.760 (serialmon 82): ignoring partial USB device discovery (Windows XP issue?)
15:54:57.798 (loader): set background IMG_ONLINE
15:54:57.815 (loader): File "C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\Code4Code.ino.ehex", 38912 bytes, 4960 extra
15:54:57.823 (loader): ehex is valid, key hash: 85A79CC1 B7C7F866 7F5BB3ED 0F9C9BA5 B4149EE2 72846D35 86B63863 B0699942
15:54:57.986 (loader): elf file is for Unknown Board
15:54:57.993 (loader): using hex file - Teensy not configured for encryption
15:54:58.022 (serialmon 82): retry device discovery (Windows XP workaround)
15:54:58.023 (serialmon 82): hid, found devinst=0000001A
15:54:58.048 (loader): begin operation
15:54:58.106 (loader): flash, block=0, bs=1024, auto=1
15:54:58.124 (loader): sending reboot
15:54:58.140 (loader): begin wait_until_offline
15:54:58.278 (serialmon 82): retry device discovery (Windows XP workaround)
15:54:58.279 (serialmon 82): hid, found devinst=0000001A
15:54:58.318 (ports 2): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
15:54:58.321 (serialmon 82): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
15:54:58.321 (ports 2): remove: loc=usb:0/140000/0/6/1/4
15:54:58.321 (ports 2): usb_remove: usb:0/140000/0/6/1/4
15:54:58.321 (ports 2): nothing new, skipping HID & Ports enum
15:54:58.321 (serialmon 82): remove: loc=usb:0/140000/0/6/1/4
15:54:58.321 (serialmon 82): usb_remove: usb:0/140000/0/6/1/4
15:54:58.321 (serialmon 82): nothing new, skipping HID & Ports enum
15:54:58.340 (loader): offline, waited 3
15:54:58.347 (loader): end operation, total time = 0.292 seconds
15:54:58.354 (loader): set background IMG_REBOOT_OK
15:54:58.370 (loader): redraw timer set, image 14 to show for 1200 ms
15:54:58.405 (loader): HID/win32:  vid:046D pid:C52B ver:1211
15:54:58.414 (loader): HID/win32:  vid:046D pid:C52B ver:1211
15:54:58.421 (loader): HID/win32:  vid:046D pid:C52B ver:1211
15:54:58.428 (loader): HID/win32:  vid:046D pid:C52B ver:1211
15:54:58.435 (loader): HID/win32:  vid:046D pid:C52B ver:1211
15:54:58.441 (loader): HID/win32:  vid:046D pid:C52B ver:1211
15:54:58.448 (loader): HID/win32:  vid:046D pid:C52B ver:1211
15:54:58.455 (loader): HID/win32:  vid:046D pid:C52B ver:1211
15:54:58.577 (serialmon 82): retry device discovery (Windows XP workaround)
15:54:58.578 (serialmon 82): nothing new, skipping HID & Ports enum
15:54:58.645 (ports 2): WM_DEVICECHANGE DBT_DEVICEARRIVAL
15:54:58.645 (ports 2): nothing new, skipping HID & Ports enum
15:54:58.649 (serialmon 82): WM_DEVICECHANGE DBT_DEVICEARRIVAL
15:54:58.658 (serialmon 82): nothing new, skipping HID & Ports enum
15:54:58.817 (loader): handle c90
15:54:58.824 (loader): HID/win32: HidD_GetPreparsedData ok
15:54:58.833 (loader):  security: 03  56 78 78 56
15:54:58.839 (loader):  response: 04  12 8A 8A 12
15:54:58.846 (loader): nxp_write_register32 success, 56787856 128a8a12
15:54:58.853 (loader): Device came online, code_size = 100
15:54:58.860 (loader): Board is: NXP IMXRT1062 ROM
15:54:58.867 (loader): begin operation
15:54:58.883 (loader): File "C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\Code4Code.ino.ehex", 38912 bytes, 4960 extra
15:54:58.891 (loader): ehex is valid, key hash: 85A79CC1 B7C7F866 7F5BB3ED 0F9C9BA5 B4149EE2 72846D35 86B63863 B0699942
15:54:58.926 (serialmon 82): retry device discovery (Windows XP workaround)
15:54:58.926 (serialmon 82): nothing new, skipping HID & Ports enum
15:54:59.036 (loader): reboot too soon timer still running, oh no!
15:54:59.065 (loader): set background IMG_ONLINE
15:54:59.098 (loader): state STATE_NXP_BEGIN
15:54:59.107 (loader):  security: 03  56 78 78 56
15:54:59.113 (loader):  response: 04  12 8A 8A 12
15:54:59.121 (loader):  security: 03  56 78 78 56
15:54:59.127 (loader):  response: 04  18 B0 08 00
15:54:59.132 (loader): HAB open mode, bootcfg=8B018
15:54:59.138 (loader): state STATE_NXP_OPEN
15:54:59.181 (serialmon 82): retry device discovery (Windows XP workaround)
15:54:59.182 (serialmon 82): nothing new, skipping HID & Ports enum
15:54:59.436 (serialmon 82): retry device discovery (Windows XP workaround)
15:54:59.436 (serialmon 82): nothing new, skipping HID & Ports enum
15:54:59.692 (serialmon 82): retry device discovery (Windows XP workaround)
15:54:59.692 (serialmon 82): nothing new, skipping HID & Ports enum
15:54:59.948 (serialmon 82): retry device discovery (Windows XP workaround)
15:54:59.948 (serialmon 82): nothing new, skipping HID & Ports enum
15:54:59.996 (ports 2): purge, name=[no_device] (Teensy 4.0) Bootloader, loc=usb:0/140000/0/6/1/4, age=1.675 sec
15:55:00.203 (serialmon 82): retry device discovery (Windows XP workaround)
15:55:00.203 (serialmon 82): nothing new, skipping HID & Ports enum
15:55:00.457 (serialmon 82): retry device discovery (Windows XP workaround)
15:55:00.457 (serialmon 82): nothing new, skipping HID & Ports enum
15:55:00.712 (serialmon 82): retry device discovery (Windows XP workaround)
15:55:00.712 (serialmon 82): nothing new, skipping HID & Ports enum
15:55:00.845 (loader): remote connection 2624 closed
15:55:01.407 (ports 2): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
15:55:01.408 (ports 2): nothing new, skipping HID & Ports enum
15:56:55.964 (post_compile 83): Begin, version=1.55-beta1, high-res time
15:56:55.969 (loader): remote connection 3140 opened
15:56:55.974 (loader): remote cmd from 3140: "comment: Teensyduino 1.55-beta1 - WINDOWS (teensy_post_compile)"
15:56:55.975 (post_compile 83): Sending command: comment: Teensyduino 1.55-beta1 - WINDOWS (teensy_post_compile)
15:56:55.983 (loader): remote cmd from 3140: "status"
15:56:55.997 (post_compile 83): Status: 1, 0, 1, 31, 0, 12, C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\, Code4Code.ino.ehex
15:56:56.052 (loader): remote cmd from 3140: "status"
15:56:56.059 (post_compile 83): Status: 1, 0, 1, 31, 0, 12, C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\, Code4Code.ino.ehex
15:56:56.114 (loader): remote cmd from 3140: "status"
15:56:56.119 (post_compile 83): Status: 1, 0, 1, 31, 0, 12, C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\, Code4Code.ino.ehex
15:56:56.177 (loader): remote cmd from 3140: "status"
15:56:56.182 (post_compile 83): Status: 1, 0, 1, 31, 0, 12, C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\, Code4Code.ino.ehex
15:56:56.239 (loader): remote cmd from 3140: "status"
15:56:56.245 (post_compile 83): Status: 1, 0, 1, 31, 0, 12, C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\, Code4Code.ino.ehex
15:56:56.301 (loader): remote cmd from 3140: "status"
15:56:56.306 (post_compile 83): Status: 1, 0, 1, 31, 0, 12, C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\, Code4Code.ino.ehex
15:56:56.363 (post_compile 83): Teensy Loader is currently busy with another operation (p).
15:56:56.363 (post_compile 83): quit
15:56:56.380 (loader): remote connection 3140 closed
15:56:56.542 (serialmon 84): Begin, version=1.55-beta1, high-res time
15:56:56.542 (serialmon 84): listening for location: usb:0/140000/0/6/1/4
15:56:56.542 (serialmon 84): LoadLibrary cfgmgr32 ok
15:56:56.542 (serialmon 84): LoadLibrary ntdll ok
15:56:56.547 (serialmon 84): callback 0024
15:56:56.547 (serialmon 84): callback 0081
15:56:56.549 (serialmon 84): callback 0083
15:56:56.550 (serialmon 84): hWnd = 9506296
15:56:56.551 (serialmon 84): loop stdin, ready=262143
15:56:56.556 (serialmon 84): nothing new, skipping HID & Ports enum
15:56:56.561 (loader): remote connection 3140 opened
15:56:56.639 (loader): remote connection 3140 closed

unfused_eHex.png
 
Correction: Indeed that T4b with no fuses set is BLANKED

This is as suggested, but wasn't observed before.

And confirmed :
> Close TLoader
> IDE Upload
> TLoader appears and goes into Locked state with this in Verbose:
Code:
16:03:35.765 (post_compile 1): Begin, version=1.55-beta1, high-res time
16:03:36.023 (loader): Teensy Loader 1.55-beta1, begin program
16:03:36.113 (loader): File "C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\Code4Code.ino.ehex", 38912 bytes, 4960 extra
16:03:36.114 (loader): ehex is valid, key hash: 85A79CC1 B7C7F866 7F5BB3ED 0F9C9BA5 B4149EE2 72846D35 86B63863 B0699942
16:03:36.289 (loader): Listening for remote control on port 3149
16:03:36.289 (loader): initialized, showing main window
16:03:36.364 (loader): remote connection 1320 opened
16:03:36.364 (loader): remote cmd from 1320: "comment: Teensyduino 1.55-beta1 - WINDOWS (teensy_post_compile)"
16:03:36.365 (post_compile 1): Sending command: comment: Teensyduino 1.55-beta1 - WINDOWS (teensy_post_compile)
16:03:36.365 (loader): remote cmd from 1320: "status"
16:03:36.372 (loader): HID/win32:  vid:046D pid:C52B ver:1211
16:03:36.372 (loader): HID/win32:  vid:046D pid:C52B ver:1211
16:03:36.373 (loader): HID/win32:  vid:046D pid:C52B ver:1211
16:03:36.373 (loader): HID/win32:  vid:046D pid:C52B ver:1211
16:03:36.373 (loader): HID/win32:  vid:046D pid:C52B ver:1211
16:03:36.373 (loader): HID/win32:  vid:046D pid:C52B ver:1211
16:03:36.374 (loader): HID/win32:  vid:046D pid:C52B ver:1211
16:03:36.374 (loader): HID/win32:  vid:046D pid:C52B ver:1211
16:03:36.508 (loader): HID/win32:  vid:1FC9 pid:0135 ver:0101
16:03:36.508 (loader): handle 55c
16:03:36.508 (loader): HID/win32: HidD_GetPreparsedData ok
16:03:36.510 (loader):  security: 03  56 78 78 56
16:03:36.511 (loader):  response: 04  12 8A 8A 12
16:03:36.512 (loader): nxp_write_register32 success, 56787856 128a8a12
16:03:36.512 (loader): Device came online, code_size = 100
16:03:36.512 (loader): Board is: NXP IMXRT1062 ROM
16:03:36.512 (loader): begin operation
16:03:36.520 (loader): File "C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\Code4Code.ino.ehex", 38912 bytes, 4960 extra
16:03:36.520 (loader): ehex is valid, key hash: 85A79CC1 B7C7F866 7F5BB3ED 0F9C9BA5 B4149EE2 72846D35 86B63863 B0699942
16:03:36.660 (loader): set background IMG_ONLINE
16:03:36.662 (post_compile 1): Status: 1, 0, 1, 1, 0, 8, C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\, Code4Code.ino.ehex
16:03:36.663 (loader): state STATE_NXP_BEGIN
16:03:36.664 (loader):  security: 03  56 78 78 56
16:03:36.665 (loader):  response: 04  12 8A 8A 12
16:03:36.667 (loader):  security: 03  56 78 78 56
16:03:36.668 (loader):  response: 04  18 B0 08 00
16:03:36.669 (loader): HAB open mode, bootcfg=8B018
16:03:36.669 (loader): state STATE_NXP_OPEN
16:03:36.669 (loader): HID/win32: HidD_GetPreparsedData ok, device still online :-)
16:03:36.723 (loader): remote cmd from 1320: "status"
16:03:36.724 (post_compile 1): Status: 1, 0, 1, 1, 0, 12, C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\, Code4Code.ino.ehex
16:03:36.785 (loader): remote cmd from 1320: "status"
16:03:36.785 (post_compile 1): Status: 1, 0, 1, 1, 0, 12, C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\, Code4Code.ino.ehex
16:03:36.847 (loader): remote cmd from 1320: "status"
16:03:36.848 (post_compile 1): Status: 1, 0, 1, 1, 0, 12, C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\, Code4Code.ino.ehex
16:03:36.909 (loader): remote cmd from 1320: "status"
16:03:36.910 (post_compile 1): Status: 1, 0, 1, 1, 0, 12, C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\, Code4Code.ino.ehex
16:03:36.971 (loader): remote cmd from 1320: "status"
16:03:36.972 (post_compile 1): Status: 1, 0, 1, 1, 0, 12, C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\, Code4Code.ino.ehex
16:03:37.034 (post_compile 1): Teensy Loader is currently busy with another operation (p).
16:03:37.034 (post_compile 1): quit
16:03:37.037 (loader): remote connection 1320 closed
16:03:37.234 (serialmon 2): Begin, version=1.55-beta1, high-res time
16:03:37.234 (serialmon 2): listening for location: usb:0/140000/0/6/1/4
16:03:37.234 (serialmon 2): LoadLibrary cfgmgr32 ok
16:03:37.234 (serialmon 2): LoadLibrary ntdll ok
16:03:37.239 (serialmon 2): callback 0024
16:03:37.239 (serialmon 2): callback 0081
16:03:37.243 (serialmon 2): callback 0083
16:03:37.243 (serialmon 2): hWnd = 2364060
16:03:37.243 (serialmon 2): loop stdin, ready=262143
16:03:37.248 (serialmon 2): nothing new, skipping HID & Ports enum
16:03:37.252 (loader): remote connection 1376 opened
16:03:37.367 (loader): remote connection 1376 closed
16:04:22.279 (loader): Verbose Info event

And again this in the IDE console:
Code:
"T:\\Arduino_1.8.15td155\\hardware\\teensy/../tools/teensy_post_compile" -file=Code4Code.ino "-path=C:\\Users\\Tim\\AppData\\Local\\Temp\\arduino_build_652487" "-tools=T:\\Arduino_1.8.15td155\\hardware\\teensy/../tools/" -board=TEENSY40
Opening Teensy Loader...
Teensy Loader is currently busy with another operation (p).  Please try again in a few seconds, or restart Teensy Loader.
quitexit status 1
Error compiling for board Teensy 4.0.

<edit> Even plugging FUSED T4b and then selecting the .HEX file - then plugging the UNfused T4B returns to this locked state. Requires upload of a .hex to a FUSED T4b to clear this it seems?
Code:
16:01:32.773 (ports 3): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
16:01:32.779 (ports 3): nothing new, skipping HID & Ports enum
16:01:32.785 (ports 3): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
16:01:32.786 (ports 3): nothing new, skipping HID & Ports enum
16:01:34.942 (ports 3): WM_DEVICECHANGE DBT_DEVICEARRIVAL
16:01:34.944 (ports 3): nothing new, skipping HID & Ports enum
16:01:35.125 (ports 3): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
16:01:35.126 (ports 3): nothing new, skipping HID & Ports enum
16:01:39.130 (ports 3): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
16:01:39.131 (ports 3): nothing new, skipping HID & Ports enum
16:06:52.979 (ports 3): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
16:06:52.985 (loader): end operation, total time = 196.472 seconds
16:06:52.990 (loader): remote connection 808 opened
16:06:52.991 (ports 3): nothing new, skipping HID & Ports enum
16:06:52.998 (loader): HID/win32:  vid:046D pid:C52B ver:1211
16:06:53.000 (loader): HID/win32:  vid:046D pid:C52B ver:1211
16:06:53.001 (loader): HID/win32:  vid:046D pid:C52B ver:1211
16:06:53.001 (ports 3): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
16:06:53.001 (ports 3): nothing new, skipping HID & Ports enum
16:06:53.004 (loader): HID/win32:  vid:046D pid:C52B ver:1211
16:06:53.005 (loader): HID/win32:  vid:046D pid:C52B ver:1211
16:06:53.007 (loader): HID/win32:  vid:046D pid:C52B ver:1211
16:06:53.009 (loader): HID/win32:  vid:046D pid:C52B ver:1211
16:06:53.011 (loader): HID/win32:  vid:046D pid:C52B ver:1211
16:06:58.725 (ports 3): WM_DEVICECHANGE DBT_DEVICEARRIVAL
16:06:58.726 (ports 3): found_usb_device, id=\\?\usb#vid_16c0&pid_0483#10379970#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
16:06:58.726 (ports 3): found_usb_device, loc=usb:0/140000/0/6/1/4    Port_#0004.Hub_#0008
16:06:58.726 (ports 3): found_usb_device, hwid=USB\VID_16C0&PID_0483&REV_0279
16:06:58.726 (ports 3): found_usb_device, devinst=00000005
16:06:58.726 (ports 3): add: loc=usb:0/140000/0/6/1/4, class=USB, vid=16C0, pid=0483, ver=0279, serial=10379970, dev=\\?\usb#vid_16c0&pid_0483#10379970#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
16:06:58.727 (ports 3):   comport_from_devinst_list attempt
16:06:58.727 (ports 3): found_usb_device complete
16:06:58.729 (ports 3): usb_add: usb:0/140000/0/6/1/4  [no_device] (Teensy 4.0) Serial
16:06:58.910 (serialmon 4): Begin, version=1.55-beta1, high-res time
16:06:58.910 (serialmon 4): listening for location: usb:0/140000/0/6/1/4
16:06:58.910 (serialmon 4): LoadLibrary cfgmgr32 ok
16:06:58.910 (serialmon 4): LoadLibrary ntdll ok
16:06:58.915 (serialmon 4): callback 0024
16:06:58.915 (serialmon 4): callback 0081
16:06:58.918 (serialmon 4): callback 0083
16:06:58.919 (serialmon 4): hWnd = 3281872
16:06:58.919 (serialmon 4): loop stdin, ready=262143
16:06:58.922 (serialmon 4): found_usb_device, id=\\?\usb#vid_16c0&pid_0483#10379970#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
16:06:58.922 (serialmon 4): found_usb_device, loc=usb:0/140000/0/6/1/4    Port_#0004.Hub_#0008
16:06:58.922 (serialmon 4): found_usb_device, hwid=USB\VID_16C0&PID_0483&REV_0279
16:06:58.922 (serialmon 4): found_usb_device, devinst=00000005
16:06:58.922 (serialmon 4): add: loc=usb:0/140000/0/6/1/4, class=USB, vid=16C0, pid=0483, ver=0279, serial=10379970, dev=\\?\usb#vid_16c0&pid_0483#10379970#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
16:06:58.922 (serialmon 4):   comport_from_devinst_list attempt
16:06:58.922 (serialmon 4):   found Ports in classguid_list at index=1
16:06:58.922 (serialmon 4):   port COM9 found from devnode
16:06:58.922 (serialmon 4): found_usb_device complete
16:06:58.926 (serialmon 4): usb_add: usb:0/140000/0/6/1/4
16:06:58.926 (serialmon 4): translate "COM9" -> "\\.\COM9"
16:06:58.999 (serialmon 4): GetDefaultCommConfig success
16:06:59.071 (serialmon 4): SetDefaultCommConfig success
16:06:59.071 (serialmon 4): Opened \\.\COM9 Serial
16:06:59.075 (ports 3): callback 001A
16:06:59.158 (ports 3): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
16:06:59.159 (ports 3): WM_DEVICECHANGE DBT_DEVICEARRIVAL
16:06:59.165 (ports 3): update_usb_device, devinst list change, old had 1, new has 2
16:06:59.165 (ports 3):   comport_from_devinst_list attempt
16:06:59.165 (ports 3):   found Ports in classguid_list at index=1
16:06:59.165 (ports 3):   port COM9 found from devnode
16:06:59.166 (ports 3): usb_add: usb:0/140000/0/6/1/4  COM9 (Teensy 4.0) Serial
16:06:59.183 (loader): remote connection 1320 opened
16:06:59.215 (serialmon 4): callback 001A
16:07:00.588 (serialmon 4): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
16:07:00.589 (serialmon 4): nothing new, skipping HID & Ports enum
16:07:00.675 (ports 3): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
16:07:00.677 (ports 3): nothing new, skipping HID & Ports enum
16:07:04.633 (loader): Open File event
16:07:07.201 (loader): File "C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\Code4Code.ino.hex", 38912 bytes
16:07:07.212 (loader): File "C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\Code4Code.ino.ehex", 38912 bytes, 4960 extra
16:07:07.218 (loader): ehex is valid, key hash: 85A79CC1 B7C7F866 7F5BB3ED 0F9C9BA5 B4149EE2 72846D35 86B63863 B0699942
16:07:10.689 (serialmon 4): teensy read ov error
16:07:10.689 (serialmon 4): teensy read error
16:07:10.694 (ports 3): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
16:07:10.695 (serialmon 4): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
16:07:10.696 (ports 3): remove: loc=usb:0/140000/0/6/1/4
16:07:10.696 (ports 3): usb_remove: usb:0/140000/0/6/1/4
16:07:10.696 (ports 3): nothing new, skipping HID & Ports enum
16:07:10.697 (serialmon 4): remove: loc=usb:0/140000/0/6/1/4
16:07:10.697 (serialmon 4): usb_remove: usb:0/140000/0/6/1/4
16:07:10.697 (serialmon 4): Disconnect \\.\COM9
16:07:10.697 (serialmon 4): nothing new, skipping HID & Ports enum
16:07:10.777 (serialmon 4): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
16:07:10.778 (serialmon 4): nothing new, skipping HID & Ports enum
16:07:10.778 (serialmon 4): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
16:07:10.778 (serialmon 4): nothing new, skipping HID & Ports enum
16:07:10.819 (ports 3): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
16:07:10.820 (ports 3): nothing new, skipping HID & Ports enum
16:07:10.820 (ports 3): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
16:07:10.820 (ports 3): nothing new, skipping HID & Ports enum
16:07:12.366 (ports 3): purge, name=COM9 (Teensy 4.0) Serial, loc=usb:0/140000/0/6/1/4, age=1.671 sec
16:07:12.813 (loader): remote connection 1320 closed
16:07:20.573 (ports 3): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
16:07:20.574 (ports 3): nothing new, skipping HID & Ports enum
16:07:20.575 (ports 3): WM_DEVICECHANGE DBT_DEVICEARRIVAL
16:07:20.576 (ports 3): nothing new, skipping HID & Ports enum
16:07:20.617 (loader): handle f0c
16:07:20.622 (loader): HID/win32: HidD_GetPreparsedData ok
16:07:20.629 (loader):  security: 03  56 78 78 56
16:07:20.634 (loader):  response: 04  12 8A 8A 12
16:07:20.639 (loader): nxp_write_register32 success, 56787856 128a8a12
16:07:20.644 (loader): Device came online, code_size = 100
16:07:20.648 (loader): Board is: NXP IMXRT1062 ROM
16:07:20.653 (loader): begin operation
16:07:20.667 (loader): File "C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\Code4Code.ino.hex", 38912 bytes
16:07:20.677 (loader): File "C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\Code4Code.ino.ehex", 38912 bytes, 4960 extra
16:07:20.682 (loader): ehex is valid, key hash: 85A79CC1 B7C7F866 7F5BB3ED 0F9C9BA5 B4149EE2 72846D35 86B63863 B0699942
16:07:20.686 (loader): set background IMG_ONLINE
16:07:20.697 (loader): state STATE_NXP_BEGIN
16:07:20.705 (loader):  security: 03  56 78 78 56
16:07:20.709 (loader):  response: 04  12 8A 8A 12
16:07:20.716 (loader):  security: 03  56 78 78 56
16:07:20.720 (loader):  response: 04  18 B0 08 00
16:07:20.727 (loader): HAB open mode, bootcfg=8B018
16:07:20.733 (loader): state STATE_NXP_OPEN
16:07:20.743 (ports 3): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
16:07:20.744 (ports 3): nothing new, skipping HID & Ports enum
16:07:36.935 (post_compile 5): Begin, version=1.55-beta1, high-res time
16:07:36.939 (loader): remote connection 1320 opened
16:07:36.944 (loader): remote cmd from 1320: "comment: Teensyduino 1.55-beta1 - WINDOWS (teensy_post_compile)"
16:07:36.945 (post_compile 5): Sending command: comment: Teensyduino 1.55-beta1 - WINDOWS (teensy_post_compile)
16:07:36.949 (loader): remote cmd from 1320: "status"
16:07:36.954 (post_compile 5): Status: 1, 0, 1, 2, 0, 12, C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\, Code4Code.ino.hex
16:07:37.017 (loader): remote cmd from 1320: "status"
16:07:37.022 (post_compile 5): Status: 1, 0, 1, 2, 0, 12, C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\, Code4Code.ino.hex
16:07:37.081 (loader): remote cmd from 1320: "status"
16:07:37.086 (post_compile 5): Status: 1, 0, 1, 2, 0, 12, C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\, Code4Code.ino.hex
16:07:37.143 (loader): remote cmd from 1320: "status"
16:07:37.148 (post_compile 5): Status: 1, 0, 1, 2, 0, 12, C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\, Code4Code.ino.hex
16:07:37.206 (loader): remote cmd from 1320: "status"
16:07:37.211 (post_compile 5): Status: 1, 0, 1, 2, 0, 12, C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\, Code4Code.ino.hex
16:07:37.269 (loader): remote cmd from 1320: "status"
16:07:37.276 (post_compile 5): Status: 1, 0, 1, 2, 0, 12, C:\Users\Tim\AppData\Local\Temp\arduino_build_652487\, Code4Code.ino.hex
16:07:37.333 (post_compile 5): Teensy Loader is currently busy with another operation (p).
16:07:37.333 (post_compile 5): quit
16:07:37.345 (loader): remote connection 1320 closed
16:07:37.512 (serialmon 6): Begin, version=1.55-beta1, high-res time
16:07:37.512 (serialmon 6): listening for location: usb:0/140000/0/6/1/4
16:07:37.512 (serialmon 6): LoadLibrary cfgmgr32 ok
16:07:37.512 (serialmon 6): LoadLibrary ntdll ok
16:07:37.517 (serialmon 6): callback 0024
16:07:37.517 (serialmon 6): callback 0081
16:07:37.520 (serialmon 6): callback 0083
16:07:37.521 (serialmon 6): hWnd = 4198722
16:07:37.521 (serialmon 6): loop stdin, ready=262143
16:07:37.527 (serialmon 6): nothing new, skipping HID & Ports enum
16:07:37.531 (loader): remote connection 1320 opened
16:07:37.975 (loader): remote connection 1320 closed

<unsuprising note>
To get the UNfused T4b to upload - from BLANK - Even after .hex was uploaded to FUSED T4b :: Requires a button press

Until the button press IDE upload - Of course this is because the T4b as BLANK has no Active Serial for AUTO upload.
 
It's always supposed to run teensy_secure to create .ehex if you have key.pem in the right place.

I tried here and couldn't reproduce the problem.

Yep that was my mess up I forgotten to move the key.pem file back into the arduino directory. So far with the sketches I tested the builder directory always has both the .hex and the .ehex files.
 
Note: In testing recent - pem.key was properly in place.

Also note the T_4.1 used earlier was found to be Blanked as well. So the problem will blank any Teensy 1062 before it discovers it isn't fused.

<edit> : Plugging in a T_3.6 is also flashed to Blank it seems.
 
If you open a .hex file, or if Arduino tells Teensy Loader about a new .hex file, Teensy Loader will automatically look for a matching .ehex files and maybe use it instead of the .hex file.

This is meant to be convenient and automatic, but yes, it is confusing if you want to know which file is actually being used. This is exactly the sort of thing we're looking for in this beta test (well, and also anything which completely bricks a lockable board). For 1.55-beta2 I'll work on making better visible feedback on whether the .ehex or .hex file is actually being used.

I guess I am still a bit confused. Guess I have a question or two just to get it straight (also note its relatively late in the day for me :) ):

When I do a compile and upload in the Arduino IDE it creates the .hex and .ehex file in the builder directory assuming I have a key.pem file in the Arduino directory otherwise it just creates the .hex (I did confirm this was the case). (1) Now on upload will the Loader automatically use the .ehex file or the .hex file. or (2) do I have to actually follow the steps in post #29:
Code:
Step 1. Verify sketch

Step 2. File -> Open Hex File -> Arduino Build folder and open ehex file created in Step 1 (Verbose will give you the location)

Step 3. Hit PGM button on the Teensy

Reason I am asking is so far I have to do those steps to get the ehex to load otherwise the loader always defaults to load the .hex file.

Sorry if I missed the answer if it was already answered.
 
forgotten to move the key.pem file back into the arduino directory.

Whew, that's a relief. ;)

In the (distant) future I may add features to manage multiple keys, and key security like protected by a password, maybe even integrate with key management software. But there's so many other moving parts here to get right that I wanted to keep the key storage as simple as possible in this first version.
 
(2) do I have to actually follow the steps in post #29:

No, you don't need those steps! That's just making everything so much more work than necessary.

All you should need to do is click Upload in Arduino. And as always with Teensy, if Arduino's request for Teensy to automatically go into programming mode doesn't work, press the pushbutton. It's should work exactly the same way as normal without encryption.

If you have a key.pem file, both .hex and .ehex are always built. Without key.pem, only .hex is built. Teensy Loader is supposed to automatically notice if a .ehex file exists. Arduino never tells Teensy Loader about the .ehex file. It only communicates the .hex and then Teensy Loader looks to see if a .ehex also exits. Likewise when you open a .hex file with File > Open, Teensy Loader looks to see if a matching .ehex file exists.

(matching means the filename is the same and the IVT and bootdata fields inside both files show the same amount of data and digital signature area allocated at the same address... if any of that stuff is different in the .ehex, Teensy Loader is supposed to ignore it)

Teensy Loader should automatically detect if encryption is unsupported, optional, or required by the Teensy board you're using. It should automatically check whether the ehex file was created with the correct key. It should use all this automatically detected info to automatically choose to use the .ehex file if it can work, or use the .hex file if using .ehex won't work, or give you a clearly stated error message if nothing can work.

Of course this is still a 1st beta and already have only 6 hours I have a small but growing list of less-than-great behaviors in Teensy Loader to fix. Some cases aren't doing the thing they should. I will fix this soon and publish 1.55-beta2 later this week. I'm also going to start working on real documentation tonight....
 
otherwise the loader always defaults to load the .hex file.

Please try uploading the Verify Sketch.

If Teensy Loader uploaded the .hex file, you should see this: (and the orange LED should be blinking)

Code:
Verify secure code is running properly

Fail: Bus Encryption Engine is not active
Fail: Encryption region starts at wrong address
Fail: Program data is not within encrypted region
Fail: title_function() is not in encrypted region

If it uploaded the .ehex file, you should get this: (and the orange LED will be on solid)

Code:
Verify secure code is running properly

Pass: Bus Encryption Engine is active
Pass: Encryption region starts at proper address
Pass: Program data is entirely within encrypted region
Pass: title_function() is within encrypted region

All Tests Passed.  :-)
 
Please try uploading the Verify Sketch.

If Teensy Loader uploaded the .hex file, you should see this: (and the orange LED should be blinking)

Code:
Verify secure code is running properly

Fail: Bus Encryption Engine is not active
Fail: Encryption region starts at wrong address
Fail: Program data is not within encrypted region
Fail: title_function() is not in encrypted region

If it uploaded the .ehex file, you should get this: (and the orange LED will be on solid)

Code:
Verify secure code is running properly

Pass: Bus Encryption Engine is active
Pass: Encryption region starts at proper address
Pass: Program data is entirely within encrypted region
Pass: title_function() is within encrypted region

All Tests Passed.  :-)

Ok the Verify sketch is showing is showing a solid orange LED - so it uploaded the .ehex:
Code:
Verify secure code is running properly

Pass: Bus Encryption Engine is active
Pass: Encryption region starts at proper address
Pass: Program data is entirely within encrypted region
Pass: title_function() is within encrypted region

All Tests Passed.  :-)

Ok so if I look at verbose in loader I am seeing:
Code:
20:06:53.984 (loader): elf appears to be for Teensy 4.0 (IMXRT1062) (2031616 bytes)
20:06:53.985 (loader): elf binary data matches hex file
20:06:53.985 (loader): elf file is for Teensy 4.0 (IMXRT1062)
20:06:53.985 (loader): using encrypted ehex (optional - secure mode not yet locked)  <===== we talked about this in previous post.
20:06:54.019 (loader): begin operation
20:06:54.031 (loader): remote cmd from 1380: "status"
[B][COLOR="#FF0000"]20:06:54.031 (reboot 4): Status: 1, 1, 1, 1, 0, 1, C:\Users\Merli\AppData\Local\Temp\arduino_build_140851\, VerifySecure.ino.hex[/COLOR][/B]
20:06:54.037 (loader): flash, block=0, bs=1024, auto=1
20:06:54.038 (loader): flash, block=1, bs=1024, auto=1
20:06:54.038 (loader): flash, block=2, bs=1024, auto=1
20:06:55.932 (loader): remote cmd from 1380: "status"
[COLOR="#FF0000"]20:06:55.934 (reboot 4): Status: 1, 1, 1, 1, 0, 1, C:\Users\Merli\AppData\Local\Temp\arduino_build_140851\, VerifySecure.ino.hex[/COLOR]

with all the reboots indicating its rebooting VerifySecure.ino.hex or more than likely I am interpreting the verbose output wrong - guess I was expecting it to indicate VerifySecure.ino.ehex?

DISCLAIMER: First time I am really digging into the verbose output so may be my issue.
 
....

Of course this is still a 1st beta and already have only 6 hours I have a small but growing list of less-than-great behaviors in Teensy Loader to fix. Some cases aren't doing the thing they should. I will fix this soon and publish 1.55-beta2 later this week. I'm also going to start working on real documentation tonight....

Considering the complexity of encryption, the bootloader changes and the ease of use with the Security window I would say that it is pretty dang well for a beta1 release!!!!! Kudos.

I would say the one issue brought up by @defragster with trying to load an encrypted sketch to and an unfused T4 all the other things are fairly minor (relatively speaking) and as you said its only 6 hours old :)

Cool on the documentation - kind of what I was trying to do with the screen shots. Think with all your answers here you may have a good start :)
 
or more than likely I am interpreting the verbose output wrong - guess I was expecting it to indicate VerifySecure.ino.ehex

Confirmed, you're reading the wrong part of the verbose info. But as I said in msg #33, it's really my fault that the verbose info isn't clear. There are so many messages saying .hex and the one which matters isn't standing out:

Code:
20:06:53.984 (loader): elf appears to be for Teensy 4.0 (IMXRT1062) (2031616 bytes)
20:06:53.985 (loader): elf binary data matches hex file
20:06:53.985 (loader): elf file is for Teensy 4.0 (IMXRT1062)
20:06:53.985 (loader): [COLOR="#B22222"][B]using encrypted ehex[/B][/COLOR] (optional - secure mode not yet locked)  <===== we talked about this in previous post.
20:06:54.019 (loader): begin operation
20:06:54.031 (loader): remote cmd from 1380: "status"
20:06:54.031 (reboot 4): Status: 1, 1, 1, 1, 0, 1, C:\Users\Merli\AppData\Local\Temp\arduino_build_140851\, VerifySecure.ino.hex
20:06:54.037 (loader): flash, block=0, bs=1024, auto=1
20:06:54.038 (loader): flash, block=1, bs=1024, auto=1
20:06:54.038 (loader): flash, block=2, bs=1024, auto=1
20:06:55.932 (loader): remote cmd from 1380: "status"
20:06:55.934 (reboot 4): Status: 1, 1, 1, 1, 0, 1, C:\Users\Merli\AppData\Local\Temp\arduino_build_140851\, VerifySecure.ino.hex

Those status messages are from "reboot 4" which is the communication happening with Arduino (or the teensy_reboot program Arduino runs). Arduino just builds the .ehex file if it can, but none of the communication is about the .ehex file. Teensy Loader is supposed to notice if Arduino built both or only .hex.

For 1.55-beta2 I will work on improving the verbose info messages, so this is clearer.

However, the intended way to check whether encryption is working in that Verify Sketch from the Teensy 4 Security dialog box. It runs 4 specific tests that truly do confirm whether your code is running with or without encryption.
 
Status
Not open for further replies.
Back
Top