View: 28640|Reply: 37

Orange pi 5b u-boot

[Copy link]

1

threads

3

posts

19

credits

Novice

Rank: 1

credits
19
Published in 2023-10-31 21:29:39 from mobile | Show all floors |Read mode

When eMMC is programmed with ubuntu os using any programming method such as rkdevtool or through dd commanf, then if empty sd is inserted the board will not boot. If sd is removed the board boot normally. I think sd has priority over emmc, but why bootloader does not neglect empty sd and select the next boot device which is emmc?
In x86 systems, the boot devices are checked sequentially and the system starts once a valid boot device is found!


1

threads

3

posts

19

credits

Novice

Rank: 1

credits
19
 Author| Published in 2023-11-2 15:23:41 from mobile | Show all floors
Further investigation using serial debug show that SPL bootloader is executed normally from the emmc, however the bootloader later try to boot from the SD and fails without trying further the next boot device which should be the emmc

1

threads

3

posts

19

credits

Novice

Rank: 1

credits
19
 Author| Published in 2023-11-3 16:37:00 | Show all floors
I found the solution after some time.
Orange pi 5B and other boards based on some Rockchip CPU have a booting issue.
When the eMMC is flashed with ubuntu (or other OS such as armbian as I believe), then if a blank SD is inserted, the board will not boot.
Investigation of the problem through serial debug cable show that the bootloader select SD as the first boot device,
and try to boot from it. Since there is no valid image, the system will panic and just halt. On x86 systems, the bootloader will
fallback to the next boot device.

The problem is related to the module "config_distro_bootcmd.h" in the u-boot section which contains boot steps.
The system tries to boot from the SD without checking whether it has a valid imag or not.
A quick and solid solution is to patch this moudle and rebuilt the u-boot. The following steps are used to solve the problem:

1. On the development Linux PC, such as virtual machine, with updated ubuntu, create a directory on the home/user folder

  1. mkdir $HOME/orangepi
  2. cd orangepi
  3. git clone https://github.com/orangepi-xunlong/orangepi-build.git -b next
  4. cd orangepi-build
Copy code


2. Run build script to install the required files:
  1. sudo ./build.sh
Copy code


then select u-boot only and select board type (ornage pi 5B in my case)

Note: build.sh will install the required cross compile toolchain and source files when it runs first time.

3. To enable code editing without comparing with the git, edit the following file :
sudo nano userpatches/config-default.conf
set:
  1. IGNORE_UPDATES="yes"
Copy code


4. Edit the following file using gedit or any other editor with root permission
$HOME/orangepi/orangepi-build/u-boot/v2017.09-rk3588/include/config_distro_bootcmd.h

Change line 81 from: "if mmc dev 0; then "        \
to:                  "if mmc dev 0 && rkimgtest mmc 0; then "        \

This will force the bootloader to check if there exist a valid image on the SD or not.
I know this solution may be insuitable for other brands, but, of course, it can be applied for all Rockchip boards.
Developers of other boards may implement their checking moudle.

5. repeat building process:
  1. sudo ./build.sh BOARD=orangepi5b BRANCH=legacy BUILD_OPT=u-boot KERNEL_CONFIGURE=no
Copy code


6. Copy the generated deb package from output directory: orangepi-build/output/debs/u-boot to the home directory of the target board.

7. Install generated linux-u-boot-legacy-orangepi5b_1.0.8_arm64.deb package to the target board

Important: Remove the SD from the board,
power cycle ornage pi 5B and login using terminal emulator, then issue:

  1. sudo apt purge -y linux-u-boot-orangepi5b-legacy
  2. sudo dpkg -i linux-u-boot-legacy-orangepi5b_1.0.8_arm64.deb
  3. sudo nand-sata-install
Copy code

When asked select : 5 Install/Update the bootloader on SD/eMMC
it will update the u-boot section on the eMMC.

Note: orange pi 5B has no SPI flash. u-boot is stored in eMMC or SD.
Published in 2024-2-10 22:51:58 | Show all floors
Nice post. I discover some thing harder on distinct blogs everyday. Most commonly it is stimulating to see content from other writers and use something there. I’d opt to apply certain together with the content on my blog whether or not you don’t mind. Natually I’ll provide link on your own internet weblog. Many thanks for sharing.        [url= https://mtdn.net]사설토토 먹튀검증[/url]
Published in 2024-2-15 22:52:00 | Show all floors
Hi are using Wordpress for your site platform? I’m new to the blog world but I’m trying to get started and create my own. Do you need any coding expertise to make your own blog? Any help would be greatly appreciated!        안전 토토사이트
Published in 2024-2-17 22:30:44 | Show all floors
of course like your web site but you need to check the spelling on several of your posts. Many of them are rife with spelling problems and I to find it very bothersome to inform the truth on the other hand I will surely come again again.        tdtc.tips
Published in 2024-2-21 20:08:35 | Show all floors
Youre so cool! I dont suppose Ive read anything similar to this just before. So nice to find somebody with original ideas on this subject. realy we appreciate you starting this up. this fabulous website is one thing that is required online, a person with some originality. beneficial job for bringing interesting things for the internet!        Astrologism
Published in 2024-2-24 21:32:53 | Show all floors
I’m impressed, I have to admit. Genuinely rarely should i encounter a blog that’s both educative and entertaining, and without a doubt, you’ve got hit the nail for the head. Your thought is outstanding; the problem is a thing that there are not enough everyone is speaking intelligently about. My business is happy i found this in my hunt for some thing regarding this.        knives
Published in 2024-3-2 19:48:05 | Show all floors
I really love the way information is presented in your post. I have added you in my social bookmark. Cheers.        bongdaso.lol
Published in 2024-3-5 21:38:27 | Show all floors
Oopsmight have spoken too soon.  Young teams dont know how to play late in games, especially playoff games.  Total self-destruction.  Can they now learn to win?  Go Cs.        kubet
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list