Replies: 7 comments 25 replies
-
uhh, isn't teensy 4.1 has its own bootloader already ? I haven't looked at this, but make sure you double check the flash layout of teensy bootloader vs tinyuf2. 2 bootloaders usually doesn't work together (it is either 1 or another most of the time). |
Beta Was this translation helpful? Give feedback.
-
You actually do not need to load blhost, you load the TinyUF2 binary with
sdphost and jump to it, then it copies itself to flash.
This saves the step and eliminates blhost completely.
…On Fri, Feb 17, 2023, 5:31 PM caleb crome ***@***.***> wrote:
Here are the commands from the NXP MCU Boot utility, and the final failure
code (addresses translated to hex for sanity)
# 'Connect to xxx' button is clicked
sdphost -t 50000 -u 0x1FC9,0x0135 -j -- error-status
sdphost -t 50000 -u 0x1FC9,0x0135 -j -- read-register 1075790864 32 4 readReg.dat
sdphost -t 50000 -u 0x1FC9,0x0135 -j -- read-register 1075790880 32 4 readReg.dat
sdphost -t 50000 -u 0x1FC9,0x0135 -j -- read-register 1074757636 32 4 readReg.dat
sdphost -t 50000 -u 0x1FC9,0x0135 -j -- read-register 1074757660 32 4 readReg.dat
sdphost -t 50000 -u 0x1FC9,0x0135 -j -- read-register 1074757660 32 4 readReg.dat
sdphost -t 50000 -u 0x1FC9,0x0135 -j -- write-file 539001344 C:\Users\caleb\Downloads\NXP-MCUBootUtility-4.0.0\NXP-MCUBootUtility-4.0.0\src\targets\MIMXRT1062\ivt_flashloader.bin
sdphost -t 50000 -u 0x1FC9,0x0135 -j -- jump-address 539001344
#'Connect to xxx' button is clicked
blhost -t 50000 -u 0x15A2,0x0073 -j -- get-property 1 0
blhost -t 50000 -u 0x15A2,0x0073 -j -- get-property 1 0
blhost -t 50000 -u 0x15A2,0x0073 -j -- get-property 24 0
blhost -t 50000 -u 0x15A2,0x0073 -j -- efuse-read-once 5
blhost -t 50000 -u 0x15A2,0x0073 -j -- efuse-read-once 6
blhost -t 50000 -u 0x15A2,0x0073 -j -- efuse-read-once 7
blhost -t 50000 -u 0x15A2,0x0073 -j -- efuse-read-once 6
blhost -t 5242000 -u 0x15A2,0x0073 -j -- read-memory 0x400ac040 4 readReg.dat 0
blhost -t 5242000 -u 0x15A2,0x0073 -j -- read-memory 0x401f46d0 4 readReg.dat 0
#'Connect to xxx' button is clicked
blhost -t 5242000 -u 0x15A2,0x0073 -j -- fill-memory 0x20202000 4 0xc0000207 word
blhost -t 5242000 -u 0x15A2,0x0073 -j -- fill-memory 0x20202004 4 0 word
blhost -t 5242000 -u 0x15A2,0x0073 -j -- configure-memory 9 0x20202000 # This is where it fails
The last command fails with
{
"command" : "configure-memory",
"response" : [],
"status" : {
"description" : "20107 (0x4E8B) kStatus_FlexSPINOR_SFDP_NotFound",
"value" : 20107
}
}
I'm going on vacation for a week tomorrow, so might go dark. But I'm very
interested in getting this working! Any hints would be great!
—
Reply to this email directly, view it on GitHub
<#285 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJZ2HJQTZJEHI5HUBYZVUE3WYAQ7VANCNFSM6AAAAAAU5Z76JU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Good news! I was able to build your repository and load it into my Teensy 4.0 board The magic numbers are:
The fcfb is the flash configuration block that needs to be loaded at 0x1000 on RT106x |
Beta Was this translation helpful? Give feedback.
-
First, you should check the Arduino linker files to make sure they do not
use the RAM you are writing to.
Second, TinyUF2 looks for fcfb to determine if it will copy itself to
flash. You may need to clear this sector first, or add a way to force the
load.
…On Sun, Feb 19, 2023, 9:11 AM caleb crome ***@***.***> wrote:
I think this might be roughly all we need:
https://github.com/ccrome/tinyuf2/blob/teensy41/ports/mimxrt10xx/boards/teensy41/loader-loader/src/loader.ino.
This just converts the .bin file to a .h file, and comples it into a sketch.
I didn't have all the docs available when writing this, so don't have all
the right settings for the GPR registers, but does it look roughly right?
—
Reply to this email directly, view it on GitHub
<#285 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJZ2HJSOLEHKA4WTBCE7EFTWYJH37ANCNFSM6AAAAAAU5Z76JU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
It should only take one objcopy command to generate the .hex that teensy
loader can use. I'll try to figure it out later today.
…On Sun, Feb 19, 2023, 9:11 AM caleb crome ***@***.***> wrote:
I think this might be roughly all we need:
https://github.com/ccrome/tinyuf2/blob/teensy41/ports/mimxrt10xx/boards/teensy41/loader-loader/src/loader.ino.
This just converts the .bin file to a .h file, and comples it into a sketch.
I didn't have all the docs available when writing this, so don't have all
the right settings for the GPR registers, but does it look roughly right?
—
Reply to this email directly, view it on GitHub
<#285 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJZ2HJSOLEHKA4WTBCE7EFTWYJH37ANCNFSM6AAAAAAU5Z76JU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Here is one way to generate a .hex file that Teensy Loader can load. This worked on my Teensy 4.0 board with the image I built from your repo. The linker scripts should be able to take care of this and generate the correct load addresses automatically, but I did not implement the virtual and load addresses correctly. |
Beta Was this translation helpful? Give feedback.
-
I created PR #291. Let me know if you think anything else needs to be done. Right now, the objcopy only happens on the teensy boards. It would be easy to change to all boards. |
Beta Was this translation helpful? Give feedback.
-
I've attempted to bring up tinyuf2 on the TEENSY 4.1 but I'm not having any luck.
Here's what I've tried:
You can check out the mods here.
Just the diffs are:
I built with
And I load with:
It appears that it attempts to run, because I get exactly one line in /var/log/syslog:
followed by errors:
Any thoughts on how to make this work on teensy 4.1.
The real bear with the teensy is that there's no good way to connect jtag to it as far as I know.
Beta Was this translation helpful? Give feedback.
All reactions