Difference between revisions of "DESK-XZ7-L/Deployment/Restoring U-Boot on NOR flash"

From DAVE Developer's Wiki
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 8: Line 8:
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000"|2022/11/22
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000"|2022/11/22
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000"|DESK-XZ7-L-1.0.0-rc1 release
 
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000"|DESK-XZ7-L-1.0.0-rc1 release
 +
|-
 +
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000"|2024/01/22
 +
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000"|DESK-XZ7-L-1.0.1 release
 
|-
 
|-
 
|}
 
|}
Line 17: Line 20:
  
 
===Instructions===
 
===Instructions===
First of all, create a bootable microSD card as described [[DESK-XZ7-L/Deployment/Standalone_boot#Program_boot_images_into_SD_card|here]].
+
First of all, create a bootable microSD card as described [[DESK-XZ7-L/Development/Creating_and_building_the_Petalinux_project#Petalinux_build | here]].
  
 
Then, boot the board with the microSD card and stop the automatic boot process of U-Boot in order to access the console.
 
Then, boot the board with the microSD card and stop the automatic boot process of U-Boot in order to access the console.
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
U-Boot 2021.01 (Oct 12 2021 - 09:28:42 +0000)
+
U-Boot 2021.01-desk-xz7-l-1.0.1 (Jan 12 2024 - 10:44:15 +0000)
  
CPU:  Zynq 7z020
+
CPU:  Zynq 7z030
 
Silicon: v3.1
 
Silicon: v3.1
 +
Model: Bora
 
DRAM:  ECC disabled 1 GiB
 
DRAM:  ECC disabled 1 GiB
 
Flash: 0 Bytes
 
Flash: 0 Bytes
Line 34: Line 38:
 
Out:  serial@e0001000
 
Out:  serial@e0001000
 
Err:  serial@e0001000
 
Err:  serial@e0001000
 +
SF: Detected s25fl128s with page size 256 Bytes, erase size 64 KiB, total 16 MiB
 +
SF: Detected s25fl128s with page size 256 Bytes, erase size 64 KiB, total 16 MiB
 +
SOM ConfigID#: 00000004
 +
SOM UniqueID#: 2a0e92c4:03193a4b
 +
CB ConfigID#: ffffffff
 +
CB UniqueID#: ffffffff:ffffffff
 +
SF: Detected s25fl128s with page size 256 Bytes, erase size 64 KiB, total 16 MiB
 +
Warning: MAC addr not found in SPI NOR at block 8
 
Net:
 
Net:
ZYNQ GEM: e000b000, mdio bus e000b000, phyaddr -1, interface rgmii-id
+
ZYNQ GEM: e000b000, mdio bus e000b000, phyaddr 7, interface rgmii-id
 +
 
 +
Warning: ethernet@e000b000 (eth0) using random MAC address - 72:2c:e1:44:08:28
 
eth0: ethernet@e000b000
 
eth0: ethernet@e000b000
Hit any key to stop autoboot:  0
+
Hit ENTER within 2 seconds to stop autoboot
 
Zynq>
 
Zynq>
 
</pre>
 
</pre>
  
====Programming U-Boot from ethernet====
+
====Programming SPI NOR flash from uSD====
Properly define the ethernet configuration parameter:
+
* Initialize and format QSPINOR memory
 +
 
 +
<pre class="workstation-terminal">
 +
Zynq> sf probe
 +
SF: Detected s25fl128s with page size 256 Bytes, erase size 64 KiB, total 16 MiB
 +
Zynq> sf erase 0 0x1000000
 +
SF: 16777216 bytes @ 0x0 Erased: OK
 +
</pre>
 +
 
 +
* Install <code>BOOT.BIN</code> on QSPINOR memory
 +
 
 +
<pre class="workstation-terminal">
 +
Zynq> fatload mmc 0:1 $kernel_addr_r BOOT.BIN
 +
7033004 bytes read in 406 ms (16.5 MiB/s)
 +
Zynq> sf write $kernel_addr_r 0x0 $filesize
 +
device 0 offset 0x0, size 0x6b50ac
 +
SF: 7033004 bytes @ 0x0 Written: OK
 +
</pre>
 +
 
 +
* Install <code>image.ub</code> on QSPINOR memory
 +
 
 +
<pre class="workstation-terminal">
 +
Zynq> mw $kernel_addr_r 0x0 $filesize
 +
Zynq> fatload mmc 0:1 $kernel_addr_r image.ub
 +
4868556 bytes read in 287 ms (16.2 MiB/s)
 +
Zynq> sf write $kernel_addr_r 0x700000 $filesize
 +
device 0 offset 0x700000, size 0x4a49cc
 +
SF: 4868556 bytes @ 0x700000 Written: OK
 +
</pre>
 +
 
 +
* Install <code>boot.scr</code> on QSPINOR memory
 +
 
 +
<pre class="workstation-terminal">
 +
Zynq> mw $kernel_addr_r 0x0 $filesize
 +
Zynq> fatload mmc 0:1 $kernel_addr_r boot.scr
 +
2709 bytes read in 14 ms (188.5 KiB/s)
 +
Zynq> sf write $kernel_addr_r 0xFC0000 $filesize
 +
device 0 offset 0xfc0000, size 0xa95
 +
SF: 2709 bytes @ 0xfc0000 Written: OK
 +
</pre>
 +
 
 +
====Programming SPI NOR flash from ethernet====
 +
* Initialize and format QSPINOR memory
 +
 
 +
<pre class="workstation-terminal">
 +
Zynq> sf probe
 +
SF: Detected s25fl128s with page size 256 Bytes, erase size 64 KiB, total 16 MiB
 +
Zynq> sf erase 0 0x1000000
 +
SF: 16777216 bytes @ 0x0 Erased: OK
 +
</pre>
 +
 
 +
* Properly define the ethernet configuration parameter:
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
Zynq> setenv ipaddr 192.168.0.90
+
Zynq> setenv ipaddr 192.168.0.89
Zynq> setenv serverip 192.168.0.23
+
Zynq> setenv serverip 192.168.0.99
 
</pre>
 
</pre>
  
* download via TFTP the <code>BOOT.BIN</code> binary image. Then, burn them in NOR flash memory:
+
* download via TFTP the <code>BOOT.BIN</code> binary image and write <code>BOOT.BIN</code> on QSPINOR memory
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
Zynq> setenv boot_addr_r 0x1000000
+
Zynq> tftpboot $kernel_addr_r desk-xz7-l/desk-xz7-l-1.0.1_borax_BOOT.BIN
Zynq> tftpboot ${boot_addr_r} desk-xz7/BOOT.BIN
 
 
Using ethernet@e000b000 device
 
Using ethernet@e000b000 device
TFTP from server 192.168.0.23; our IP address is 192.168.0.90
+
TFTP from server 192.168.0.99; our IP address is 192.168.0.89
Filename 'desk-xz7/BOOT.BIN'.
+
Filename 'desk-xz7-l/desk-xz7-l-1.0.1_borax_BOOT.BIN'.
ERROR: reserving fdt memory region failed (addr=3e000000 size=1000000)
+
Load address: 0x2000000
Load address: 0x1000000
+
Loading: #T ################################################################
Loading: #################################################################
+
        #################################################################
...
+
        ...
...
+
        #################################################################
#####################################
+
         #########
         1.7 MiB/s
+
        444.3 KiB/s
 
done
 
done
Bytes transferred = 22149396 (151f914 hex)
+
Bytes transferred = 7033004 (6b50ac hex)
Zynq>
+
Zynq> sf write $kernel_addr_r 0x0 $filesize
 +
device 0 offset 0x0, size 0x6b50ac
 +
SF: 7033004 bytes @ 0x0 Written: OK
 +
</pre>
  
 +
* download via TFTP the <code>image.ub</code> binary image and write <code>image.ub</code> on QSPINOR memory
 +
<pre class="workstation-terminal">
 +
Zynq> mw $kernel_addr_r 0x0 $filesize
 +
Zynq> tftpboot $kernel_addr_r desk-xz7-l/desk-xz7-l-1.0.1_borax_image.ub
 +
Using ethernet@e000b000 device
 +
TFTP from server 192.168.0.99; our IP address is 192.168.0.89
 +
Filename 'desk-xz7-l/desk-xz7-l-1.0.1_borax_image.ub'.
 +
Load address: 0x2000000
 +
Loading: #T ################################################################
 +
        #################################################################
 +
        ...
 +
        #################################################################
 +
        #########################################
 +
        394.5 KiB/s
 +
done
 +
Bytes transferred = 4868556 (4a49cc hex)
 +
Zynq> sf write $kernel_addr_r 0x700000 $filesize
 +
device 0 offset 0x700000, size 0x4a49cc
 +
SF: 4868556 bytes @ 0x700000 Written: OK
 
</pre>
 
</pre>
  
[[BORA_SOM/BORA_Evaluation_Kit/Getting_started/Boot_Configurations|Select the SPI NOR flash as boot device]], remove the microSD card, and reset the board. The board should boot off the NOR flash as shown in the following image.
+
* download via TFTP the <code>boot.scr</code> binary image and write <code>boot.scr</code> on QSPINOR memory
 +
<pre class="workstation-terminal">
 +
Zynq> mw $kernel_addr_r 0x0 $filesize
 +
Zynq> tftpboot $kernel_addr_r desk-xz7-l/desk-xz7-l-1.0.1_borax_boot.scr
 +
Using ethernet@e000b000 device
 +
TFTP from server 192.168.0.99; our IP address is 192.168.0.89
 +
Filename 'desk-xz7-l/desk-xz7-l-1.0.1_borax_boot.scr'.
 +
Load address: 0x2000000
 +
Loading: #T
 +
        0 Bytes/s
 +
done
 +
Bytes transferred = 2709 (a95 hex)
 +
Zynq> sf write $kernel_addr_r 0xFC0000 $filesize
 +
device 0 offset 0xfc0000, size 0xa95
 +
SF: 2709 bytes @ 0xfc0000 Written: OK
 +
</pre>
  
<pre class="workstation-terminal">
+
[[BORA_SOM/BORA_Evaluation_Kit/Getting_started/Boot_Configurations|Select the SPI NOR flash as boot device]], install a rootfs into second partition of microSD card, and reset the board. The board should boot off the NOR flash as shown in the following log.
Zynq> reset
 
resetting ...
 
  
U-Boot 2021.01 (Oct 12 2021 - 09:28:42 +0000)
 
  
CPU:  Zynq 7z020
 
Silicon: v3.1
 
DRAM:  ECC disabled 1 GiB
 
Flash: 0 Bytes
 
NAND:  0 MiB
 
MMC:  mmc@e0100000: 0
 
Loading Environment from SPIFlash... SF: Detected s25fl256s1 with page size 256 Bytes, erase size 64 KiB, total 32 MiB
 
*** Warning - bad CRC, using default environment
 
  
In:    serial@e0001000
 
Out:  serial@e0001000
 
Err:  serial@e0001000
 
Net:
 
ZYNQ GEM: e000b000, mdio bus e000b000, phyaddr -1, interface rgmii-id
 
eth0: ethernet@e000b000
 
Hit any key to stop autoboot:  0
 
</pre>
 
 
<section end=Body/>
 
<section end=Body/>
  

Latest revision as of 11:50, 23 January 2024

History
Issue Date Notes
2022/11/22 DESK-XZ7-L-1.0.0-rc1 release
2024/01/22 DESK-XZ7-L-1.0.1 release


Restoring U-Boot on SPI NOR flash[edit | edit source]

This article describes how to restore U-Boot on SPI NOR flash in case it gets corrupted or it is deleted accidentally.

Instructions[edit | edit source]

First of all, create a bootable microSD card as described here.

Then, boot the board with the microSD card and stop the automatic boot process of U-Boot in order to access the console.

U-Boot 2021.01-desk-xz7-l-1.0.1 (Jan 12 2024 - 10:44:15 +0000)

CPU:   Zynq 7z030
Silicon: v3.1
Model: Bora
DRAM:  ECC disabled 1 GiB
Flash: 0 Bytes
NAND:  0 MiB
MMC:   mmc@e0100000: 0
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In:    serial@e0001000
Out:   serial@e0001000
Err:   serial@e0001000
SF: Detected s25fl128s with page size 256 Bytes, erase size 64 KiB, total 16 MiB
SF: Detected s25fl128s with page size 256 Bytes, erase size 64 KiB, total 16 MiB
SOM ConfigID#: 00000004
SOM UniqueID#: 2a0e92c4:03193a4b
CB ConfigID#: ffffffff
CB UniqueID#: ffffffff:ffffffff
SF: Detected s25fl128s with page size 256 Bytes, erase size 64 KiB, total 16 MiB
Warning: MAC addr not found in SPI NOR at block 8
Net:
ZYNQ GEM: e000b000, mdio bus e000b000, phyaddr 7, interface rgmii-id

Warning: ethernet@e000b000 (eth0) using random MAC address - 72:2c:e1:44:08:28
eth0: ethernet@e000b000
Hit ENTER within 2 seconds to stop autoboot
Zynq>

Programming SPI NOR flash from uSD[edit | edit source]

  • Initialize and format QSPINOR memory
Zynq> sf probe
SF: Detected s25fl128s with page size 256 Bytes, erase size 64 KiB, total 16 MiB
Zynq> sf erase 0 0x1000000
SF: 16777216 bytes @ 0x0 Erased: OK
  • Install BOOT.BIN on QSPINOR memory
Zynq> fatload mmc 0:1 $kernel_addr_r BOOT.BIN
7033004 bytes read in 406 ms (16.5 MiB/s)
Zynq> sf write $kernel_addr_r 0x0 $filesize
device 0 offset 0x0, size 0x6b50ac
SF: 7033004 bytes @ 0x0 Written: OK
  • Install image.ub on QSPINOR memory
Zynq> mw $kernel_addr_r 0x0 $filesize
Zynq> fatload mmc 0:1 $kernel_addr_r image.ub
4868556 bytes read in 287 ms (16.2 MiB/s)
Zynq> sf write $kernel_addr_r 0x700000 $filesize
device 0 offset 0x700000, size 0x4a49cc
SF: 4868556 bytes @ 0x700000 Written: OK
  • Install boot.scr on QSPINOR memory
Zynq> mw $kernel_addr_r 0x0 $filesize
Zynq> fatload mmc 0:1 $kernel_addr_r boot.scr
2709 bytes read in 14 ms (188.5 KiB/s)
Zynq> sf write $kernel_addr_r 0xFC0000 $filesize
device 0 offset 0xfc0000, size 0xa95
SF: 2709 bytes @ 0xfc0000 Written: OK

Programming SPI NOR flash from ethernet[edit | edit source]

  • Initialize and format QSPINOR memory
Zynq> sf probe
SF: Detected s25fl128s with page size 256 Bytes, erase size 64 KiB, total 16 MiB
Zynq> sf erase 0 0x1000000
SF: 16777216 bytes @ 0x0 Erased: OK
  • Properly define the ethernet configuration parameter:
Zynq> setenv ipaddr 192.168.0.89
Zynq> setenv serverip 192.168.0.99
  • download via TFTP the BOOT.BIN binary image and write BOOT.BIN on QSPINOR memory
Zynq> tftpboot $kernel_addr_r desk-xz7-l/desk-xz7-l-1.0.1_borax_BOOT.BIN
Using ethernet@e000b000 device
TFTP from server 192.168.0.99; our IP address is 192.168.0.89
Filename 'desk-xz7-l/desk-xz7-l-1.0.1_borax_BOOT.BIN'.
Load address: 0x2000000
Loading: #T ################################################################
         #################################################################
         ...
         #################################################################
         #########
         444.3 KiB/s
done
Bytes transferred = 7033004 (6b50ac hex)
Zynq> sf write $kernel_addr_r 0x0 $filesize
device 0 offset 0x0, size 0x6b50ac
SF: 7033004 bytes @ 0x0 Written: OK
  • download via TFTP the image.ub binary image and write image.ub on QSPINOR memory
Zynq> mw $kernel_addr_r 0x0 $filesize
Zynq> tftpboot $kernel_addr_r desk-xz7-l/desk-xz7-l-1.0.1_borax_image.ub
Using ethernet@e000b000 device
TFTP from server 192.168.0.99; our IP address is 192.168.0.89
Filename 'desk-xz7-l/desk-xz7-l-1.0.1_borax_image.ub'.
Load address: 0x2000000
Loading: #T ################################################################
         #################################################################
         ...
         #################################################################
         #########################################
         394.5 KiB/s
done
Bytes transferred = 4868556 (4a49cc hex)
Zynq> sf write $kernel_addr_r 0x700000 $filesize
device 0 offset 0x700000, size 0x4a49cc
SF: 4868556 bytes @ 0x700000 Written: OK
  • download via TFTP the boot.scr binary image and write boot.scr on QSPINOR memory
Zynq> mw $kernel_addr_r 0x0 $filesize
Zynq> tftpboot $kernel_addr_r desk-xz7-l/desk-xz7-l-1.0.1_borax_boot.scr
Using ethernet@e000b000 device
TFTP from server 192.168.0.99; our IP address is 192.168.0.89
Filename 'desk-xz7-l/desk-xz7-l-1.0.1_borax_boot.scr'.
Load address: 0x2000000
Loading: #T
         0 Bytes/s
done
Bytes transferred = 2709 (a95 hex)
Zynq> sf write $kernel_addr_r 0xFC0000 $filesize
device 0 offset 0xfc0000, size 0xa95
SF: 2709 bytes @ 0xfc0000 Written: OK

Select the SPI NOR flash as boot device, install a rootfs into second partition of microSD card, and reset the board. The board should boot off the NOR flash as shown in the following log.