0
Elektrický

Where / how can I edit boot environment on the SPI NOR flash on Zero Plus?

Recommended Posts

I'm a newb, so please make allowances if I am a little dumb.
I have SPI NOR boot working on an Orange Pi Zero Plus (H5).  Latest next kernel.  (I've tried the download, and compiled my own).
There is a problem when I power on.  It fails to detect the USB drive.  If I reset the CPU it finds the drive.  If I reboot it finds the drive.
 

resetting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found


I want to try some things in the boot environment settings, but I haven't figured out where to do this.

Can anyone point me in the right direction to modify the environment for this board?
I have a Vagrant build environment set up, so I can compile, but so far I haven't been able to find where these settings are configured

 

Share this post


Link to post
Share on other sites

Thanks martinayotte - it is working now.
 

I'm describing this for other newbs who might struggle to find these things.

Your referenced patch has pointed me to "arch/arm/mach-sunxi/usb_phy.c" which I  found in my Vagrant build environment at "/home/vagrant/armbian/cache/sources/u-boot/<version>/"
The line "static int initial_usb_scan_delay = CONFIG_INITIAL_USB_SCAN_DELAY;" exists so it looks like the referenced patch is now a part of the build.
 

I found the u-boot configs under "/home/vagrant/armbian/cache/sources/u-boot/<version>/configs" and the one for my board is named "orangepizero_plus_defconfig"

cd /home/vagrant/armbian
sudo nano config-default.conf
modify line CREATE_PATCHES="no" to CREATE_PATCHES="yes"

^X y enter to save
 

sudo ./compile.sh
Select your board then enter at the prompts until you reach:
[ warn ] Make your changes in this directory: [ /home/vagrant/armbian/cache/sources/u-boot/]
[ warn ] Press <Enter> after you are done [ waiting ]
 

In a new session - (I used putty, I couldn't do it from the windows command prompt vagrant ssh )

cd /home/vagrant/armbian/cache/sources/u-boot/<version>/configs

sudo nano orangepizero_plus_defconfig
add a line CONFIG_INITIAL_USB_SCAN_DELAY=3000
^X y enter to save

Back to the original session press enter and answer all prompts until compile is complete.
 

diff --git a/configs/orangepizero_plus_defconfig b/configs/orangepizero_plus_defconfig
index 4298f1e..ef14bcb 100644
--- a/configs/orangepizero_plus_defconfig
+++ b/configs/orangepizero_plus_defconfig
@@ -20,3 +20,4 @@ CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_SD_BOOT=y
+CONFIG_INITIAL_USB_SCAN_DELAY=3000

The patch will be in \vagrant\output\patch\u-boot-sunxi64-next.patch

Don't be tempted to edit this file in windows.  It will be corrupted by the line feeds.

Share this post


Link to post
Share on other sites
On 9/15/2018 at 2:38 AM, Elektrický said:

Don't be tempted to edit this file in windows.  It will be corrupted by the line feeds.

 

* Don't use notepad to edit this file in Windows.   Use Notepad++ or another adequate editor, the only ones adding linefeeds date back to MSDOS.  It's not intrinsic to the operating system, it's editor-dependant. 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
0