Coder Social home page Coder Social logo

friendlyarm / h3_lichee Goto Github PK

View Code? Open in Web Editor NEW
106.0 32.0 104.0 345.53 MB

BSP for FriendlyARM NanoPi H3

Shell 0.08% C++ 2.27% C 90.37% XS 0.01% Python 0.02% Objective-C 4.74% Makefile 0.59% Assembly 1.81% Awk 0.01% PHP 0.01% CSS 0.01% M4 0.01% Perl 0.08% Lex 0.01% Yacc 0.01% UnrealScript 0.01% Batchfile 0.01% Scilab 0.01% ASP 0.01% Perl 6 0.01%

h3_lichee's Introduction

h3_lichee's People

Contributors

911gt3 avatar lawrencetg avatar wuweidong0107 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

h3_lichee's Issues

OOM: "Out of memory: Kill process" happens when using apt-get command

Hello

I got following error every time on my NanoPi NEO when running apt-get command.

root@NanoPi-NEO:/home/pi# apt-get update
Hit:1 http://ports.ubuntu.com xenial InRelease
Hit:2 http://ports.ubuntu.com xenial-security InRelease
Hit:3 http://ports.ubuntu.com xenial-updates InRelease
Hit:4 http://ports.ubuntu.com xenial-backports InRelease
[ 1083.337086] Out of memory: Kill process 2204 (apt-get) score 117 or sacrifice child
[ 1083.345843] Killed process 2204 (apt-get) total-vm:42564kB, anon-rss:34092kB, file-rss:2160kB
Killed

This issue doesn't happen on the mainline Kernel. I opened another SSH session to check the free memory periodically, and I can see it should have enough memory for "LowFree”.

root@NanoPi-NEO:# egrep 'High|Low' /proc/meminfo
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 246992 kB
LowFree: 140976 kB
root@NanoPi-NEO:
# egrep 'High|Low' /proc/meminfo
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 246992 kB
LowFree: 141576 kB
root@NanoPi-NEO:# egrep 'High|Low' /proc/meminfo
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 246992 kB
LowFree: 140532 kB
root@NanoPi-NEO:
# egrep 'High|Low' /proc/meminfo
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 246992 kB
LowFree: 140664 kB
root@NanoPi-NEO:# egrep 'High|Low' /proc/meminfo
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 246992 kB
LowFree: 139876 kB
root@NanoPi-NEO:
#
root@NanoPi-NEO:# egrep 'High|Low' /proc/meminfo
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 246992 kB
LowFree: 138508 kB
root@NanoPi-NEO:
# egrep 'High|Low' /proc/meminfo
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 246992 kB
LowFree: 172348 kB
root@NanoPi-NEO:~# egrep 'High|Low' /proc/meminfo
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 246992 kB
LowFree: 171912 kB

Could help to check this ?

Thanks

Think about lowering DRAM clock

The following works:

diff --git a/drivers/devfreq/dramfreq/sunxi-ddrfreq.c b/drivers/devfreq/dramfreq/sunxi-ddrfreq.c
index c7c20b7..7581087 100755
--- a/drivers/devfreq/dramfreq/sunxi-ddrfreq.c
+++ b/drivers/devfreq/dramfreq/sunxi-ddrfreq.c
@@ -1666,7 +1666,7 @@ static __devinit int sunxi_ddrfreq_probe(struct platform_device *pdev)
    if (sunxi_ddrfreq_min < SUNXI_DDRFREQ_MINFREQ_MIN)
        sunxi_ddrfreq_min = sunxi_ddrfreq_max / 3;
 #elif defined(CONFIG_ARCH_SUN8IW7P1)
