Open main menu

DAVE Developer's Wiki β

Changes

Recovery U-Boot Image (Naon)

3,726 bytes added, 15:54, 7 February 2013
m
UART Recovery
{{AppliesToNaon}}
{{InfoBoxBottom}}
 
{{WorkInProgress}}
=== Introduction ===
For different reason, starting from image corruption due power loss during upgrade or unrecoverable bug while developing a new U-Boot feature, the user will need, sooner or later, to recover his/her [[:Category:Naon|Naon]] SOM without using U-Boot itself.
In this article we'll see a few useful option for [[wwikipedia:Bare-metal restore|Bare-metal restore]] of a [[:Category:Naon|Naon]] module.
As prerequisite, we suggest an in-depth read of [[Boot sequence (Naon)|Naon boot sequence and options]], [[Memory organization (Naon)|Naon memory organization]] and [[Flashing Images (Naon)|Naon Flashing images]] because all this topic are required to understand the followings.
==== Lauterbach ICD Naon booting ====
[[File:naon-u-boot-sram.cmm|This]] The following script for [http://www.arm.com/community/partners/display_product/rw/ProductId/3084 Lauterbach ICD for ARM Cortex-A8] allow the user to:
* configure T32 correctly
* establish a connection with the target (which should already be powered on)
At this point the user should be able to run commands from U-Boot serial console.
<pre>; T32 script to download u-boot 1st stage into the internal SRAM break.delete /all SYStem.RESetSYStem.CPU DM8148SYStem.JtagClock 10MhzSYStem.Mode Attach ; we assume that there's bootrom running. Stop it to allow binary load break  data.load.binary MLO 0x40300000 R.S PC 0x40300000 go enddo</pre> As a more advance example, [[File:naon-u-boot-sram-2nd.cmm|This]] the next script, after loading the 1st stage and have it run until RAM initialization, also load 2nd stage (at 0x81000000). This is faster that loading the 2nd stage via serial protocol. After executing the script, the user should just type <code>go 81000000</code> from U-Boot 1st stage prompt, to run the 2nd stage:
<pre class="board-terminal">
Hit any key to stop autoboot: 0
NAON#
</pre>
 
 
Here it is:
 
<pre>
; T32 script to download u-boot 1st stage into the internal SRAM and,
; after the 1st stage initilize it, it loads also the 2nd stage in DRAM
 
break.delete /all
 
SYStem.RESet
SYStem.CPU DM8148
SYStem.JtagClock 10Mhz
SYStem.Mode Attach
 
; we assume that there's bootrom running. Stop it to allow binary load
break
 
data.load.binary MLO 0x40300000
 
R.S PC 0x40300000
 
go
;wait a bit, so U-Boot starts and initialize everything
wait 2s
break
 
data.load.binary ../u-boot/u-boot.git/u-boot.bin 0x81000000
go
 
enddo
</pre>
This combination of tool is described into [http://processors.wiki.ti.com/index.php/DM814x_C6A814x_AM387x_PSP_Flashing_Tools_Guide this] article of Texas Instruments Wiki.
More article on CCS are available into its [[http://processors.wiki.ti.com/index.php/Category:DaVinci_CCS dedicated section]] of TI Wiki.
=== UART Recovery ===
 
UART recovery does not requires any specialized hardware, except for
 
* a PC (Windows or Linux based)
* a DB9 serial cross cable
* the binary image of the 1st stage bootloader (u-boot.min.uart) with UART support (if this file is not available, please see [[Recovery U-Boot Image (Naon)#Getting the u-boot.min.uart | Getting the u-boot.min.uart]])
 
If not already available, configure [[Boot sequence (Naon)|Naon boot sequence]] to include UART boot.
 
To verify this, is enough to open a serial terminal (115200 8N1) and power on the board. If everything is correctly configured you should see a sequence of <code>CCC</code> on your screen.
 
Please follow [http://processors.wiki.ti.com/index.php/DM814x_AM387x_PSP_U-Boot#U-Boot_UART_support this instructions] on TI Wiki to load both 1st and 2nd stages of U-Boot.
 
When the 2nd stage is running follow [[Flashing Images (Naon)|this]] article for instructions on how to update U-Boot in flash
 
==== Getting the u-boot.min.uart ====
 
To build the 1st stage bootloader with UART support:
 
* configure the file Rules.make file contained into the ''EZSDK_INSTALL_DIR'', modifying the <code>MIN_UBOOT_CONFIG</code> and <code>MIN_UBOOT_IMAGE</code> variables, choosing the ''uart'' variant:
<pre>
MIN_UBOOT_CONFIG=naon_min_uart
MIN_UBOOT_IMAGE=u-boot.min.uart
</pre>
 
* build u-boot launching the <code>make u-boot</code> command, as described in [[Development_Environment_HowTo_(NELK)#Build.2Fconfigure_U-Boot_only | Build/configure U-Boot only]]
* enter the ''EZSDK_INSTALL_DIR/board-support/u-boot.git'' directory and launch the following command, which removes the MLO header (first 8 bytes):
 
<pre>
dd if=MLO of=u-boot.min.uart bs=1 skip=8
</pre>
 
<code>u-boot.min.uart</code> is the file that must be sent through the serial line to load the 1st stage bootloader on the board.
=== MMC Recovery ===
 
Due the fact that MMC is both removable and accessible on a system that support this device, MMC recovery is a valuable options that requires no special hardware at all, apart a properly formatted MMC.
 
For more information about MMC booting see its dedicated section inside [[Boot sequence (Naon)|Naon boot sequence]].
 
After the board is booted via MMC, if you have U-Boot console access and a serial terminal emulator (and, of course, a PC), you can follow the standard [[Flashing Images (Naon)|Naon Flashing Images instructions]] to restore the broken bootloader (it's useful to have this binary image on MMC too)
 
If you are on-site without even a console access (or a skilled user that can send commands via serial console), a better way to recover the board is to prepare a custom U-Boot image as boot binary into the MMC with runs the update (and verify!) commands as soon as it's booted. However this is an advanced topic and requires a customization that is heavily system dependent. Feel free to [[HowTo Contact Technical Support|contact us]] for more information and help.