Mark Butcher

Teensy 4.0 Support

Discussion created by Mark Butcher on Mar 28, 2020
Latest reply on Mar 29, 2020 by Kerry Zhou

Hi All

 

The uTasker project now supports also the popular Teensy 4.0 (i.MX RT 1062).

 

The following is a boot loader that can be installed on the Teensy 4.0:
https://www.utasker.com/iMX/Teensy_4.html
to allows it to load new code via USB-MSD, serial SREC (on LPUART3), using NXP's Kboot USB-HID tool or from an SD card.

 

It is AES256 encrypted in QSPI flash and also the new code loaded via the loading methods can be AES256 encrypted so that no one can reverse engineer it by reading it from the QSP flash.

 

There is a reference application that can be tested (in plain text and AES256 encrypted forms, whereby the loader accepts both) that demonstrates USB-MSD and USB-CDC composite HW USB device and SD card operation (when there is an SD card socket mounted) allowing the Teensy 4 to operate as a pen drive to a USB host with access to the SD card. Furthermore it always appears as a second hard drive to the PC with emulated FAT content that shows snap shots of the complete QSPI flash content, the instruction RAM content and the data RAM content.
On the USB-CDC interface (and on LPUART3 at 115'200Baud) there is a command line menu which supports various commands, such as a DOS like command line interface to the SD card, commands to view, write and erase data in the QSPI flash, command ports and save parameters to an area of QSPI flash. It allows commanding a LPUART3 to USB-CDC bridge, etc. etc.

 

The loader is usable with Teensyduino or SDK projects by linking the project code to the address 0x00000300 (for execution in instruction RAM) - interrupt vectors are to be copied by the code to the instruction RAM area beginning at 0x00000000. The image can be optionally AES256 encrypted by using the uTaskerConvert utility at https://www.utasker.com/forum/index.php?topic=1445.0 to securely protect it when distributing new firmware versions.

 

The boot loader also dynamically partitions the FlexRAM in the i.MX RT 1062 to suit the application size (allocating just enough banks to fit the application in instruction memory and allocating all remaining ones to data memory). This achieves maximum performance since code and data are accessed at full speed without wait states. The QSPI flash is powered down when not used by parameters or file system and so optimal power consumption, with no radiation due to external QSPI code accesses once running.

 

Regards

 

Mark
[uTasker project developer for Kinetis and i.MX RT]

Outcomes