Jump to content

chradev

Members
  • Posts

    224
  • Joined

  • Last visited

Everything posted by chradev

  1. Thanks Arox, I will give it a try but it will be another daemon consuming resources. My idea is to use already existing one like udev if possible. I am not sure if udev is a solution at all and that is why I made a test with key code 116 (used for system shutdown) and someone (don't know who!) is doing the job as expected. Best regards, Chris
  2. Hi to All, I am needing a GPIO connected button to run some shell script on Lime2-eMMC under customized by me Armbian with mainline Kernel. The button is connected to PG0 and worked fine till now using daemon script and sysfs. After setting up LED control via the mainline Kernel LED driver I have decided to use its 'gpio-keys' support for the button. I have added in Kernel configuration: CONFIG_KEYBOARD_GPIO=y CONFIG_KEYBOARD_GPIO_POLLED=y and / { egpr-keys { compatible = "gpio-keys-polled"; poll-interval = <100>; pinctrl-names = "default"; pinctrl-0 = <&egpr_sys_key_pins>; reboot { label = "reboot-key"; gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; linux,code = <200>; }; }; }; &pio { egpr_sys_key_pins: sys_key_pins@0 { allwinner,pins = "PG0"; allwinner,function = "gpio-in"; allwinner,drive = <SUN4I_PINCTRL_10_MA>; allwinner,pull = <SUN4I_PINCTRL_PULL_UP>; }; }; to Device Tree and get /dev/input/event0. Here "gpio-keys-polled" is used because PG0 cannot generate interrupt. I have tested it: root@egpr:~# evtest /dev/input/event0 Input driver version is 1.0.1 Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100 Input device name: "egpr-keys" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 256 (BTN_0) Properties: Testing ... (interrupt to exit) Event: time 1476670337.034565, type 1 (EV_KEY), code 256 (BTN_0), value 1 Event: time 1476670337.034565, -------------- EV_SYN ------------ Event: time 1476670338.244566, type 1 (EV_KEY), code 256 (BTN_0), value 0 Event: time 1476670338.244566, -------------- EV_SYN ------------ and found it is working. Command 'udevadm info --query=all --name=/dev/input/event0 --attribute-walk' prints: Udevadm info starts with the device specified by the devpath and then walks up the chain of parent devices. It prints for every device found, all possible attributes in the udev rules key format. A rule to match, can be composed by the attributes of the device and the attributes from one single parent device. looking at device '/devices/platform/egpr-keys/input/input0/event0': KERNEL=="event0" SUBSYSTEM=="input" DRIVER=="" looking at parent device '/devices/platform/egpr-keys/input/input0': KERNELS=="input0" SUBSYSTEMS=="input" DRIVERS=="" ATTRS{uniq}=="" ATTRS{properties}=="0" ATTRS{min}=="0" ATTRS{max}=="100" ATTRS{phys}=="gpio-keys-polled/input0" ATTRS{poll}=="100" ATTRS{name}=="egpr-keys" looking at parent device '/devices/platform/egpr-keys': KERNELS=="egpr-keys" SUBSYSTEMS=="platform" DRIVERS=="gpio-keys-polled" ATTRS{driver_override}=="(null)" looking at parent device '/devices/platform': KERNELS=="platform" SUBSYSTEMS=="" DRIVERS=="" I have created '/etc/udev/rules.d/72-egpr-key-event.rules' file with the following content: ACTION=="add", SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="egpr-keys", RUN+="/root/run.sh" where /root/run.sh prints "Hello" to /dev/ttyS0. The script is executed only once when GPIO is initialized by the driver. Changing 'linux,code' to 116 for shutting the system down is working as expected without matter what is the content of udev rules file. Can somebody help me to run a shell script when button is pushed using above Kernel and Device Tree setup. Thanks in addvance Chris
  3. Hi to All, These days I have received front panel and the board with a view buttons and RGB LEDs. For controlling the LEDs I choose to use the Mainline Kernel LED driver so configure them in Device Tree. To make a difference between system and user DTB staff I have added (with a patch in userpatches/kernel/sunxi-next): * include directive in sun7i-a20-olinuxino-lime2-emmc.dts file #include "sun7i-a20-olinuxino-lime2-emmc-egpr.dts" * main user DTB staff in file sun7i-a20-olinuxino-lime2-emmc-egpr.dts: The staff is working fine except the 'linux,default-trigger = "timer";' directive. The problem is that the Kernel is set to support LED timer trigger as module making impossible to start triggering early in the boot process. That is why I have to reconfigure Kernel and the best option was to use my own linux-sunxi-next.config file in userpatches directory. For doing the things in a right way I have used following procedure: * set in compile.sh file: KERNEL_ONLY="yes" KERNEL_CONFIGURE="yes" * when get to kernel configuration I have change in drivers -> leds -> triggers 'timer' support from module to built-in and save configuration to my.config; * then move my.config to userpatches/linux-sunxi-next.config; * restore compile.sh file and rebuild everything. As a result the green LED starts blinking early at the boot process. To make it better I have added to boot.scr: gpio set 193; lighting the green LED from U-Boot. Later on I have added in firstrun file: echo none > /sys/class/leds/egpr-sys\:blue\:usr/trigger echo none > /sys/class/leds/egpr-sys\:green\:usr/trigger echo timer > /sys/class/leds/egpr-sys\:red\:usr/trigger getting the red LED to blink while the firstrun script is working at fist run after updating. For getting better illumination reflecting the system activity I have also added to /etc/rc.local: /bin/echo default-on > /sys/class/leds/egpr-sys\:green\:usr/trigger /bin/echo cpu0 > /sys/class/leds/egpr-sys\:red\:usr/trigger /bin/echo cpu1 > /sys/class/leds/egpr-sys\:blue\:usr/trigger I have also added to my 'rebootd' daemon: echo none > /sys/class/leds/egpr-sys\:blue\:usr/trigger echo none > /sys/class/leds/egpr-sys\:green\:usr/trigger echo timer > /sys/class/leds/egpr-sys\:red\:usr/trigger forcing the red LED to blink in case of reboot button is pushed. Later on I am planing to blink the blue system LED while eMMC and/or SSD devices are updated with new firmware like the blue LED from other group when STM32F405 firmware is updated. The prompt progress indication is very important in case of completely none interactive update procedures because the planned embedded system will not have a console or other user control except application web interface and front panel LEDs. Best regards Chris
  4. Hi to All, After findings that overlayroot initialization is invoked in initram disk I have tried to make use of it in Jessie build by running: cd /boot && ln -sf initrd.img-4.7.6-sunxi initramfs-linux.img and after rebooting following is printed: ## Flattened Device Tree blob at 43000000 Booting using the fdt blob at 0x43000000 Loading Ramdisk to 49b93000, end 49fff18f ... OK Loading Device Tree to 49b84000, end 49b92f95 ... OK Starting kernel ... Uncompressing Linux... done, booting the kernel. Loading, please wait... Begin: Loading essential drivers ... done. Begin: Running /scripts/init-premount ... done. Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done. Begin: Running /scripts/local-premount ... Scanning for Btrfs filesystems done. Begin: Will now check root file system ... fsck from util-linux 2.25.2 fsck: error 2 (No such file or directory) while executing fsck.ext4 for /dev/sda1 fsck exited with status code 8 done. Warning: File system check failed but did not detect errors mount: No such file or directory done. Target filesystem doesn't have requested /sbin/init. Begin: Running /scripts/local-bottom ... done. Begin: Running /scripts/init-bottom ... trap: EXIT: bad trap Warning: overlayroot: debug is busted mount: No such file or directory done. Could not copy file: No such file or directory No init found. Try passing init= bootarg. Rebooting automatically due to panic= boot argument and the system continuously reboots itself. Trying the same on a build without overlayroot installed the situation is the almost the same: ## Flattened Device Tree blob at 43000000 Booting using the fdt blob at 0x43000000 Loading Ramdisk to 49c25000, end 49fff4cd ... OK Loading Device Tree to 49c16000, end 49c24f95 ... OK Starting kernel ... Uncompressing Linux... done, booting the kernel. Loading, please wait... Begin: Loading essential drivers ... done. Begin: Running /scripts/init-premount ... done. Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done. Begin: Running /scripts/local-premount ... Scanning for Btrfs filesystems done. Begin: Will now check root file system ... fsck from util-linux 2.25.2 [/sbin/fsck.ext4 (1) -- /dev/mmcblk1p1] fsck.ext4 -a -C0 /dev/mmcblk1p1 /dev/mmcblk1p1: clean, 64029/228928 files, 291923/895744 blocks done. mount: No such file or directory done. Target filesystem doesn't have requested /sbin/init. Begin: Running /scripts/local-bottom ... done. Begin: Running /scripts/init-bottom ... mount: No such file or directory done. Could not copy file: No such file or directory No init found. Try passing init= bootarg. Rebooting automatically due to panic= boot argument In my opinion there is some problem in default initram disk staff causing system panic and reboot. On the other hand one of the problems in overlayroot is trying to use not existing 'overlayfs' module instead of existing 'overlay' one. Last one is very rough difference with Kernel module name which is unlikely to be simply bug. Does somebody knows working solution using overlayroot? Best egards Chris
  5. Hi to All, As Igor recommended I start looking into overlayroot package staff. After a brief search I find that overlayroot is looking for overlayfs Kernel module which do not exists (trying with modeprobe). In my experience the Kernel module is 'overlay' instead of 'overlayfs' and probably this is a problem. On the other hand in overlayroot script '/usr/share/initramfs-tools/scripts/init-bottom/overlayroot' can be read: # overlayroot_driver *could* be defined in one of the configs above # but we're not documenting that. overlayroot_driver=${overlayroot_driver:-overlayfs} I try to put in /etc/overlayroot.config following line: overlayroot_driver="overlay" and add 'overlay' to /etc/modules abut without success in activating overlayroot. May be it is related with initrd image usage for early preparation to mount of overlayed root. By default it is not loaded because U-Boot searches for /boot/initramfs-linux.img file. It is rising a question is there any special reason for the lack of the link to initrd.img-4.7.6-sunxi in /boot directory? That why I make appropriate link: cd /boot && ln -sf initrd.img-4.7.6-sunxi initramfs-linux.img and reboot. After loading the initram disk following messages can be read: Begin: Running /scripts/init-bottom ... Warning: overlayroot: debug is busted Warning: overlayroot: configuring overlayroot with mode=tmpfs opts='' per /dev/mmcblk0p1/etc/overlayroot.conf Failure: overlayroot: missing kernel module overlayfs /scripts/init-bottom/plymouth: line 18: /bin/plymouth: not found which shows that overlayroot is looking for overlayfs kernel module but it is missing. Even 'overlay' module is missing in initram disk image. On the other hand it looks for overlayroot.conf file on /dev/mmcblk0p1/etc/ which may be a problem when booting from other device (eMMC, SSD etc.). Did somebody have such a problem and find a proper solution? Best regards Chris
  6. Thanks Igor, I have just do that - armbian-firmware is installed by default and linux-firmware removed. After removing linux-firmware rt2870.bin disappears. rt2870.bin do not exists in clean Armbian build (with armbian-firmware installed) with both Jessie and Xenial. Long time ago it was there but after some changes (discussed with you) rt2870.bin disappears from armbian-firmware for some reasons. Best regards Chris
  7. Thanks Igor, I have already used overlayfs to merge both RO and RW staff in a single directory used by our application. It was very easy to setup and it is working perfect. Unfortunately, overlaying the root fs is more troublesome that is why I prefer to rely on a working and reliable solution. Is it possible to use btrfs or bindfs as alternative of overlayfs to make root fs read only? Best regards Chris
  8. Thanks Igor, I have removed linux-firmware installed by me but rt2870.bin disappears: [ 13.001756] ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin' [ 13.012379] rt2800usb 2-1:1.0: Direct firmware load for rt2870.bin failed with error -2 [ 13.012419] rt2800usb 2-1:1.0: Falling back to user helper [ 13.021501] ieee80211 phy0: rt2x00lib_request_firmware: Error - Failed to request Firmware [ 21.727240] ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin' [ 21.727333] rt2800usb 2-1:1.0: Direct firmware load for rt2870.bin failed with error -2 [ 21.727346] rt2800usb 2-1:1.0: Falling back to user helper [ 21.734321] ieee80211 phy0: rt2x00lib_request_firmware: Error - Failed to request Firmware The situation is the same in Jessie build that is why I have added 'firmware-ralink' in lib.config. I have reported this problem long time ago but it is still there. Best regards Chris
  9. Hi Igor, I have tried to get overlayroot working with migration from Jessie to Xenial. Unfortunately, the result is the same with a difference that overlayroot exists as a package in Ubuntu Xenial distribution. Any ideas what is wrong? Best regards Chris
  10. Hi to All, I have solved the issue with USB WiFi adapter. Required rt2870.bin file is in Ubuntu Xenial package 'linux-firmware'. Unfortunately, installing 'linux-firmware' package has conflicts with 'armbian-firmware' one: Unpacking linux-firmware (1.157.3) ... Replaced by files in installed package armbian-firmware (5.21) ... Setting up linux-firmware (1.157.3) ... The other issue is the lack of /etc/udev/rules.d/70-persistent-net.rules file. Unfortunately, its creating as empty file did not help and the following lines have to be added: # USB device 0x:0x (rt2800usb) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0f:60:08:5c:8e", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0" In my opinion /etc/udev/rules.d/70-persistent-net.rules file has to be supplied by the build and filled automatically by udev daemon so what is wrong? After manual installing and setting WiFi AP start working fine. Not installed at Armbian build PHP FPM package in Ubuntu Xenial is 'php7.0-fpm' (instead of 'php5-fpm') and after its installation following changes have to be made: sed -i 's/cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php/7.0/fpm/php.ini in /etc/nginx/sites-enabled/default file: fastcgi_pass unix:/run/php/php7.0-fpm.sock; # instead of fastcgi_pass unix:/var/run/php5-fpm.sock; and 'nginx' has to be restarted. After that nginx fast cgi php extension woks fine. Not solved but found issues are: failing patch of /etc/rsyslog.conf file for removing messages like: rsyslogd-2007: action 'action 9' suspended, next retry is Fri Oct 7 00:07:44 2016 [v8.16.0 try http://www.rsyslog.com/e/2007 ] time zone is not set and UTC is used instead; free and available memory is not reported by RPI Monitor Status page: Used: NaNkB (NaN%) Available: NaNkB Total: 1000.91MB available memory is not reported in Memory Chart of RPI Monitor Statistics pageAnd most important issue not working overlayroot is still there. More fixes and test will be done and reported. Best regards Chris
  11. Hi to All, Unfortunately, migration from Jessie to Xenial for getting overlayroot working did not finished with success 'out of the box'. Procedure as described in Igor's post was done successfully but root fs was not overlay-ed as expected and 'mount' prints: /dev/mmcblk0p1 on / type ext4 (rw,relatime) 'overlayroot-chroot' command is printing an error: ERROR: Unable to find an overlayroot filesystem like in Jessie build with manually installed Ubuntu Xenial overlayroot package. Any ideas what is wrong? Best regards Chris
  12. Thanks Zador, I hope so. For now the good news is that: Ubuntu 16.04.1 LTS egpr ttyS0 egpr login: root Password: _ _ ____ __ __ __ __ ____ | | (_)_ __ ___ ___ |___ \ ___| \/ | \/ |/ ___| | | | | '_ ` _ \ / _ \ __) | / _ \ |\/| | |\/| | | | |___| | | | | | | __/ / __/ | __/ | | | | | | |___ |_____|_|_| |_| |_|\___| |_____| \___|_| |_|_| |_|\____| Welcome to ARMBIAN Ubuntu 16.04.1 LTS 4.7.6-sunxi System load: 1.81 Up time: 37 sec Memory usage: 4 % of 1000Mb IP: 192.168.1.100,192.168.2.1 CPU temp: 28°C HDD temp: 40°C Usage of /: 34% of 3.5G storage/: 4% of 50G Battery: 99% charging eMMC and Ethernet have been recognized and work fine. USB WiFi adapter is seen as USB device but 'wlan0' interface is not installed. In boot messages can be seen following line: rt2800usb 2-1:1.0 wlx000f60085c8e: renamed from wlan0 and cannot be seen: ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin' ieee80211 phy0: rt2x00lib_request_firmware: Info - Firmware detected - version: 0.29 ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 5390, rev 0502 detected ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 5370 detected ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin' ieee80211 phy0: rt2x00lib_request_firmware: Info - Firmware detected - version: 0.29 probably because of firmware-ralink package lack. The other good news is that all my application staff is working even RPI Monitor incl. DS18B20 temperature sensor connected as One Wire device: Processor: ARMv7 Processor rev 4 (v7l) Distribution: Ubuntu 16.04.1 LTS Kernel version: Linux 4.7.6-sunxi armv7l Firmware: #1 Package(s): 0 upgradable(s) but with error in memory status: Used: NaNkB (NaN%) Available: NaNkB Total: 1000.91MB while 'top' utility print right figures: KiB Mem : 1024928 total, 834412 free, 51852 used, 138664 buff/cache I will continue with fixing the mentioned issues and will report the progress later on. Best regards Chris
  13. Thanks Zador, That was the reason. There ware 2 additional packages (firmware-ralink php5-fpm) probably missing in Ubuntu or with other names. There ware errors printed for that in debootstrap stage I am neglecting. Probably this is breaking the process. After removing another package (cryptsetup) was printed to be broken. This package is required by overlayroot so I have to remove it as well. Unfortunately, installation of working overlayroot is the reason to migrate to Xenial but this is another issue has to be fighting with. Fortunately, the build is finished but without executing of customization tasks because I forget to change case from jessie to xenial in my customize-image.sh. Of course my customization staff has to be verified and copied to different xenial case later on. Finally, customization staff has been executed with a few not so important errors for now so I am eager to test if main application staff is working. Thanks again and best reagrsd Chris
  14. Hi to All, Trying to use overlayfs to make root fs read only and unavailability of overlayroot Debian package as described here take me to decision to build customized by me Armbian with Ubuntu Xenial instead of Debian Jessie. I start clean build in new directory but process stopped with error at compiling of temper: [ o.k. ] Applying distribution specific tweaks for [ xenial ] sed: can't read /armbian/2016-10-06/output/cache/sdcard/etc/ssh/sshd_config: No such file or directory [ o.k. ] Applying common tweaks [ o.k. ] Installing kernel [ linux-image-next-sunxi ] [ o.k. ] Installing u-boot [ linux-u-boot-next-lime2-emmc ] [ o.k. ] Installing headers [ linux-headers-next-sunxi ] [ o.k. ] Installing generic firmware [ armbian-firmware ] [ o.k. ] Installing DTB [ linux-dtb-next-sunxi ] [ o.k. ] Installing board support package [ lime2-emmc ] sed: can't read /armbian/2016-10-06/output/cache/sdcard/etc/lirc/hardware.conf: No such file or directory sed: can't read /armbian/2016-10-06/output/cache/sdcard/etc/lirc/hardware.conf: No such file or directory sed: can't read /armbian/2016-10-06/output/cache/sdcard/etc/lirc/hardware.conf: No such file or directory sed: can't read /armbian/2016-10-06/output/cache/sdcard/etc/lirc/hardware.conf: No such file or directory sed: can't read /armbian/2016-10-06/output/cache/sdcard/etc/lirc/hardware.conf: No such file or directory cp: cannot create regular file '/armbian/2016-10-06/output/cache/sdcard/etc/lirc/lircd.conf': No such file or directory [ o.k. ] Installing extra applications and drivers [ o.k. ] Installing linux firmware [ 5.21 ] [ o.k. ] Building deb [ armbian-tools ] [ o.k. ] ... downloading sources [ temper ] [ o.k. ] ... downloading sources [ BT utils ] [ o.k. ] ... compiling [ temper ] [ error ] ERROR in function compiling [ tools.sh:70 ] [ error ] Error building [ temper ] [ o.k. ] Process terminated [ error ] ERROR in function unmount_on_exit [ debootstrap-ng.sh:576 ] [ error ] debootstrap-ng was interrupted [ o.k. ] Process terminated In addition there are some error messages for missing files. One more error was printed before while creating board support package: [ o.k. ] Creating board support package [ lime2-emmc next ] cp: cannot stat '/armbian/2016-10-06/lib/mpv_sunxi.conf': No such file or directory What is wrong in Xenial build (server version) for Lime2-eMMC board? Best regards Chris
  15. Hi Igor, I have installed manually overlayroot and change its configuration as mentioned above. Before installation I have to install cryptsetup and cryptsetup-bin dependencies and installation had no problem. After adding 'overlayroot="tmpfs"' to /etc/overlayroot.conf and reboot I try to test it by creating of some file in the root home directory. Unfortunately, after rebooting the created file was still there and command 'overlayroot-chroot' says: ERROR: Unable to find an overlayroot filesystem which means there is something wrong. Where could be the problem? EDIT: I have removed the line for rootfs from /etc/fstab file for ability to support boot from any device without changing any files. At overlayroot installation initrd.img was rebuild with warnings because of rootfs line lack in /etc/fstab file. cryptsetup: WARNING: could not determine root device from /etc/fstab Could it be the reason of the problem? EDIT2: I try to install and configure overlayroot with rootfs line added to /etc/fstab and the installation (rebuilding initrd.img) completed without errors and warnings. Unfortunately, the problem is still there. Best regards Chris
  16. Hi to All, Is it possible to use bindfs as alternative of overlayfs to make root fs read only? Best regards Chris
  17. Hi Lauhub, Do you have success in using overlayfs to make rootfs read only on Armbian? I am using Lime2-eMMC and latest Armbian (5.21), U-Boot (2016.09) and Kernel (4.7.6) and need to make rootfs read only when installed on eMMC and have: SSD for system and data and make the system to boot from both eMMC and SSD; succeeded to use overlayfs for merging read only and read/write data staff easily. Unfortunately, described by Igor way is not possible because overlayfs-root packet is not in Debian. In my opinion it is not good idea to rely on other distribution packages. Any way did you try suggested by Zador way to install it in Armbian? I am interested in getting work done with Armbian customization features only. On the other hand read only root fs is a very frequent use case in embedded systems. @Igor, Is it possible to add overlayfs-root packet (will not be a precedent) in Armbian? Best regards Chris
  18. Hi Paolo, For removing the error about 'usb0_id_detect' you have to remove: * whole section usb0_id_detect_pin@0 { ... }; * following lines: pinctrl-0 = <0x2c>; usb0_id_det-gpio = <0x25 0x7 0x4 0x0>; from phy@01c13400 { ... }; section * and: pinctrl-0 = <0x0>; usb0_id_det-gpio = <0x0>; from second phy@01c13400 { ... }; section For setting of USB OTG in host only mode you have to change: * dr_mode = "otg"; to dr_mode = "host"; in usb@01c13000 { ... }; section USB OTH has to work in otg mode but it does not for me on Lime2-eMMC. You also have to verify that required modules are enabled in Kernel and loaded as described here: What I have done so far, is build the kernel using sunxi_defconfig and enabled USB_MUSB_SUNXI with its dependancies (musb isn't enabled there by default): USB_SUPPORT [=y] && USB_MUSB_HDRC [=y] && ARCH_SUNXI [=y] && NOP_USB_XCEIV [=y] && PHY_SUN4I_USB [=y] && EXTCON [=y] && GENERIC_PHY [=y] Selects: SUNXI_SRAM [=y] Unfortunately, working with converted dtb to dts file is not good idea. The better way is to build your own Armbian image controlling the staff with corresponding patches. Best regards Chris
  19. Hi to All, The next step was to test my Lime2-eMMC board's USB OTG in host only mode at higher speed data transfers. That is why as a first step I exchange STM32F405 board with WiFi dongle connecting it to USB OTG port in HS host only mode. Running described test with application increases data transfer speed 4 times - up to 160 kBps or ~0.3% of maximal USB throughput (480 Mbps or 60 MBps). There was no one warning for a more than 4 hours. When the WiFi dongle was connected to the regular USB Host port following messages can be seen from time to time: Next I have run a second application client on MacBookPro connected to the same AP (WiFi dongle) doubling data transfer speed up to 320 kBps - or 0.6% of maximal USB throughput. I have also run 'iperf4 -s' on Lime2-eMMC board and 'while true; do iperf3 -c Lime2IP; done' on my MacBookPro which adds another ~5 MBps and total data transfer speed become more than 5 MBps - or more than 8% of maximal USB throughput (but more than 25% of WiFi throughput). CPU load reported by RPI Monitor was 3.2 - 4.7 (4 mean) and the consumption reached 1.7 - 3.3 (3 mean) W. Again no any errors for more than 16 hours and only a single warning was observed: Oct 2 21:02:45 egpr kernel: [33711.585644] ieee80211 phy0: rt2800usb_txdone: Warning - Data pending for entry 2 in queue 2 Unfortunately, the reached data transfer rates ware not so big but much more than at real use case one in our application. I will try to find other test cases produced bigger throughput over USB OTG later on. Best regards Chris
  20. Hi Erpomata, As I can see USB Host ports for Lamobo r1 are disabled by default and have to be enabled. Search for 'echiX' and 'ochiX' where X can be 0 or 1 and change status to 'okay' This error mean that 'usb0_id_det' is somewhere in dtb 1c13400.phy node. Try to search for and remove it from final dts file. You may also remove from 'pio' node whole section for 'usb0_id_detect_pin'. 'usb0_vbus_power-supply ...' is missing in my configuration but maybe it is not wrong. And finally be sure you compile final dts file and overwrite with produced dtb one the file in /boot/dtb/. Best regards Chris
  21. Hi to All, Yesterday I have started USB OTG (in host only mode) stability test as described here and the problem with musb driver hangs looks fixed. It will be helpful if someone can confirm it. Best regards Chris
  22. Hi to All, Provoked by post about non working USB OTG on Banana PI for a long time I have decided to test situation on my Lime2-eMMC board again with Kernel 4.7. The results are that the problem exists if USB OTG is configured in 'otg' mode and USB works in host only mode as described here. The try to test stability problem (USB OTG in host only mode stops working after some time at data transfer) looks fixed. The test I am started is with real application in which STM32F405 based board with ChibiOS based FW connected to Lime2-eMMC via USB OTG (in host only mode) as FS CDC USB Device. The USB traffic (~40 kB/s in FS connection) has caused false interrupts system warnings and musb driver has been hanging after irregular time periods before. Now the problem do not exits for more than 16 hours testing time and the system continues working fine. Of course, more tests have to be done especially with intensive data transfers for being sure in USB OTG stability at least in host only mode. It will be perfect if someone having such a problem confirms my observations as well. Best regards Chris
  23. Hi to All, After discussion with the author of the patch for adding of lime2-emmc as a new board to Kernel 4.7 Olliver Schinagl I have tested and found that the problem can be overcome by removing of the staff around mmc2_pwrseq and PC16 using following patch: index 5ea4915..7e6b703 100644 --- a/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2-emmc.dts +++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2-emmc.dts @@ -46,22 +46,6 @@ / { model = "Olimex A20-OLinuXino-LIME2-eMMC"; compatible = "olimex,a20-olinuxino-lime2-emmc", "allwinner,sun7i-a20"; - - mmc2_pwrseq: pwrseq { - pinctrl-0 = <&mmc2_pins_nrst>; - pinctrl-names = "default"; - compatible = "mmc-pwrseq-emmc"; - reset-gpios = <&pio 2 16 GPIO_ACTIVE_LOW>; - }; -}; - -&pio { - mmc2_pins_nrst: mmc2@0 { - allwinner,pins = "PC16"; - allwinner,function = "gpio_out"; - allwinner,drive = <SUN4I_PINCTRL_10_MA>; - allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; - }; }; &mmc2 { @@ -71,7 +55,6 @@ vqmmc-supply = <&reg_vcc3v3>; bus-width = <4>; non-removable; - mmc-pwrseq = <&mmc2_pwrseq>; status = "okay"; emmc: emmc@0 { As tested for months (with my patches for older Kernel versions and 'lime2' config) the system works fine without above staff probably because eMMC chip makes internal reset when powered. If above staff is present the system makes sw reset using pin PC16 but the reset procedure takes too long and it is the reason for the observed delay and errors. If the system is booted from eMMC delay caused by the reset sequence makes device busy at the moment when rootfs has to be mounted. That is way the boot process stops. In my opinion even with observed delay the system has to continue with rootfs mounting when device become ready but this is another issue or maybe limitation. Unfortunately, Oliver has no time to work on this issue at the moment but maybe somebody else experienced in that field can help. Best regards Chris
  24. Hi to All, It is proved to work on Kernel 4.7.6 and can be tested without Kernel build using following procedure: cp /boot/dtb/sun7i-a20-olinuxino-lime2-emmc.dtb . dtc -I dtb -O dts -o sun7i-a20-olinuxino-lime2-emmc.dts sun7i-a20-olinuxino-lime2-emmc.dtb nano sun7i-a20-olinuxino-lime2-emmc.dts Change and remove to fit following: where the original staff is: and the difference is: root@egpr:~# diff sun7i-a20-olinuxino-lime2-emmc.dts.orig sun7i-a20-olinuxino-lime2-emmc.dts 830c830 < dr_mode = "otg"; --- > dr_mode = "host"; 845,848d844 < pinctrl-names = "default"; < pinctrl-0 = <0x29 0x2a>; < usb0_id_det-gpio = <0x21 0x7 0x4 0x0>; < usb0_vbus_det-gpio = <0x21 0x7 0x5 0x0>; Re-compile device tree, copy it back to /boot/dtb/ and reboot dtc -I dts -O dtb -o sun7i-a20-olinuxino-lime2-emmc.dtb sun7i-a20-olinuxino-lime2-emmc.dts cp sun7i-a20-olinuxino-lime2-emmc.dtb /boot/dtb/ reboot USB device can be connected to OTG port via USB OTG cable and registered in the system. You will see musb massages at 'dmesg' and corresponding Bus Device in 'lsusb' printout. The procedure can be applied for other boards using corresponding DT file. Some of the staff may differ from Lime2-eMMC one above. Best regards Chris
  25. Hi Erpomata, I have found solution to use USB OTG on Lime2 (A20) boards last tested on Kernel 4.5 but should work on 4.7 as well. Unfortunately, I could not set and use it in OTG mode even all say it should work. On the other hand USB hangs was encountered by me - see here and here. That is why I have decided to use only USB Hosts with adding of USB Hub (incl. USB to Ethernet adapter in it). I need to use WiFi, GPS, Ethernet and Flash USB adapters and dongles (some of them optionally) which is possible thanks to 1A power feature of USB1 port on Lime2. Any way I am interested in using of USB OTG port (because of no extra power consumption) in otg or at least in host mode but without described hangs. Best regards Chris
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines