Difference between revisions of "Recovery U-Boot Image (Lizard)"

From DAVE Developer's Wiki
Jump to: navigation, search
(put infobox at top)
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{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 ==
 
== Tool Preparation ==
* Download the [[mirror:lizard/recovery/lizard-recovery.zip|lizard-recovery.zip archive]] and extract it on your Windows PC
+
* Download the zip archive lizard-Recovery.zip and extract it  
* 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 extract the recovery
* Open the command prompt and go inside the folder where you extracted the recovery file
+
* Lunch the uitility with the serial port number
* Launch the utility with the serial port number as the argument
 
 
<pre>
 
<pre>
 
C:\Users\Desktop\lizard-Recovery\lizard> .\uart-recovery.bat COM1
 
C:\Users\Desktop\lizard-Recovery\lizard> .\uart-recovery.bat COM1
</pre>The tools is now waiting for the board to wakeup
+
</pre>
 
+
{{InfoBoxTop}}
 +
{{AppliesToLizard}}
 +
{{AppliesToLizardEVB-Lite}}
 +
{{InfoBoxBottom}}
 
== Board Preparation ==
 
== Board Preparation ==
* Power off the board and set the dip switch <code>S2.2 ON</code> to select serial boot
+
* Power down the board and set the deep switch 2 1 configuration.
* Connect '''UART2''' to your host PC
+
* Connect the serial console to the <ode>PORT2</code> of your board.
* Turn on the board
+
* Turn on the board.
  
 
== Flashing the firmware ==
 
== 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 everithing was set correctly, this messages should appear on your screen
 +
<pre>
  
 +
ASIC ID Detected.
  
<pre>
 
C:\devel\lizard\recovery2\windows>uart-recovery.bat COM15
 
transfer the x-loader
 
Waiting For Device ASIC ID: Press Ctrl+C to stop
 
ASIC ID Detected.
 
 
Sending 2ndFile:
 
Sending 2ndFile:
 +
 
Downloading file: 100.000% completed(15232/15232 bytes)
 
Downloading file: 100.000% completed(15232/15232 bytes)
 +
 
File download completed.
 
File download completed.
transfer u-boot
+
 
Downloading file: 100.000% completed(221852/221852 bytes)
+
In attesa da 0 secondi. Premere un tasto per continuare...
 +
 
 +
Downloading file: 100.000% completed(218792/218792 bytes)
 +
 
 
File Download completed
 
File Download completed
trasfer u-boot to be stored on flash
 
  
Waiting for 0 seconds, press a key to continue ...
+
Open Serial Console and write this command
  
C:\devel\lizard\recovery2\windows>ucmd -p COM15 -c "STOP" -e "=>"
+
.
Output:
 
Net:  davinci_emac_initialize
 
Ethernet PHY: GENERIC @ 0x11
 
DaVinci EMAC
 
=>
 
Match Found. Operation completed!
 
  
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
+
"=> 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
 
  
Waiting 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 0x40000
 
Un-Protected 2 sectors
 
  
.. done
+
CLOSE Serial Console !!!!!!
Erased 2 sectors
 
Copy to Flash... done
 
Match Found. Operation completed!
 
recovery completed
 
 
</pre>
 
</pre>
 +
{{ImportantMessage|text=Don't close the '''command prompt'''}}
  
User can now:
+
Now it is necessary to open a serial console for example Putty and type the following command
* turn off the board
+
<pre>
* restore original dip switch configuration <code>S2.2 OFF</code>
+
mw.w ${buf} 0xFF 0x40000; loadb ${buf} 115200
* power on the board again to see the restored U-Boot startup
+
</pre>
 +
 
 +
Now close the serial console and pres <code>Enter</code> inside the command prompt.
 +
A new download will start follewd by some instructions.
 +
<pre>
 +
Downloading file: 100.000% completed(218792/218792 bytes)
 +
File Download completed
 +
.
 +
.
 +
Open Serial Console and write this command
 +
"=> protect off 0x08000000 +40000;era 0x08000000 +40000;cp.b ${buf} 0x08000000 0x40000"
 +
"=> res"
 +
.
 +
.
 +
.
 +
</pre>
 +
When the download is finished, you need to reopen putty and insert this command
 +
<pre>
 +
protect off 0x08000000 +40000;era 0x08000000 +40000;cp.b ${buf} 0x08000000 0x40000
 +
res
 +
</pre>
 +
Now the board will restart and if everithing went ok, you should see the U-Boot command line prompt.

Revision as of 10:56, 15 March 2018


Tool Preparation[edit | edit source]

  • Download the zip archive lizard-Recovery.zip and extract it
  • Open the command prompt and go inside the folder where you extract the recovery
  • Lunch the uitility with the serial port number
C:\Users\Desktop\lizard-Recovery\lizard> .\uart-recovery.bat COM1
Info Box
Lizard.jpg Applies to Lizard
Lizard-evb-02.png Applies to LizardEVB-Lite

Board Preparation[edit | edit source]

  • Power down the board and set the deep switch 2 1 configuration.
  • Connect the serial console to the <ode>PORT2 of your board.
  • Turn on the board.

Flashing the firmware[edit | edit source]

If everithing was set correctly, this messages should appear on your screen


ASIC ID Detected.

Sending 2ndFile:

Downloading file: 100.000% completed(15232/15232 bytes)

File download completed.

In attesa da 0 secondi. Premere un tasto per continuare...

Downloading file: 100.000% completed(218792/218792 bytes)

File Download completed

Open Serial Console and write this command

.

.

"=> mw.w ${buf} 0xFF 0x40000; loadb ${buf} 115200"

.

.

CLOSE Serial Console !!!!!!
200px-Emblem-important.svg.png

Don't close the command prompt

Now it is necessary to open a serial console for example Putty and type the following command

mw.w ${buf} 0xFF 0x40000; loadb ${buf} 115200

Now close the serial console and pres Enter inside the command prompt. A new download will start follewd by some instructions.

Downloading file: 100.000% completed(218792/218792 bytes)
File Download completed
.
.
Open Serial Console and write this command
"=> protect off 0x08000000 +40000;era 0x08000000 +40000;cp.b ${buf} 0x08000000 0x40000"
"=> res"
.
.
.

When the download is finished, you need to reopen putty and insert this command

protect off 0x08000000 +40000;era 0x08000000 +40000;cp.b ${buf} 0x08000000 0x40000
res

Now the board will restart and if everithing went ok, you should see the U-Boot command line prompt.