Jump to content

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


Go to solution Solved by schwar3kat,

Recommended Posts

Posted

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

 

  • Solution
Posted

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.

Posted
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. 

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines