diff --git a/tools/imxrt_firmware_tools/blhost/SW-Content-Register.txt b/tools/imxrt_firmware_tools/blhost/SW-Content-Register.txt new file mode 100644 index 000000000..5e47ecc97 --- /dev/null +++ b/tools/imxrt_firmware_tools/blhost/SW-Content-Register.txt @@ -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 diff --git a/tools/imxrt_firmware_tools/blhost/blhost Release Notes.pdf b/tools/imxrt_firmware_tools/blhost/blhost Release Notes.pdf new file mode 100644 index 000000000..0067066da Binary files /dev/null and b/tools/imxrt_firmware_tools/blhost/blhost Release Notes.pdf differ diff --git a/tools/imxrt_firmware_tools/blhost/linux/amd64/blhost b/tools/imxrt_firmware_tools/blhost/linux/amd64/blhost new file mode 100755 index 000000000..3458b0ed2 Binary files /dev/null and b/tools/imxrt_firmware_tools/blhost/linux/amd64/blhost differ diff --git a/tools/imxrt_firmware_tools/blhost/mac/blhost b/tools/imxrt_firmware_tools/blhost/mac/blhost new file mode 100755 index 000000000..8162c7bf6 Binary files /dev/null and b/tools/imxrt_firmware_tools/blhost/mac/blhost differ diff --git a/tools/imxrt_firmware_tools/blhost/win/blhost.exe b/tools/imxrt_firmware_tools/blhost/win/blhost.exe new file mode 100755 index 000000000..13cf25828 Binary files /dev/null and b/tools/imxrt_firmware_tools/blhost/win/blhost.exe differ diff --git a/tools/imxrt_firmware_tools/imxrt_erase_flash.sh b/tools/imxrt_firmware_tools/imxrt_erase_flash.sh new file mode 100755 index 000000000..7e3c30be3 --- /dev/null +++ b/tools/imxrt_firmware_tools/imxrt_erase_flash.sh @@ -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 diff --git a/tools/imxrt_firmware_tools/imxrt_write_firmware.sh b/tools/imxrt_firmware_tools/imxrt_write_firmware.sh new file mode 100755 index 000000000..e9ba379c1 --- /dev/null +++ b/tools/imxrt_firmware_tools/imxrt_write_firmware.sh @@ -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 diff --git a/tools/imxrt_firmware_tools/imxrt_write_sbl.sh b/tools/imxrt_firmware_tools/imxrt_write_sbl.sh new file mode 100755 index 000000000..1f471a6dc --- /dev/null +++ b/tools/imxrt_firmware_tools/imxrt_write_sbl.sh @@ -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 diff --git a/tools/imxrt_firmware_tools/sdphost/linux/amd64/sdphost b/tools/imxrt_firmware_tools/sdphost/linux/amd64/sdphost new file mode 100755 index 000000000..8da5ab082 Binary files /dev/null and b/tools/imxrt_firmware_tools/sdphost/linux/amd64/sdphost differ diff --git a/tools/imxrt_firmware_tools/sdphost/linux/i386/sdphost b/tools/imxrt_firmware_tools/sdphost/linux/i386/sdphost new file mode 100755 index 000000000..fff615ead Binary files /dev/null and b/tools/imxrt_firmware_tools/sdphost/linux/i386/sdphost differ diff --git a/tools/imxrt_firmware_tools/sdphost/mac/sdphost b/tools/imxrt_firmware_tools/sdphost/mac/sdphost new file mode 100755 index 000000000..c36d11652 Binary files /dev/null and b/tools/imxrt_firmware_tools/sdphost/mac/sdphost differ diff --git a/tools/imxrt_firmware_tools/sdphost/win/sdphost.exe b/tools/imxrt_firmware_tools/sdphost/win/sdphost.exe new file mode 100755 index 000000000..524151d8c Binary files /dev/null and b/tools/imxrt_firmware_tools/sdphost/win/sdphost.exe differ