View: 9480|Reply: 53

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-9 21:19:39 | Show all floors
Wait a minute? Why is it only showing my views? :O        https://77.73.70.190/
Published in 2024-2-10 15:09:24 | Show all floors
Hey this blog is not really bad.  I were going to see what else you possess but I don???t have the time I’ll have to look later.        Liz
Published in 2024-2-10 19:00:17 | Show all floors
I’d ought to talk to you here. Which isn’t some thing I usually do! I like reading a post that will get people to believe. Also, appreciate your permitting me to comment!        gps watch for kids
Published in 2024-2-10 21:20:39 | Show all floors
At Zuchi Technologies in Mombasa, we pride ourselves on delivering responsive and user-friendly web development services that cater to the needs of the modern digital landscape. Our expertise in mobile-friendly design, custom web solutions, and SEO optimization ensures our clients' websites stand out in the competitive market. We specialize in e-commerce websites, graphic design services, and website maintenance, all crafted by our team of professional web designers. Our comprehensive approach includes social media integration, digital advertising, and social media marketing strategies, aimed at enhancing our clients' online presence and brand awareness across Coastal Kenya.        Mombasa web development company
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-12 18:57:54 | Show all floors
I adore each of the content, I seriously liked, I would really like details about it, since it is quite very good., Cheers intended for talking over.        gps watch for kids'
Published in 2024-2-12 20:33:24 | Show all floors
Hello Web site owner. I seriously love this writing and also your webpage all in all! That write-up is very clearly written and also without difficulty understandable. Your WordPress design is wonderful as well! Would definitely be excellent to discover where I can get that. Be sure to hold up the great work. We all will need much more this sort of web owners such as you online and much less spammers. Superb mate!        Mombasa Internet Marketing
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list