Teensy 4.0 & 4.1

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Teensy 4.0 & 4.1

Post by Roberthh » Thu Oct 07, 2021 12:36 pm

JFlashExe complained about a missing license, JFlashLiteExe worked. So it's time to get our bootloader ready.

alphaFred
Posts: 31
Joined: Wed Apr 15, 2020 6:47 pm

Re: Teensy 4.0 & 4.1

Post by alphaFred » Thu Oct 07, 2021 12:52 pm

Roberthh wrote:
Thu Oct 07, 2021 12:36 pm
So it's time to get our bootloader ready.
I know I know :D

When booting from QSPI it should already work with the Teensy40/41 bootloader because the 105x and 106x have the same FlexRAM default config if I am not mistaken. HyperFlash integration will take some more time due to different sector size etc.

alphaFred
Posts: 31
Joined: Wed Apr 15, 2020 6:47 pm

Re: Teensy 4.0 & 4.1

Post by alphaFred » Thu Oct 07, 2021 12:53 pm

Anyhow. Tonight I will integrate 1052 QSPI into the bootloader and then we can test.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Teensy 4.0 & 4.1

Post by Roberthh » Thu Oct 07, 2021 1:06 pm

The Teensy 4.1 bootloader starts on that device. Only the target cannot be built yet since the matching firmware loader spec file is missing.
Edit: Solved

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Teensy 4.0 & 4.1

Post by Roberthh » Thu Oct 07, 2021 2:56 pm

I have added board files for the ARCH MIX board to https://github.com/robert-hh/micropytho ... t_combined.
Documentation on how devices are assigned to Pins can be found in https://github.com/robert-hh/micropytho ... imxrt_docs.
Edit: Updated - I2C assignment changed.

loboris
Posts: 344
Joined: Fri Oct 02, 2015 6:19 pm

Re: Teensy 4.0 & 4.1

Post by loboris » Fri Oct 08, 2021 1:03 pm

I tested more the RT1050/RT1060 serial downloader feature, and I can say it is really easy and simple to use.
The firmware can be uploaded to flash without the need for J-link (or similar) programmer/debugger, just over the USB HID connection provided on practically every board (usually marked USB-OTG).
The only thing one must do is to place the MCU in serial downloader mode which is easy to do as practically all board have the mode switches provided.
To enter serial download mode the pin GPIO_AD_B0_05 has to be set high, all other mode switches low.
I've testes on Arch Mix and SomLabs boards and it is working without issues. On MIMXRT1050-EVK (not tested), switch SW7 should be used.
The UART1_RXD (GPIO_AD_B0_13) must also be pulled to 3.3V. On Arch Mix it must be pulled high by a jumper, On SomLabs board and MIMXRT1050-EVK it is already pulled high on board.

I've prepared a simple script to upload the built MicroPython firmware (firmware.bin) to the board. It can be simply used by executing:

Code: Select all

./FLASH.sh <path_to_firmware.bin>
It is the Linux script, but the similar script (batch file) could be easily prepared also for Windows

I've packed the script and all needed files (only 3) into an archive which you can download and test.

Code: Select all

boris@UbuntuMate:/home/LoBo2_Razno/IMXRT10xx/FWdownloader$ ./FLASH.sh /home/LoBo2_Razno/IMXRT10xx/micropython/ports/mimxrt/build-MIMXRT1050_EVK/firmware.bin

=======================
RT10XX Firmware flasher
=======================

Check if the FlashLoader exists on target
  FlashLoader not started, checking target ROM bootloader
  ROM bootloader detected at -u 0x1FC9,0x0130, upload Flashloader
  OK, start Flashloader on target
  OK, check for Flashloader again
  FlashLoader ready

Flash Firmware file to target
'/home/LoBo2_Razno/IMXRT10xx/micropython/ports/mimxrt/build-MIMXRT1050_EVK/firmware.bin'

  Prepare target memory
  Erasing 444384 bytes at 0x60000000
  Write image
  Firmware flashed successfully.
boris@UbuntuMate:/home/LoBo2_Razno/IMXRT10xx/FWdownloader$ 

alphaFred
Posts: 31
Joined: Wed Apr 15, 2020 6:47 pm

Re: Teensy 4.0 & 4.1

Post by alphaFred » Fri Oct 08, 2021 1:22 pm

Thanks for that script. If you like you can check out the “alpha” release of my DFU bootloader in my repository https://github.com/alphaFred/micropytho ... bootloader

No need to touch the board since it works over the device USB port. Just start an upload via dfu-tool and the board will automatically switch to the bootloader, upgrade and jump back to the firmware.

This is still work in progress but I got positive feedback for MINXRT1020-EVK, Teensy40/41 and also the ARCH MIX board.

loboris
Posts: 344
Joined: Fri Oct 02, 2015 6:19 pm

Re: Teensy 4.0 & 4.1

Post by loboris » Fri Oct 08, 2021 1:30 pm

alphaFred wrote:
Fri Oct 08, 2021 1:22 pm
If you like you can check out the “alpha” release of my DFU bootloader in my repository
Thanks, I'll check it.
The firmware still needs to be flashed at least the first time and my script is mostly for those who have the board but don't have J-link (which is not exactly low priced).

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Teensy 4.0 & 4.1

Post by Roberthh » Fri Oct 08, 2021 1:35 pm

@loboris This is definitely a great help for all people without and with JLink hardware for flashing firmware. Thank you for your effort. This is required, even with the DFU-Bootloader we are developing at the moment. This initial bootloader cannot be installed by DFU and has to be installed by other means - your serial bootloader tool or JFlash.
The DFU-Bootloader made by @alphaFred works already and was tested with ARCH MIX, Teensy and the MIMXRT1020 and 1050 board.
b.t.w. Which Version of the MIMXRT1050_EVK do you have. Is it -EVK or -EVKB, nor flash or hyper flash?

loboris
Posts: 344
Joined: Fri Oct 02, 2015 6:19 pm

Re: Teensy 4.0 & 4.1

Post by loboris » Fri Oct 08, 2021 1:41 pm

Roberthh wrote:
Fri Oct 08, 2021 1:35 pm
b.t.w. Which Version of the MIMXRT1050_EVK do you have. Is it -EVK or -EVKB, nor flash or hyper flash?
I think I've mentioned it in the post, I don't have MIMXRT1050_EVK, the suggested use of SW7 is only from the schematic.
If you have it, you can test if the script works with hyper flash, some parameters for blhost maybe needs adjusting...

Edit: I'm designing my own RT1062 based PCB for one specific application, that is why I'm using SomLabs module (and carrier board for testing). I'm also considering the FET1052-C System on Module which could be a good choice (the cost is 28.82 €).

Post Reply