UBoot recovery for imx6 via JTAG: Difference between revisions

From Wiki-DB
Jump to navigationJump to search
No edit summary
(Remove old guide and link to the new one)
 
Line 1: Line 1:
Technically all JTAG-adapter listed by OpenOCD should work, but DH electronics recommends the [https://www.olimex.com/Products/ARM/JTAG/ARM-USB-TINY-H/ Olimex Arm-USB-OCD-Tiny-H.]
See [[U-Boot_recovery_for_i.MX6_Q/D/DL/S/ULL_via_JTAG|U-Boot recovery for i.MX6_Q/D/DL/S/ULL via JTAG]]
All tests and Documents were made in use of this one.
 
== Needed Hardware ==
* JTAG Debugger: [https://www.olimex.com/Products/ARM/JTAG/ARM-USB-TINY-H/ Olimex Arm-USB-OCD-Tiny-H.]
* DHCOM JTAG adapter for FFC connection: Article number FD00037
:[[File:JTAG-Adapter.jpeg|300px]]
* Wuerth FFC cable: [http://katalog.we-online.de/de/em/FFC_0_50_TYPE_1_6876XXXXX002 687610050002]
:Note: One cable is included with the DHCOM JTAG adapter.
 
== 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 <code>sudo apt-get install openocd</code>
# '''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 <code>cd /home/devel/Downloads</code>
#**Untar the Downloaded zip-file <code>tar xfvz libftd2xx-x86_64-1.4.6.tgz</code>
#**For the next steps you need Admin rights (standard password for the VM is root): <code>su</code>
#**You need to copy the folder <code>cp libftd2xx.* /usr/local/lib</code>
#**Changing the permission <code>chmod 0755 /usr/local/lib/libftd2xx.so.1.4.6</code>
#** Creating a link <code>ln -sf /usr/local/lib/libftd2xx.so.1.4.6 /usr/local/lib/libftd2xx.so</code>
#** Finish the installation <code>exit</code>
 
== U-Boot 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:''' [https://www.dropbox.com/s/mip4t2apysmcv2x/2018-07-06_uBoot_recovery_iMX6.tar.gz?dl=0 Programing Files]
#*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]
#*Here you get the '''"uBoot.imx"'''
# '''Connecting everything'''
#*Connect the JTAG-Adapter with your PC and the Debian VM (Player - Removeable Devices)
#*Connect the JTAG interface via the DHCOM JTAG adapter to the i.MX6 module (If you don't have a JTAG adapter, please ask DH electronics)
#:[[File:JTAG-connection.jpeg|1000px]]
#*Connect the board with a serial COM-port: [https://wiki.dh-electronics.com/index.php?title=COM_iMX6_Bootloader_U-Boot#Enter_Bootloader_Console Enter Bootloader Console]
# '''Automatic Script'''
#*Create a new folder (it isn't necessary where the folder is located, you just need to keep the folder structure)
#*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 <code>/usr/share/openocd/scripts/board</code>
#**The '''"uBoot_Programmer_Olimex_arm_usb_tiny_h.sh"'''-file needs to be in the uBoot_Programmer folder
#**In the bin_Folder belongs the '''"u-boot-spl-prog.bin"''' and your own uBoot file
#**You need to adjust the '''"uBoot_Programmer_Olimex_arm_usb_tiny_h.sh"''' in terms of the name of your uBoot-file. Paste the name instead of the term "Your uBoot File"
#*Open a Linux terminal and navigate into the folder e.g. <code>cd DHcom_uBoot_Programmer/uBoot_Programmer</code>
#*Power up the i.MX6 board and have a look at the serial output (COM-port). There must not be any output (no uBoot starting) else go to [https://wiki.dh-electronics.com/index.php?title=UBoot_recovery_for_imx6_via_JTAG#Delete_uBoot Delete uBoot]
#*Start the programing script: <code>./uBoot_Programmer_Olimex_arm_usb_tiny_h.sh</code>
#:[[File:JTAG iMX6 script output.PNG|700px]]
#:[[File:JTAG iMX6 Serial output.PNG|700px]]
#*Note: If some error occures you can try the Manual Programing method below
# '''Manual Programming''' (Only needed if automatic script is not used!!!)
#*Power up the board and have a look at the serial output. If there is any uBoot starting:[https://wiki.dh-electronics.com/index.php?title=UBoot_recovery_for_imx6_via_JTAG#Delete_uBoot Delete uBoot]
#*You need two terminals, one for GDB the other for OpenOCD an a Com-Port to get the serial output
## '''OpenOCD'''
##*<code>openocd –f board/dhcom_olimex_arm_usb_tiny_h.cfg</code>
##:[[File:Openocd.png]]
##*If OpenOCD does not open like in the picture then close and open it again
## '''GDB'''
##*Open second terminal window
##*<code>gdb --quiet</code>
##*<code>target remote localhost:3333</code>
##*<code>mon load_image /path/to/the/u-boot-spl-prog/file 0x908000</code>
##*<code>mon reg pc 0x908000</code>
##*<code>mon reset</code>
##*<code>mon resume</code>
##*Wait until the message "Searching for IVT header at DDR address 0x18000000" is on the serial output
##*<code>mon halt</code>
##*<code>mon load_image /path/to/the/u-boot-with-spl/file 0x18000000</code>
##*<code>mon resume</code>
 
==Delete U-Boot==
#If there is any uBoot starting, you can delete it with entering uBoot (press DEL after powering up the board)
#*<code>sf probe</code>
#*<code>sf erase 0 f0000</code>
#*Restart the board
#*Go on with your procedure

Latest revision as of 06:49, 9 March 2020