• Announcements

    • 1. Check power supply, check SD card and check other people experiences

      Power supply issues are one of the three biggest issues you'll face when starting with Single Board Computers (SBCs). SD card issues, whether fake or faulty, are another and issues resulting from poor board design is the other common issues you can encounter.   Power supply issues can be tricky. You might have a noisy power supply that works with one board because it has extra filtering, but won't work with another. Or you're using that cheap phone charger because your board has a microUSB connector, and it is either erratic, or doesn't start up, or even becomes the cause of some SD card issues.    Some tips to avoid the most common causes of problems reported:   Don't power via micro USB  - unless you have optimised your setup for low power requirements. Micro USB is great for mobile phones because they are simply charging a battery. It's bad for SBCs. Yes, it does work for a lot of people, but it also causes more problems and headaches over time than it is worth, unless you know exactly what you are doing. If you have a barrel jack power connector on your SBC, use it instead! If there is an option for powering via header connections, use that option!
        Don't use mobile phone chargers. They might be convenient and cheap, but this is because they are meant for charging phones, not powering your SBC which has particular power requirements.
        When you are evaluating a power supply, make sure you run some stress tests on your system to ensure that it will not cause issues down the path.   (Micro) SD card issues can be sneaky. They might appear right at the start causing strange boot and login errors, or they might cause problems over time. It is best to run a test on any new SD card you use, to ensure that it really is what it is, and to ensure that isn't faulty. Armbian provides you a simple way to do this   --   armbianmonitor -c /path/to/device/to/test  
    • 2. Make sure to collect and provide all necessary information

      We can only help if you provide quality information for us to work with. All stable images from the download section are tested, most stable upgrades are tested and we have tens of thousands of users. Even with regular and extensive testings, bugs sometimes do slip through. This is a voluntary support service and is unrelated to board makers, and is not obligated to provide you any answers. Repeated asking the same questions because you're not happy with the answers will result in you being ignored.

      Before you post a question, use the forum search as someone else might have already had the same problem and resolved it. And make sure you've read the Armbian documentation. If you still haven't found an answer, make sure you include the following in your post:   1. Logs when you can boot the board: armbianmonitor -u (paste URL to your forum post)   2. If your board does not boot, provide a log from serial console or at least make a picture, where it stops.   3. Describe the problem the best you can and provide all necessary info that we can reproduce the problem. We are not clairvoyant or mind readers. Please describe your setup as best as possible so we know what your operating environment is like.     We will not help in cases you are not using stable official Armbian builds, you have a problem with 3rd party hardware or reported problem would not be able to reproduced.

Orange Pi zero NOR Flash
2 2

12 posts in this topic

Recommended Posts

Hello,

 

