tools: Add imxrt firmware tools.

This commit is contained in:
iabdalkader 2023-07-04 17:18:19 +02:00
parent d85935e787
commit d2e6b4f787
12 changed files with 204 additions and 0 deletions

View File

@ -0,0 +1,55 @@
Release Name: blhost
Release Version: 2.6.7
Package License: LA_OPT_NXP_Software_License.htm - Production Use, Section 2.3 applies
Host tools Source Description: Source code for blhost
Author: Freescale
License: Open Source - BSD-3-Clause
Format: source code
Location: src
Host tools - Serial support Description: Windows Serial peripheral support
Author: Bus Pirate Project
License: Open Source - CC0-1.0 (Creative Commons Zero)
URL: http://code.google.com/p/the-bus-pirate/
Format: source code
Location:
src/blfwk/serial.h,
src/blfwk/src/serial.c
Host tools - USB HID Description: Windows USB HID support
support Author: HIDAPI
License: Open Source - BSD-3-Clause
URL: http://github.com/signal11/hidapi
Format: source code
Location:
src/blfwk/hidapi.h,
src/blfwk/src/hid-*.c
Host tools - JSON support Description: Windows JSON support
Author: JSONCPP
License: Open Source - MIT
Format: source code
Location:
src/blfwk/json.h,
src/jsoncpp.cpp
Host tools - options Description: Command line parsing utility
support Author: bradapp@enteract.com
License: Open Source - MIT
URL: http://www.bradapp.com
Format: source code
Location:
src/blfwk/options.h,
src/options.cpp
Host tools - blfwk.lib Description: C++ interface to the Vincent Rijmen's
Rijndael block cipher
Author: Szymon Stefanek (stefanek@tin.it)
License: Public Domain
URL:
http://www.pragmaware.net/software/rijndael/index.php
Format: source code
Location:
src/blfwk/rijndael.h,
src/blfwk/src/rijndael.cpp

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,47 @@
#!/bin/bash
export "sdphost_connect=-u 0x1FC9,0x0135"
export "set_sdphost_baud_rate=115200"
export "blhost_connect=-u 0x15A2,0x0073"
export "erase_all=0"
export "write_fcb=1"
export "sdphost=./sdphost/linux/amd64/sdphost"
export "blhost=./blhost/linux/amd64/blhost"
export "flashloader=signed_MIMXRT1060_flashloader.bin"
export "sbl_image=evkbmimxrt1060_flashloader_nopadding.bin"
export "sbl_size=$(stat -c %s $sbl_image)"
echo "### Load FlashLoader ###"
"$sdphost" $sdphost_connect -- write-file 0x20001C00 "$flashloader"
if [ $? -ge 2 ]; then
exit 2
fi
echo "### Start FlashLoader ###"
"$sdphost" $sdphost_connect -- jump-address 0x20001C00
if [ $? -ge 2 ]; then
exit 2
fi
echo "### Waiting FlashLoader to be initialized ###"
sleep 3
"$blhost" $blhost_connect -t 5000 -- get-property 1 0
if [ $? -ge 2 ]; then
exit 2
fi
echo "### Configure FlexSPI NOR memory using options on address 0x2000 ###"
"$blhost" $blhost_connect -- fill-memory 0x2000 4 0xC0000008 word #133MHz
if [ $? -ge 2 ]; then
exit 2
fi
"$blhost" $blhost_connect -- configure-memory 9 0x2000
if [ $? -ge 2 ]; then
exit 2
fi
echo "### Erase memory before writing image ###"
"$blhost" $blhost_connect -t 100000 -- flash-erase-all 9
echo "### Reset ###"
"$blhost" $blhost_connect -- reset

View File

@ -0,0 +1,28 @@
#!/bin/bash
export "blhost_connect=-u 0x15A2,0x0073"
export "blhost=./blhost/linux/amd64/blhost"
export "firmware_image=../../src/build/bin/firmware.bin"
export "firmware_size=$(stat -c %s $firmware_image)"
export "firmware_addr=0x60040000"
echo "### Waiting FlashLoader to be initialized ###"
sleep 0.5
"$blhost" $blhost_connect -t 5000 -- get-property 1 0
if [ $? -ge 2 ]; then
exit 2
fi
echo "### Erase memory before writing image ###"
"$blhost" $blhost_connect -t 60000 -- flash-erase-region $firmware_addr $firmware_size 9
if [ $? -ge 2 ]; then
exit 2
fi
echo "### Write firmware image ###"
"$blhost" $blhost_connect -- write-memory $firmware_addr $firmware_image
if [ $? -ge 2 ]; then
exit 2
fi
echo "### Reset ###"
"$blhost" $blhost_connect -- reset

View File

@ -0,0 +1,74 @@
#!/bin/bash
export "sdphost_connect=-u 0x1FC9,0x0135"
export "set_sdphost_baud_rate=115200"
export "blhost_connect=-u 0x15A2,0x0073"
export "erase_all=1"
export "write_fcb=1"
export "sdphost=./sdphost/linux/amd64/sdphost"
export "blhost=./blhost/linux/amd64/blhost"
export "flashloader=unsigned_MIMXRT1060_flashloader.bin"
export "sbl_image=evkbmimxrt1060_flashloader_nopadding.bin"
export "sbl_size=$(stat -c %s $sbl_image)"
echo "### Load FlashLoader ###"
"$sdphost" $sdphost_connect -- write-file 0x20001C00 "$flashloader"
if [ $? -ge 2 ]; then
exit 2
fi
echo "### Start FlashLoader ###"
"$sdphost" $sdphost_connect -- jump-address 0x20001C00
if [ $? -ge 2 ]; then
exit 2
fi
echo "### Waiting FlashLoader to be initialized ###"
sleep 3
"$blhost" $blhost_connect -t 5000 -- get-property 1 0
if [ $? -ge 2 ]; then
exit 2
fi
echo "### Configure FlexSPI NOR memory using options on address 0x2000 ###"
"$blhost" $blhost_connect -- fill-memory 0x2000 4 0xC0000008 word #133MHz
if [ $? -ge 2 ]; then
exit 2
fi
"$blhost" $blhost_connect -- configure-memory 9 0x2000
if [ $? -ge 2 ]; then
exit 2
fi
echo "### Erase memory before writing image ###"
if [ "$erase_all" = "1" ]; then
"$blhost" $blhost_connect -t 100000 -- flash-erase-all 9
else
"$blhost" $blhost_connect -t 100000 -- flash-erase-region 0x60000000 $sbl_size 9
fi
if [ $? -ge 2 ]; then
exit 2
fi
if [ "$write_fcb" = "1" ]; then
# FCB is embedded in image
echo "### Create Flash Configuration Block (FCB) using option on address 0x2000 ###"
"$blhost" $blhost_connect -- fill-memory 0x2000 4 0xF000000F word
if [ $? -ge 2 ]; then
exit 2
fi
"$blhost" $blhost_connect -- configure-memory 9 0x2000
if [ $? -ge 2 ]; then
exit 2
fi
fi
echo "### Write image ###"
"$blhost" $blhost_connect -- write-memory 0x60001000 "$sbl_image"
if [ $? -ge 2 ]; then
exit 2
fi
echo "### Reset ###"
"$blhost" $blhost_connect -- reset

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.