Changes

Jump to: navigation, search

Restoring U-Boot on SPI NOR flash (BELK/BXELK)

875 bytes added, 14:38, 23 November 2021
no edit summary
{{Applies To Bora}}
{{Applies To BoraX}}
{{Applies To BoraLite}}
{{InfoBoxBottom}}
__FORCETOC__
<section begin=BELK/>=Introduction=Restoring U-Boot on SPI NOR flash==
This article describes how to restore U-Boot on SPI NOR flash in case it gets corrupted or it is deleted accidentally.
[[File:BELK-NOR-flash-partitioning.png|thumb|center|600px|NOR flash default partitioning scheme]]
===Instructions===First of all, create a bootable microSD card as described [[System boot and recovery via microSD card (BORA_SOM/BELK-L/Development/BXELK)How_to_create_a_bootable_microSD_card|here]].
Then, boot the board with the microSD card and stop automatic boot process of U-Boot in order to access the console.
</pre>
 Download via TFTP the ====Programming U-Boot SPL and from ethernet====Properly define the U-Boot binary images. Then, burn them in NOR flash memory.ethernet configuration parameter:
<pre class="board-terminal">
Bora> setenv ipaddr 192.168.0.8191
Bora> setenv ethaddr 00:50:C2:1E:AF:B3
Bora> setenv serverip 192.168.0.23
</pre> Download via TFTP the U-Boot SPL and the U-Boot binary images. Then, burn them in NOR flash memory:<pre class="board-terminal">Bora> setenv SPL_base 0Bora> setenv u-boot_base 0x40000Bora> setenv update_spl 'sf probe 0 0 0;sf erase ${SPL_base} +${filesize};sf write ${loadaddr} ${SPL_base} ${filesize}'Bora> setenv update 'sf probe 0 0 0;sf erase ${u-boot_base} +${filesize};sf write ${loadaddr} ${u-boot_base} ${filesize}'zynq-uboot> tftpboot ${loadaddr} boraxbora/u-boot/belk-4.1.4_borax_qspi_boot.binGem.e000b000:7 is connected to Gem.e000b000. Reconnecting to Gem.e000b000Gem.e000b000 Waiting for PHY auto negotiation to complete... doneUsing ethernet@Gem.e000b000 deviceTFTP from server 192.168.0.23; our IP address is 192.168.0.8191Filename 'boraxbora/u-boot/belk-4.1.4_borax_qspi_boot.bin'.Load address: 0x20800000x8000000
Loading: ##################
2782.2 MiBKiB/s
done
Bytes transferred = 88876 88940 (15b2c 15b6c hex)
Bora> run update_spl
SF: Detected s25fl128s_64k S25FL256S_64K with page size 256 Bytes, erase size 64 KiB, total 32 MiBSF: Successfully erased 131072 bytes @ 0x0 Erased: OKdevice 0 offset 0x0, size 0x15b2cSF: 88876 program success 89036 bytes @ 0x0 Written: OKBora> tftpboot ${loadaddr} boraxbora/u-boot/belk-4.1.4_borax_qspi_u-boot.imgGem.e000b000:7 is connected to Gem.e000b000. Reconnecting to Gem.e000b000Gem.e000b000 Waiting for PHY auto negotiation to complete... doneUsing ethernet@Gem.e000b000 deviceTFTP from server 192.168.0.23; our IP address is 192.168.0.8191Filename 'boraxbora/u-boot/belk-4.1.4_borax_qspi_u-boot.img'.Load address: 0x20800000x8000000
Loading: #################################################################
################################################################# 2 MiB#### 918 KiB/s
done
Bytes transferred = 577256 683980 (8cee8 a6fcc hex)
Bora> run update
SF: Detected s25fl128s_64k S25FL256S_64K with page size 256 Bytes, erase size 64 KiB, total 32 MiBSF: 589824 Successfully erased 983040 bytes @ 0x40000 Erased: OKdevice 0 offset 0x40000, size 0x8cee8SF: 577256 program success 684100 bytes @ 0x40000 Written: OK
Bora>
</pre>
[[BoraXEVB#Boot_mode_selection_-_S5BORA_Xpress_SOM/BORA_Xpress_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.
<pre class="board-terminal">
Bora> reset
resetting ...
U-Boot SPL 2017.01-belk-4.01.0-rc1 4 (Jul 03 2017 28 2021 - 0123:0015:1811)
qspi boot
Trying to boot from SPI
 U-Boot 2017.01-belk-4.01.0-rc1 4 (Jul 03 2017 28 2021 - 0123:0015:18 11 +0200), Build: belk-4.1.4
Model: Bora
Hit ENTER within 3 seconds to stop autoboot
</pre>
 ===Notes about BELK 3.x.x/BXELK 1.x.x and older===
Until BELK 3.x.x/BXELK 1.x.x, a little bit different partitioning scheme was used. It is illustrated in the following picture.
This is due to the fact that those kits made use of the FSBL. Consquently, the header required by the Zynq'a bootrom and the FSBL binary image were stored at the bottom of the NOR flash. BELK 4.x.x and BXELK 2.x.x and newer are based on U-Boot SPL, instead. The U-Boot SPL binary image includes the header as well. This leads to a different partitioning.
<section end=BELK/>
8,184
edits

Navigation menu