today I try to recompile armbian and produce some image which can be fited into nor flash. I would like to fit uboot, dtb and kernel into Winbond W25Q128FVSSIG and rootfs into sdcard. So I found some instruction in which I need to modify first kernel and dts (ref. http://linux-sunxi.org/Xunlong_Orange_Pi_Zerochapter SPI NOR flash). For Armbian it is quit difficult, when I issue ./compile.sh than everything regarding to Uboot is cleared. First what I need to do is modify sun8i-h3-orangepi-one.dts with following content

&spi0 {        status = "okay";        flash: m25p80@0 {                #address-cells = <1>;                #size-cells = <1>;                compatible = "winbond,w25q128";                reg = <0>;                spi-max-frequency = <40000000>;        };};

Than I need to modify .config file of Uboot by adding CONFIG_SPI_BOOT=yes. But as I mentioned after issue ./compile.sh everything go back to let we say factory settings. How to workaround this issue to pass through necessary options.

 

Final question is that if all of mentioned modification allows me to manipulate and see /dev/mtd0.

 

Thanks in advanced

Best Regards

Voloviq

Share this post


Link to post
Share on other sites

You don't need to do all this since nightly builds already provides SPI-NOR support. The only thing you have to do is changing the partitions sizes in the current DT :

 

 

 

                spi@01c68000 {
                        compatible = "allwinner,sun8i-h3-spi";
                        reg = <0x1c68000 0x1000>;    
                        interrupts = <0x0 0x41 0x4>;
                        clocks = <0x2 0x1e 0x2 0x52>;
                        clock-names = "ahb", "mod";  
                        dmas = <0x19 0x17 0x19 0x17>;
                        dma-names = "rx", "tx";   
                        pinctrl-names = "default";
                        pinctrl-0 = <0x1a>;
                        resets = <0x2 0xf>;
                        status = "okay";
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;   
                        linux,phandle = <0x4c>;
                        phandle = <0x4c>;

                        spi-flash@0 {
                                #address-cells = <0x1>;
                                #size-cells = <0x0>;
                                compatible = "jedec,spi-nor";
                                reg = <0x0>;
                                spi-max-frequency = <0x989680>;
                                status = "okay";

                                partitions {
                                        compatible = "fixed-partitions";
                                        #address-cells = <0x1>;
                                        #size-cells = <0x1>;

                                        partition@0 {
                                                label = "uboot";
                                                reg = <0x0 0x100000>;
                                        };

                                        partition@100000 {
                                                label = "env";
                                                reg = <0x100000 0x100000>;
                                        };

                                        partition@200000 {
                                                label = "data";
                                                reg = <0x200000 0x200000>;
                                        };
                                };
                        };
                };

 

 

 

You will see the MTD partitions by doing "cat /proc/mtd", and you can use flashcp from mtd-utils to write to /dev/mtd0.

awef likes this

Share this post


Link to post
Share on other sites

Thanks Martinayotte,

 

I newbie in Armbian compilation, can You explain me how to compile nightly build in Armbian and which exactly ?.dts needs to be modified.

 

Regarding Your final sentence I understand that it is possible fit kernel, uboot and dtb into spi nor flash. Am I right?

 

Thanks,

Regards

Voloviq

Share this post


Link to post
Share on other sites

today I try to recompile armbian and produce some image which can be fited into nor flash. I would like to fit uboot, dtb and kernel into Winbond W25Q128FVSSIG and rootfs into sdcard. So I found some instruction in which I need to modify first kernel and dts (ref. http://linux-sunxi.org/Xunlong_Orange_Pi_Zerochapter SPI NOR flash).

Right now you won't be able to use DT and kernel from the SPI flash since there is no SPI driver or SPL FIT image support in u-boot. These instructions are for having only the u-boot in the SPI flash.

I'm not saying this is completely impossible, but you will need to put significant effort into finding and applying additional patches to the u-boot and it's up to you to do that work.

 

For Armbian it is quit difficult, when I issue ./compile.sh than everything regarding to Uboot is cleared.

The Armbian documentation was made and linked from the project page for a good reason.

Share this post


Link to post
Share on other sites

Hello zador.blood.stained

 

yes You have completely right my question was really silly. After study short build documentation everything start to be easy.  Now I understand why uboot and kernel are cleared after issue only ./compile.sh. Nevertheless which option I should use together with ./compile.sh to keep changed configuration for kernel and uboot?

 

Do compilation don't clean current configuration of kernel and uboot after issue following

 

./compile.sh CLEAN_LEVEL=images KERNEL_KEEP_CONFIG=yes

 

Thanks

Regards

Voloviq

Share this post


Link to post
Share on other sites

Hello martinayote

 

It seems to that in current system don't exist *.dtb or *.dts file. Instead of it exist script.bin which can be convert to *.fex. After conver *.fex file is somehow similar to *.dts. Unfortunately I don't now this standard. I understand what You wrote regarding to DT, and any modification in DT are easy. Usually I made modification of dts but not on working system, I just recompile it and write in host on sdcard. So how can I provide modification pointed by You into *.fex file and again compile *.fex to script.bin.

 

Thanks

Regards

Voloviq

Share this post


Link to post
Share on other sites

First, you don't need to recompile anything for the Orange Pi Zero & Armbian. If for some reason you chose the mainline/dev kernel, SPI flash support is already enabled both in the kernel and u-boot - check your dmesg log and presence of /dev/mtd* device nodes.

 

Second, in order to adjust partition sizes as per @martinayotte's post you can use dtc - device tree compiler on the board itself, you can search the forum for the instructions or just read the man page for dtc. Also please note that DT file name for Orange Pi Zeo is sun8i-h2plus-orangepi-zero.dtb

 

And third, as I said before, even if you adjust partition sizes you will be able to access data from the kernel but not from the u-boot, at least without additional patches or non-standard hacks (SPL FIT support, experimental u-boot H3 SPI driver), which were not tested and are not documented well enough yet because all this is work-in-progress and is subjected to change at any time before it is accepted in the mainline.

Share this post


Link to post
Share on other sites

Thanks zador,

 

Your answer is very comprehensive. Small summarize what I made.

First updated to nightly build

 

 

sed -i "s/apt/beta/" /etc/apt/sources.list.d/armbian.list
apt-get update
apt-get upgrade

 

 

Than I make a reboot, connect oscilloscope to pin 6 of nor flash to check clock. After two reboots I noticed nothing on clock pin as well on others pins. This means that nightly build have no DTS default support for NOR flash, Am I right?

 

So I focus my efforts now to recompile dts, fex to add lines mentioned by martinayotte. IMHO without change dts I have no chance to see mtd.

 

Linux version after update

 

Linux orangepizero 3.4.113-sun8i #50 SMP PREEMPT Thu Feb 16 03:00:06 CET 2017 armv7l

 

Regards

Voloviq

Share this post


Link to post
Share on other sites

First, from what I'm aware, only Mainline kernel support SPI-NOR, so Legacy won't work.

Second, the clock on the chip is only present during transactions and idle the rest of the time, so connecting an oscilloscope is a bit useless since during boot the only transaction happening is the JEDEC ID query which last only few microseconds.

Third, DTS is only use in Mainline. Legacy is using FEX, but again no SPI-NOR support in Legacy.

Share this post


Link to post
Share on other sites

Linux version after update

 

Linux orangepizero 3.4.113-sun8i #50 SMP PREEMPT Thu Feb 16 03:00:06 CET 2017 armv7l

That is what you needed to start with. These instructions don't apply for the legacy kernel. You can use flashrom on /dev/spidev0.0 to read/write flash contents.

Share this post


Link to post
Share on other sites

Hello Guys,

 

thank You both. Now I see where I made a mistake. Regarding oscilloscope I mean that during kernel boot up it checks connected devices (NOR - jedec discover at least). Yes of course that if nothing is requested from flash nothing will happen on pins.

 

So thank You for support my efforts. I'll keep You inform.

 

Thanks a lot

Best Regards

Volvoiq

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

2 2

  • Support the project

    We need your help to stay focused on the project.

    Choose the amount and currency you would like to donate in below.