UBoot recovery for imx6 via JTAG: Difference between revisions
From Wiki-DB
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 25: | Line 25: | ||
and program the uBoot manually. | and program the uBoot manually. | ||
# '''Download the needed files here:''' | # '''Download the needed files here:''' | ||
#*Here you get the '''"dhcom_olimex_arm_usb_tiny_h.cfg"''' and the '''"u-boot-spl-prog"''' | |||
# '''Download newest uBoot here:''' [https://wiki.dh-electronics.com/index.php?title=COM_iMX6-D2#Downloads uBoot_iMX6] | # '''Download newest uBoot here:''' [https://wiki.dh-electronics.com/index.php?title=COM_iMX6-D2#Downloads uBoot_iMX6] | ||
#*Here you get the '''"uBoot.imx"''' | |||
# '''Automatic Script''' | # '''Automatic Script''' | ||
#*The needed folder structure looks like this: | #*The needed folder structure looks like this: |
Revision as of 10:22, 2 July 2018
Technically all JTAG-adapter listed by OpenOCD should work, but DH electronics recommends the Olimex Arm-USB-OCD-Tiny-H. All tests and Documents were made in use of this one.
Installation
This installation was made on the Virtual Machine for Application Development. All console expressions refer to this Debian system.
- OpenOCD
- OpenOCD is a Linux package and is as easy to install as
sudo apt-get install openocd
- OpenOCD is a Linux package and is as easy to install as
- Drivers
- If you use the JTAG-Adapter recommended by DH, then you need to install the FTDI-Drivers as followed:
- Go to http://www.ftdichip.com/Drivers/D2XX.htm and Download your suitable Driver (32-bit or 64-bit)
- Navigate into the Download folder
cd /home/devel/Downloads
- Untar the Downloaded zip-file
tar xfvz libftd2xx-x86_64-1.4.6.tgz
- For the next steps you need Admin rights (standard password for the VM is devel):
$ sudo –su
- You need to copy the folder
cp libftd2xx.* /usr/local/lib
- Changing the permission
chmod 0755 /usr/local/lib/libftd2xx.so.1.4.6
- Creating a link
ln –sf /usr/local/lib/libftd2xx.so.1.4.6 /usr/local/lib/libftd2xx.so
- Finish the installation
exit
- If you use the JTAG-Adapter recommended by DH, then you need to install the FTDI-Drivers as followed:
uBoot Programing
There are two ways for doing this. The easy way is an automatic Bash-script, which handles all the commands needed for the programing process. In this case you need a specified folder-structure so that the automatic script can find all its needed files. The other one is to type in the required commands. In a few cases this fails then you need to go the other way and program the uBoot manually.
- Download the needed files here:
- Here you get the "dhcom_olimex_arm_usb_tiny_h.cfg" and the "u-boot-spl-prog"
- Download newest uBoot here: uBoot_iMX6
- Here you get the "uBoot.imx"
- Automatic Script
- The needed folder structure looks like this:
- DHcom_uBoot_Programmer
- bin_File (here are the uBoot files)
- uBoot_Programmer (here are the Programing scripts)
- Paste the "dhcom_olimex_arm_usb_tiny_h.cfg"-file in the OpenOCD folder at
/usr/share/openocd/scripts/board
- The "uBoot_Programmer_Olimex_arm_usb_tiny_h"-file needs to be in the uBoot_Programmer folder
- The two u-boot files ("u-boot-spl-prog" and "u-boot-with-spl") belong to the bin_File folder
- The "u-boot-with-spl"-file can be changed with your own uboot-file. You just have to name it like this else it wouldn't be recognized by the script.
- DHcom_uBoot_Programmer
- Open a terminal and navigate into the folder e.g.
cd DHcom_uBoot_Programmer/uBoot_Programmer
- Start the programing script:
./uBoot_Programmer_Olimex_arm_usb_tiny_h
- The needed folder structure looks like this:
- Manual Programing
- You need two terminals, one for GDB the other for OpenOCD an da Com-Port to get the serial output
- OpenOCD
- GDB
gdb --quiet
target remote localhost:3333
mon load_image /path/to/the/u-boot-spl-prog/file 0x908000
mon reg pc 0x908000
mon resume
- Wait until the message "Searching for IVT header at DDR address 0x18000000" is on the serial output
mon halt
mon load_image /path/to/the/u-boot-with-spl/file 0x18000000
mon resume