Changes

Jump to: navigation, search

Recovery U-Boot Image (Lizard)

1,094 bytes added, 09:31, 16 March 2018
put infobox at top
{{InfoBoxTop}}
{{AppliesToLizard}}
{{AppliesToLizardEVB-Lite}}
{{InfoBoxBottom}}
 
== Introduction ==
This article describe how to recover a corrupted U-Boot image on Lizard NOR Flash using a Windows host machine.
 
In brief user needs to:
* configure Lizard SOM to boot over serial port instead of on board NOR flash
* download and prepare serial communication tools
* use those tools to download first stage bootloader and U-Boot over UART
* use this U-Boot to update NOR flash
This assume that you're using a standard [[Lizard Embedded Linux Kit (LELK)|LELK]] hardware and software.
== Tool Preparation ==
* Download the [[mirror:lizard/recovery/lizard-recovery.zip archive |lizard-Recoveryrecovery.zip archive]] and extract it on your Windows PC * If needed, replace the u-boot.bin file with your custom binary or download the latest LELK binary from [[mirror:lizard|DAVE Embedded Systems mirror]]
* Open the command prompt and go inside the folder where you extracted the recovery file
* Launch the utility with the serial port number as the argument
<pre>
C:\Users\Desktop\lizard-Recovery\lizard> .\uart-recovery.bat COM1
</pre>The tools is now waiting for the board to wakeup{{InfoBoxTop}}{{AppliesToLizard}}{{AppliesToLizardEVB-Lite}}{{InfoBoxBottom}}
== Board Preparation ==
* Power down off the board and set the deep dip switch <code>S2.2 1 configuration.ON</code> to select serial boot* Connect the serial console '''UART2''' to the <ode>PORT2 of your board.host PC* Turn on the board.
== Flashing the firmware ==
Once the board boot up, after a couple of seconds of delay, the recovery procedure will start.
 
The script is totally automated and, in case of success, this is the output:
 
If everything was set correctly, this message should appear on your screen
<pre>
C:\devel\lizard\recovery2\windows>uart-recovery.bat COM15transfer the x-loaderWaiting For Device ASIC ID: Press Ctrl+C to stop
ASIC ID Detected.
 
Sending 2ndFile:
 
Downloading file: 100.000% completed(15232/15232 bytes)
 
File download completed.
transfer u-boot
Downloading file: 100.000% completed(221852/221852 bytes)
File Download completed
trasfer u-boot to be stored on flash
In attesa da Waiting for 0 secondi. Premere un tasto per continuareseconds, press a key to continue ...
Downloading fileC: 100\devel\lizard\recovery2\windows>ucmd -p COM15 -c "STOP" -e "=>"Output:Net: davinci_emac_initializeEthernet PHY: GENERIC @ 0x11DaVinci EMAC=>Match Found.000% Operation completed(218792/218792 bytes)!
C:\devel\lizard\recovery2\windows>ucmd -p COM15 -c "mw.w ${buf} 0xFF 0x40000; loadb ${buf} 115200" -e "Ready for binary"
Output:
mw.w ${buf} 0xFF 0x40000; loadb ${buf} 115200
## Ready for binary
Match Found. Operation completed!
Downloading file: 100.000% completed(221852/221852 bytes)
File Download completed
flashing u-boot
Open Serial Console and write this commandWaiting for 0 seconds, press a key to continue ...
C:\devel\lizard\recovery2\windows>ucmd -p COM15 -c "protect off 0x08000000 +40000;era 0x08000000 +40000;cp.b ${buf} 0x08000000 0x40000" -e "Copy to Flash... done"Output:protect off 0x08000000 +40000;era 0x08000000 +40000;cp.b ${buf} 0x08000000 0x40000Un-Protected 2 sectors
.. doneErased 2 sectors"=> mwCopy to Flash..w ${buf} 0xFF 0x40000; loadb ${buf} 115200" .done Match Found.Operation completed! CLOSE Serial Console !!!!!!recovery completed
</pre>
{{ImportantMessage|text=Don't close the '''command prompt'''}}
Now it is necessary to open a serial console for example Putty and type the following command<pre>mw.w ${buf} 0xFF 0x40000; loadb ${buf} 115200</pre> Now close the serial console and press <code>Enter</code> inside the command prompt. A new download will start followed by some instruction messages..<pre>Downloading fileUser can now: 100.000% completed(218792/218792 bytes)File Download completed..Open Serial Console and write this command"=> protect * turn off 0x08000000 +40000;era 0x08000000 +40000;cp.b ${buf} 0x08000000 0x40000""=> res"...</pre>When the  download is finished, you need to reopen the serial console and type this commandboard* restore original dip switch configuration <precode>protect off 0x08000000 +40000;era 0x08000000 +40000;cpS2.b ${buf} 0x08000000 0x40000res2 OFF</precode>Now * power on the board will restart and, if everything went ok, you should again to see the restored U-Boot command line prompt.startup
743
edits

Navigation menu