-   sunxi_ddrfreq_min = 408000;
+   sunxi_ddrfreq_min = 132000;
 #else
    type = script_get_item("dram_para", "dram_tpr12", &val);
    if (SCIRPT_ITEM_VALUE_TYPE_INT != type) {

Minimum DRAM clockspeed is then 132 MHz (applications requiring memory bandwidth get somewhat slow) but with 264 MHz DRAM clock and a single core running at 912 MHz a H3 device is still faster than a RPi Zero. Some details/ideas: http://forum.armbian.com/index.php/topic/1614-running-h3-boards-with-minimal-consumption/

My idea is to come up with settings that allow idle consumption as low as an RPi Zero while being able to jump to full performance if needed within moments. Pretty simple: adjust DRAM clockspeed in fex file back to 624 MHz, define first THS trip point a bit lower without real throttling so sunxi's budget cooling code will automatically adjust DRAM clockspeed set from userspace to the fex value when needed.

So NanoPi would idle with 4 CPU cores at 480 MHz and DRAM clocked down to 132 MHz (allowing to stay below the 100mA barrier), in case serious work has to be done the user can define whether H3 should be allowed to reach 1200 MHz (VDD_CPUX: 1.3V) or just 912 MHz (VDD_CPUX: 1.1V -- 2200mW consumption less when running heavy workloads like cpuburn-a7) and in case heavy load lasts longer the budget cooling code will automagically increase DRAM clockspeed from 132 MHz to 624 MHz (and a cronjob will set DRAM clockspeed back to 132 MHz when CPU utilization is low again later).

Do you ship developer samples? If yes I would be glad to implement this in Armbian so we could provide not only desktop and server images but also IoT images minimizing consumption intelligently (providing a tool for the user to adjust settings of course, eg. maximum clockspeed or disabled USB ports and so on)

WM8978 driver

Compare to linux official github project, the wm8978.h is out of date.
You need to sync with the official project.

关于设备树

h3_lichee定制版中,生成的固件只有boot.img
我看到脚本中用以下命令生成
${MKBOOTIMG} --kernel ${BIMAGE}
--ramdisk ${RAMDISK}
--board ${CHIP}
--base ${BASE}
--ramdisk_offset ${OFFSET}
-o output/boot.img
然后拷贝到u盘的boot目录,期间并没有看到*.dtb的生成与拷贝
关于该定制版下的设备树文件,有相关的文档说明么?

Local privileges escalation

Seems like Allwinner's sun8i kernel sources allow everyone to become root easily:

tk@bananapim3:~$ id
uid=1000(tk) gid=1000(tk) groups=1000(tk),20(dialout),27(sudo),29(audio),44(video),46(plugdev),108(netdev)
tk@bananapim3:~$ echo "rootmydevice" > /proc/sunxi_debug/sunxi_debug 
tk@bananapim3:~$ id
uid=0(root) gid=0(root) groups=0(root),20(dialout),27(sudo),29(audio),44(video),46(plugdev),108(netdev),1000(tk)

Please check and fix if you're affected too.

regarding /fa_tools/fuse.sh & sys_config & wifi support

/fa_tools/fuse.sh does not changed its fuse device argument regarding the device name typed in using -d tag.
It just hardcoded dev name with /dev/sd everywhere, document about need to alter the fuse.sh script perhaps needed.
Besides, the sys_config.fex file is placed under /lichee/tools/pack/chips/$(ARCH)/configs/$(BOARD-NAME)/board/ , but not mentioned in the wiki website.
The wiki website is well outdated...
For some reason I could not find a way to initiate wlan0 device file.

ERROR: build kernel Failed

I recently got a nanopi m1 and I am using the official documentation

I downloaded the lichee source code and this toolchain: gcc-linaro-arm.tar.xz as the documentation said, but when I try to compile the source code, I got this error:

arm-linux-gnueabi-gcc: error trying to exec 'cc1': execvp: No such file or directory
ERROR: build kernel Failed

i need to solve this,because i want to use the nanopi M1 in a specific application

I am running Ubuntu 17.04 and I am a beginner in both arm processor and Linux environment but I have a background in electronics

whole code:

    ./build.sh -p sun8iw7p1 -b nanopi-h3
INFO: ----------------------------------------
INFO: build lichee ...
INFO: chip: sun8iw7p1
INFO: platform: linux
INFO: business: 
INFO: kernel: linux-3.4
INFO: board: nanopi-h3
INFO: output: out/sun8iw7p1/linux/nanopi-h3
INFO: ----------------------------------------
INFO: build kernel ...
INFO: prepare toolchain ...
INFO: skip kernel clean for nanopi-h3 Linux system.
Building kernel
/home/sami/lichee/linux-3.4/output/lib/modules/3.4.39-h3
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: 'include/generated/mach-types.h' is up to date.
  CC      kernel/bounds.s
arm-linux-gnueabi-gcc: error trying to exec 'cc1': execvp: No such file or directory
/home/sami/lichee/linux-3.4/./Kbuild:35: recipe for target 'kernel/bounds.s' failed
make[1]: *** [kernel/bounds.s] Error 1
Makefile:986: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
make: *** Waiting for unfinished jobs....
  CC      scripts/mod/empty.o
arm-linux-gnueabi-gcc: error trying to exec 'cc1': execvp: No such file or directory
scripts/Makefile.build:307: recipe for target 'scripts/mod/empty.o' failed
make[2]: *** [scripts/mod/empty.o] Error 1
scripts/Makefile.build:443: recipe for target 'scripts/mod' failed
make[1]: *** [scripts/mod] Error 2
Makefile:507: recipe for target 'scripts' failed
make: *** [scripts] Error 2
ERROR: build kernel Failed
INFO: use a fake rootfs.ext4.
1+0 records in
1+0 records out
1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.00234644 s, 447 MB/s
mke2fs 1.43.4 (31-Jan-2017)

Filesystem too small for a journal
INFO: ----------------------------------------

INFO: build sun8iw7p1 linux  lichee OK

INFO: ----------------------------------------

Compile for touchscreen.ko

Hi, I'm trying to get my touchscreen to work in my Android
I've modified the line
CONFIG_INPUT_TOUCHSCREEN = y
in sun8iw7p1smp_android_defconfig
and run ./build.sh lunch
Everything compiled fine.
I was expecting to see a usbtouchscreen.ko in the output/lib/module/modules/3.4.39/ folder
But I can't find it, would anyone help me? Thanks!

Can't kgdb to debug kernel.

Nanopi neo cann't debug by kgdb.
In linux code, the drivers sort error in serial MAKEFILE. kgdboc.o must be write at last line.

gpio权限过高

编译安卓镜像后安装到m1_plus板子上。发现/sys/class/gpio,export、unexport两个文件的权限过高,必须使用root才可以执行。而内置到系统的应用角色是system,无法使用你们提供的GPIO Demo进行GPIO操作。但在nanopc-T3这块板子上,gpio所属角色却是system,因此把应用经系统签名后就可以使用了。
请问如何修改源码配置文件可以降低或者修改这两个文件的权限?
f313e47caffb03696dfb0b376115709
a6f82d6e42b167e233bdbb148fef726

Pack android failed

I build android with source code from https://pan.baidu.com/s/1dF7HL0P#list/path=%2FNanoPi-M1%2Fsources%2Fnanopi-H3-bsp

Anything was ok but at last pack android failed, here is error tips:

packing for android
normal
/home/merlin/projects/nano_pi_m1/lichee/tools/pack/pctools/linux/eDragonEx/
/home/merlin/projects/nano_pi_m1/lichee/tools/pack/out
Begin Parse sys_partion.fex
Add partion bootloader.fex BOOTLOADER_FEX00
Add partion very bootloader.fex BOOTLOADER_FEX00
FilePath: bootloader.fex
FileLength=5b4400Add partion env.fex ENV_FEX000000000
Add partion very env.fex ENV_FEX000000000
FilePath: env.fex
FileLength=20000Add partion boot.fex BOOT_FEX00000000
Add partion very boot.fex BOOT_FEX00000000
FilePath: boot.fex
CreateFile failed 2
Add partion system.fex SYSTEM_FEX000000
Add partion very system.fex SYSTEM_FEX000000
FilePath: system.fex
CreateFile failed 2
Add partion recovery.fex RECOVERY_FEX0000
Add partion very recovery.fex RECOVERY_FEX0000
FilePath: recovery.fex
CreateFile failed 2
Add partion sysrecovery.fex SYSRECOVERY_FEX0
Add partion diskfs.fex DISKFS_FEX000000
sys_config.fex Len: 0x504c
config.fex Len: 0x8448
split_xxxx.fex Len: 0x200
sys_partition.fex Len: 0x117a
boot0_nand.fex Len: 0x8000
boot0_sdcard.fex Len: 0x8000
u-boot.fex Len: 0xe4000
fes1.fex Len: 0x31e0
toc1.fex Len: 0x8
toc0.fex Len: 0x8
usbtool.fex Len: 0x23000
aultools.fex Len: 0x26ead
aultls32.fex Len: 0x238dd
cardtool.fex Len: 0x14000
cardscript.fex Len: 0x6ea
sunxi_mbr.fex Len: 0x10000
dlinfo.fex Len: 0x4000
arisc.fex Len: 0x217aa
bootloader.fex Len: 0x5b4400
Vbootloader.fex Len: 0x4
env.fex Len: 0x20000
Venv.fex Len: 0x4
The file boot.fex length = 0
BuildImg 400
Dragon execute image.cfg Failed ! ArgCnt = 3, 400
pack finish

I find that these three boot.fex system.fex recovery.fex files link to android/out/target/product/nanopi-h3/xxx arn't exist.

What should I do to generate these three files?

Any update for Linux Kernel 4.14.13?

Hi,

I wonder if there is a standard way for us to follow, so that we can build whatever Linux Kernel as we wish? instead of just kernel 3.4 ONLY?

Cheers
Pei

Is register address error?

linux-3.4/sound/soc/sunxi/audiocodec/sun8iw7_sndcodec.c
The register address named AC_DAC_TXDATA is 0x0c.

But Ref: Allwinner_H3_datasheet_v1.0.pdf the register address is 0x020.

The code in sun8iw7_sndcodec.c.
#define DAC_TX_DATA 0x0c

Is need fix the address 0x0c to 0x20?

ldconfig.real -i generates a segmentation fault

On the NanoPi Neo 2-specific distro of FriendlyCore, typing "ldconfig.real -i" generates a segmentation fault. This happens with the two different ‘Core’ images (one supports an OLED unit; one does not). It does not happen with the two Armbian images that I tested.
This may indicate a bug in the libc build. I'm not sure.

update the uboot on MicroSD card

i ran this code in terminal:

./fuse_uboot.sh NANO
NANO is the sd card name, then this error came up:

cat: /sys/block/NANO/size: No such file or directory
ERROR: Can't find device NANO

i am running ubuntu 14.04 and i can see the usb is connected!

Does NanoPiNEO's GigE Mac Address randomly change from time to time, after rebooting?

Hi, I met another weird issue:

I tried to setup a static IP address for my NanoPi NEO, which should actually bundle the NanoPI NEO's GigE MAC address and the static IP. Whenever I reboot the NanoPI NEO, its GigE MAC address changes, and an random IP address is automatically allocated, via DHCP.

I mean, the previous MAC address did bundle to the static IP address that I allocated. However, there always exists a 2nd HOST name NanoPINEO which has a NEW MAC address and is allocated to a NEW IP address automatically.

I'm not sure if this is an issue of the latest kernel I've just built? Or it is an issue of the FriendlyARM BSP for AllWinner H3 ? I posted the question on armbian, FriendlyARM and AllWinner H3.

About the current NanoPiNEO (I'm still able to ssh into the random allocated IP address):

Welcome to ARMBIAN 5.38 stable Ubuntu 16.04.3 LTS 4.14.16-sunxi   
System load:   0.10 0.03 0.01   Up time:       2:53 hours
Memory usage:  11 % of 240MB    IP:            192.168.0.221
CPU temp:      40°C           
Usage of /:    16% of 15G    

Last login: Sat Feb  3 10:16:26 2018 from 192.168.0.10

jiapei@nanopineo:~$ uname -a
Linux nanopineo 4.14.16-sunxi #1 SMP Thu Feb 1 14:17:29 CST 2018 armv7l armv7l armv7l GNU/Linux
jiapei@nanopineo:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial
jiapei@nanopineo:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 7e:f0:16:00:3c:a7 (**this MAC address changes**)
          inet addr:192.168.0.221 (this IP address changes randomly as well) Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::ad9e:7328:d3ae:8681/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9133 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2356 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3621111 (3.6 MB)  TX bytes:194164 (194.1 KB)
          Interrupt:33 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:44 errors:0 dropped:0 overruns:0 frame:0
          TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4043 (4.0 KB)  TX bytes:4043 (4.0 KB)

jiapei@nanopineo:~$

can't build rtl8188eu driver

Hi,

I'm trying to rebuild kernel with rtl8188eu driver enabled (why it is not enabled by default ?) so i set CONFIG_RTL8188EU=m but i get undefined symbols errors:

ERROR: "wiphy_free" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "ieee80211_frequency_to_channel" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "cfg80211_inform_bss_frame" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "cfg80211_rx_mgmt" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "cfg80211_del_sta" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "cfg80211_mgmt_tx_status" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "__ieee80211_get_channel" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "cfg80211_get_bss" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "wiphy_unregister" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "cfg80211_connect_result" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "cfg80211_michael_mic_failure" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "wiphy_apply_custom_regulatory" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "cfg80211_ibss_joined" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "cfg80211_roamed" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "cfg80211_put_bss" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "wiphy_new" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "wiphy_register" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "cfg80211_ready_on_channel" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "cfg80211_disconnected" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "cfg80211_new_sta" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "cfg80211_remain_on_channel_expired" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!
ERROR: "cfg80211_scan_done" [drivers/net/wireless/rtl8188eu/8188eu.ko] undefined!

in the debian image available for the nanopi m1 there is this driver so it must be supported, what i'm doing wrong ?

关于buildroot

#cd h3_lichee/fa_tools
#./build.sh -b nanopi-m1-plus -p linux -t all
以上按照文档编译完成后,out/sun8iw7p1/linux/common/buildroot/目录下为空,跟文档描述不一致,
是需要自己去下载buildroot么?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.