Rolf Bakker

Members
  • Content Count

    19
  • Joined

  • Last visited

About Rolf Bakker

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I had a hard time to figure out how to set the input pull-up on GPIO 1 of the NanoPi neo2. In the end it appeared to be extremely simple, but in order to help other beginners I like to share how I accomplished it. 1) I created a dts file with the input pull-up definition for GPIO 1 2) I compiled the dts with the "armbian-add-overlay" tool 3) rebooted the NanoPi Neo2 That's it. The dts file can be placed anywhere on the Nanopi Neo2 eg. /home/pi/sun50i-h5-nanopi-neo2-pullup.dts nano /home/pi/sun50i-h5-nanopi-neo2-pullup.dts The content of sun50i-h5-nanopi-neo2-pullup.dts looks like this: /dts-v1/; /plugin/; / { compatible = "allwinner,sun50i-h5"; fragment@0 { target = <&pio>; __overlay__ { input_0: input_0 { pins = "PA1"; function = "gpio_in"; bias-pull-up; }; }; }; }; note that PIN "PA1" = GPIO 1 (BCM) now save the file (press ctrl-x, press y, press enter) start the "armbian-add-overlay" tool sudo armbian-add-overlay /home/pi/sun50i-h5-nanopi-neo2-pullup.dts when the tool finishes, you will have to reboot to apply the changes. That's it, I hope you save some time with this monkey proof explanation. PS: it is easy to convert BCM to PIN, e.g. GPIO 200 (BCM) = PIN "PG8" The letters A - G have the following values A=0, B=1, C=2 ... G=6 The value of the letter must be multiplied by 32, so G = 6x32 = 192 The value behind the letter is added to the value of the letter, in this case for PG8: 192 + 8 = 200 So BCM GPIO 200 is the same pin as PG8. To derive the PIN from BCM you just do it the other way around. e.g. GPIO 6 (BCM) = PIN "PA6" GPIO 201 (BCM) = PIN "PG9"
  2. Sorry, seems to have been a mounting issue after unmounting and remouting the results are very different: root@nanopineo2:~# umount -A /dev/sda1 root@nanopineo2:~# mount /dev/sda1 /SD root@nanopineo2:~# dd if=/dev/zero of=/SD/test.txt bs=512 count=2000 status=progress 2000+0 records in 2000+0 records out 1024000 bytes (1.0 MB, 1000 KiB) copied, 0.0831834 s, 12.3 MB/s root@nanopineo2:~# mount |grep sda /dev/sda1 on /SD type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro) It was previously mounted like this: root@nanopineo2:~# mount |grep sda /dev/sda1 on /SD type vfat (rw,noatime,sync,gid=100,fmask=0002,dmask=0002,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
  3. I'm also experiencing extremely slow USB write speeds (less than 60 kBps) on the NanoPi Neo2 (H5), this seems to be new for me as I don't recall to have this issue with my previous setup. This is how I tested it root@nanopineo2:~# dd if=/dev/zero of=/SD/test.txt bs=512 count=2000 status=progress 1000960 bytes (1.0 MB, 978 KiB) copied, 18 s, 55.6 kB/s 2000+0 records in 2000+0 records out 1024000 bytes (1.0 MB, 1000 KiB) copied, 18.3359 s, 55.8 kB/s Current setup: root@nanopineo2:~# uname -a Linux nanopineo2 4.19.38-sunxi64 #5.86 SMP Sun May 12 18:16:25 CEST 2019 aarch64 aarch64 aarch64 GNU/Linux
  4. There seems to be a bug, source: https://codeyarns.com/2019/05/18/usbmount-not-mounting-problem/ Solution: systemd seems to be the culprit. It sets MountFlags=slave in its systemd-udevd.service file, which causes, the mount operation of usbmount mounting into the namespace of systemd and not to the user. To change this mount option, run this command: sudo systemctl edit systemd-udevd Add these lines to the file: [Service] MountFlags=shared This creates the file /etc/systemd/system/systemd-udevd.service.d/override.conf with the above lines. Restart systemd on your NanoPi Neo2: sudo systemctl daemon-reload sudo service systemd-udevd --full-restart
  5. I'm not worried about the performance, its just simple stuff I'm doing. However, I haven't gotten much further. The information on the web is really thin, maybe its because I lack sufficient background that I don't understand it. U-boot reads the files but somehow the boot sequence ends in an error. I wish there was some sort of tutorial that shows me how I can compile Armbian for read only NFS boot.
  6. My objective is to boot Armbian on my NanoPi Neo2 from a network server. I've got Armbian running on the NanoPi Neo2 and u-boot recognizes the ethernet interface. Also, I have a DHCP server and TFTP server running. If I press space during start-up, I get in the U-boot environment. When I give the dhcp command in the U-boot environment, the NanoPi Neo2 get's an IP address and loads /boot/boot.scr from the network. So, the pre-requisites seem to work fine. But then.... I just can't figure out how to start Armbian (preferrably in read only mode) from the network. Maybe someone can tell me what needs to be done. I've got the following questions: I've already searched on-line for countless hours, but I just don't get it. 1) I think I need to load boot.scr, initrd.img and dtb and somehow start those from the u-boot environment. 2) I think I need to tell the kernel somehow that it needs to boot from the network instead of the SD. 3) I think there is some command /switch that can be set to make Armbian read-only and prevent changes to the system 4) Which files must remain on the SD as a minimum to make netbooting Armbian from U-boot possible? Regards, Rolf
  7. It has been a while but I can confirm that it works. I've seen that U-boot network support is now already included in the default Armbian. Great!
  8. Hi Rami, I've got several NanoPi Neo2 boards and their network connection runs very stable in my experience. Actually, I'm quite happy with these little boards. I've got mine fitted with the standard heatsink from FriendlyElec. Regards, Rolf
  9. I've got a working Vagrant Armbian Build environment. Now I want to add the following to the sun50i-h5-nanopi-neo2.dts (provides network support in U-boot) and compile a new image. &emac { pinctrl-names = "default"; pinctrl-0 = <&emac_rgmii_pins>; status = "okay"; phy = <&phy1>; phy-mode = "rgmii"; phy1: ethernet-phy@1 { reg = <0>; }; }; Despite reading the docs, I still can't figure out how it's done. Maybe someone can point me in the right direction?
  10. ok, I tested from a different machine and it appears that the DHCP server shouldn't provide the fullpath of the filename, but just the path within the tftp folder. After I changed the setting in my DHCP server the file could be loaded. U-Boot 2018.09-rc3-00026-g4cdeda511f-dirty (Sep 10 2018 - 16:37:11 +0200) Allwinner Technology CPU: Allwinner H5 (SUN50I) Model: FriendlyARM NanoPi NEO 2 DRAM: 512 MiB MMC: SUNXI SD/MMC: 0 Loading Environment from FAT... Unable to use mmc 0:1... In: serial Out: serial Err: serial Net: phy interface7 eth0: ethernet@1c30000 starting USB... USB0: USB EHCI 1.00 USB1: USB OHCI 1.0 USB2: USB EHCI 1.00 USB3: USB OHCI 1.0 scanning bus 0 for devices... 1 USB Device(s) found scanning bus 2 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found Hit any key to stop autoboot: 0 => setenv serverip 192.168.188.1 => dhcp BOOTP broadcast 1 BOOTP broadcast 2 BOOTP broadcast 3 DHCP client bound to address 192.168.188.50 (1003 ms) Using ethernet@1c30000 device TFTP from server 192.168.188.1; our IP address is 192.168.188.50 Filename '/boot/boot.scr'. Load address: 0x42000000 Loading: # 1.5 MiB/s done Bytes transferred = 3090 (c12 hex) => One step closer to booting the NanoPi Neo 2 from the network. I think my brain got a bit numb yesterday, by the end of the day Does any one have a u-boot script in combination with Armbian to make this work with NFS?
  11. I'm trying to boot my Nano Pi Neo 2 from the network but I am a bit stuck. I have found out how to add network support to u-boot for the Nano Pi Neo 2, I can set the serverip and perform the dchp command, the Nanopi neo get's an IP address from the DHCP server but then booting halts with the message that it can't find the file. I'm pretty sure the location & access rights are valid. (Is there an easy way to check?) U-Boot 2018.09-rc3-00026-g4cdeda511f-dirty (Sep 10 2018 - 16:37:11 +0200) Allwinner Technology CPU: Allwinner H5 (SUN50I) Model: FriendlyARM NanoPi NEO 2 DRAM: 512 MiB MMC: SUNXI SD/MMC: 0 Loading Environment from FAT... Unable to use mmc 0:1... In: serial Out: serial Err: serial Net: phy interface7 eth0: ethernet@1c30000 starting USB... USB0: USB EHCI 1.00 USB1: USB OHCI 1.0 USB2: USB EHCI 1.00 USB3: USB OHCI 1.0 scanning bus 0 for devices... 1 USB Device(s) found scanning bus 2 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found Hit any key to stop autoboot: 0 => setenv serverip 192.168.188.1 => dhcp BOOTP broadcast 1 BOOTP broadcast 2 BOOTP broadcast 3 DHCP client bound to address 192.168.188.50 (1003 ms) Using ethernet@1c30000 device TFTP from server 192.168.188.1; our IP address is 192.168.188.50 Filename '/nfsshares/tftp/npi/boot/boot.scr'. Load address: 0x42000000 Loading: T TFTP error: 'File not found' (1) Not retrying... => Is there anyone who has experience booting Armbian from the network that can point me in the right direction / perhaps share a working solution?
  12. @Hackbeere How to enable network support in u-boot for the Nano Pi Neo 2. The instructions above use the FriendlyArm repo, the same can be achieved with mainline using a more recent version of u-boot, the procedure is slightly different and described below: In order to enable the network interface for the Nanopi Neo 2 in U-boot you have to take the following steps (works with Ubuntu 18.04): 1) Install the toolchain on a Host PC (Ubuntu) 2) Install some additional software 3) Compile arm-trusted-firmware 3) Install u-boot 4) Make changes to the nanopi neo2 dts file in order to add network capability in U-boot 5) Compile u-boot with the changes 6) Update U-boot on the SD card for the Nanopi Neo 2 Here are some detailed working instructions: Install toolchain on Host PC (Ubuntu) sudo su mkdir -p /opt/FriendlyARM/toolchain/ cd /root wget https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz tar -xf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz -C /opt/FriendlyARM/toolchain/ export PATH=/opt/FriendlyARM/toolchain/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin:$PATH export GCC_COLORS=auto . ~/.bashrc Install additional software on Host PC (Ubuntu) apt install gcc-aarch64-linux-gnu -y apt install git make gcc bison flex -y apt install swig python-dev python3-dev -y apt install device-tree-compiler -y apt install gcc-arm-linux-gnueabihf -y Compile arm-trusted-firmware on Host PC cd /root git clone https://github.com/apritzel/arm-trusted-firmware.git cd arm-trusted-firmware/ git checkout allwinner export CROSS_COMPILE=aarch64-linux-gnu- make PLAT=sun50iw1p1 DEBUG=1 bl31 export BL31=/root/arm-trusted-firmware/build/sun50iw1p1/debug/bl31.bin Compile U-Boot with network support on Host PC cd /root git clone git://git.denx.de/u-boot.git u-boot/ cd u-boot nano arch/arm/dts/sun50i-h5-nanopi-neo2.dts Add to the end &emac { pinctrl-names = "default"; pinctrl-0 = <&emac_rgmii_pins>; status = "okay"; phy = <&phy1>; phy-mode = "rgmii"; phy1: ethernet-phy@1 { reg = <0>; }; }; Compile u-boot make nanopi_neo2_defconfig CROSS_COMPILE=aarch64-linux-gnu- make CROSS_COMPILE=aarch64-linux-gnu- Update U-Boot on SD Card Insert the SD card with the Nanopi Neo 2 official ROM / OS in the cardreader of the host-pc. Check with lsblk where the SD card is with for the Nanopi Neo 2 is located (e.g. sdb) Replace sdX in the following commands with the actual location of the Nanopi Neo 2 SD card. dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8 dd if=u-boot.itb of=/dev/sdX bs=1024 seek=40 sync I hope this helps.
  13. @Hackbeere In order to enable the network interface for the Nanopi Neo 2 in U-boot you have to take the following steps (works with Ubuntu): 1) Install the toolchain on a Host PC (Ubuntu) 2) Install some additional software 3) Install u-boot 4) Make changes to the nanopi neo2 dts file in order to add network capability in U-boot 5) Compile the changes 6) Update U-boot on the SD card for the Nanopi Neo 2 Here are some detailed working instructions: Install toolchain on Host PC (Ubuntu) sudo su mkdir -p /opt/FriendlyARM/toolchain/ cd /root Download gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz from friendlyarm to the current (/root) folder tar -xf gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz -C /opt/FriendlyARM/toolchain/ export PATH=/opt/FriendlyARM/toolchain/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin:$PATH export GCC_COLORS=auto . ~/.bashrc Install some additional software on Host PC (Ubuntu) (as root) apt-get install swig python-dev python3-dev -y apt-get install device-tree-compiler -y apt-get install gcc-arm-linux-gnueabihf -y Download and Compile U-Boot with network support on Host PC (as root) cd /root git clone https://github.com/friendlyarm/u-boot.git cd u-boot git checkout sunxi-v2017.x nano arch/arm/dts/sun50i-h5-nanopi-neo2.dts Add to the end &emac { pinctrl-names = "default"; pinctrl-0 = <&emac_rgmii_pins>; status = "okay"; phy = <&phy1>; phy-mode = "rgmii"; phy1: ethernet-phy@1 { reg = <0>; }; }; Compile make nanopi_h5_defconfig CROSS_COMPILE=aarch64-linux-gnu- make CROSS_COMPILE=aarch64-linux-gnu- Update U-Boot on SD Card Insert the SD card with the Nanopi Neo 2 official ROM / OS in the cardreader of the host-pc. Check with lsblk where the SD card is with for the Nanopi Neo 2 is located (e.g. sdb) Replace sdX in the following commands with the actual location of the Nanopi Neo 2SD card. dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8 dd if=u-boot.itb of=/dev/sdX bs=1024 seek=40 After that you can put the SD card in the Nanopi Neo 2 and the ethernet interface will show up in U-boot.