Microsoft Windows [版本 10.0.22631.3737]
(c) Microsoft Corporation。保留所有权利。
E:\RTT\BoloRTT\bsp\f1c>scons -j8
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: building associated VariantDir targets: build
CC build\applications\Apps\demo.o
CC build\applications\Apps\UartCursor.o
CC build\applications\main.o
CC build\bootloader\exception.o
AS build\bootloader\memcpy.o
AS build\bootloader\memset.o
CC build\bootloader\sys-clock.o
CC build\bootloader\sys-copyself.o
scons: *** [build\bootloader\sys-copyself.o] Error -1073741701
scons: *** [build\applications\main.o] Error -1073741701
scons: *** [build\applications\Apps\demo.o] Error -1073741701
scons: *** [build\bootloader\memcpy.o] Error -1073741701
scons: *** [build\applications\Apps\UartCursor.o] Error -1073741701
scons: *** [build\bootloader\exception.o] Error -1073741701
scons: *** [build\bootloader\sys-clock.o] Error -1073741701
scons: *** [build\bootloader\memset.o] Error -1073741701
scons: building terminated because of errors.
求助这是什么错误,?
找到楼主里面的启动脚本:
echo 0 > /sys/class/android_usb/android0/enable
echo 18d1 > /sys/class/android_usb/android0/idVendor
echo 0001 > /sys/class/android_usb/android0/idProduct
echo adb > /sys/class/android_usb/android0/functions
echo 1 > /sys/class/android_usb/android0/enable
/sbin/ifconfig lo up
/bin/adbd
为什么我执行之后电脑识别出adb了,但是adb shell提示:error: device offline
# echo 0 > /sys/class/android_usb/android0/enable
[ 49.447998] android_usb: already disabled
#
# echo g_ffs > /sys/class/android_usb/androi[ 65.895711] android_usb: Cannot enable 'g_ffs' (-22)d0/functions
#
# echo adb > /sys/class/android_usb/android0/functions
#
# echo 1 > /sys/class/android_usb/android0/enable
#
# adbd &
# install_listener('tcp:5037','*sm
[ 159.381771] adb_open
artsocket*')
[ 159.386510] adb_bind_config
[ 159.391084] ep_matches, wrn: endpoint already claimed, ep(0xc04b8b3c, 0xc31080c0, ep1in-bulk)
[ 159.670697] android_usb gadget: high-speed config #1: android
这里面有个ep_matches, wrn: endpoint already claimed,警告不知道是什么,
v3s的BSP使用usb这么费劲么?
V3s BSP 3.4的 ADB问题有解决了么?
# depmod
# modprobe g_ffs idVendor=0x18d1 idProduct=0x4e42 iSerialNumber="buildroot"
[ 78.678502] g_ffs: file system registered
# mkdir -p /dev/usb-ffs/adb
# mount -t functionfs adb /dev/usb-ffs/adb -o uid=2000,gid=2000
# adbd &
# install_listener('tcp:5037','*sm[ 99.388973] g_ffs: read descriptors
artsocket*')
[ 99.395368] g_ffs: read strings
[ 99.399856] udc sunxi_usb_udc: registering UDC driver [g_ffs]
[ 99.406909] g_ffs gadget: using random self ethernet address
[ 99.413519] g_ffs gadget: using random host ethernet address
[ 99.428949] usb0: MAC 36:44:e2:9f:2f:a4
[ 99.433523] usb0: HOST MAC 12:f8:3d:91:69:45
[ 99.452645] g_ffs gadget: adding config #1 'FunctionFS + RNDIS'/bf00b460
[ 99.460754] g_ffs gadget: adding 'rndis'/c1fc1cc0 to config 'FunctionFS + RNDIS'/bf00b460
[ 99.470054] ep_matches, wrn: endpoint already claimed, ep(0xc04be754, 0xc1e5b7c0, ep1in-bulk)
[ 99.479764] ep_matches, wrn: endpoint already claimed, ep(0xc04be754, 0xc1e5b7c0, ep1in-bulk)
[ 99.489470] ep_matches, wrn: endpoint already claimed, ep(0xc04be7a0, 0xc1e5b7c0, ep1out-bulk)
[ 99.499274] gadget_is_softwinner_otg is not -int
[ 99.504524] gadget_is_softwinner_otg is not -int
[ 99.509993] g_ffs: rndis_register: configNr = 0
[ 99.515303] g_ffs: rndis_set_param_medium: 0 0
[ 99.520372] g_ffs gadget: RNDIS: dual speed IN/ep1in-bulk OUT/ep1out-bulk NOTIFY/ep4-int
[ 99.529663] g_ffs gadget: adding 'Function FS Gadget'/c0e684e4 to config 'FunctionFS + RNDIS'/bf00b460
[ 99.540260] ep_matches, wrn: endpoint already claimed, ep(0xc04be754, 0xc1e5b7c0, ep1in-bulk)
[ 99.549855] ep_matches, wrn: endpoint already claimed, ep(0xc04be7a0, 0xc1e5b7c0, ep1out-bulk)
[ 99.560637] ep_matches, wrn: endpoint already claimed, ep(0xc04be754, 0xc1e5b7c0, ep1in-bulk)
[ 99.570407] ep_matches, wrn: endpoint already claimed, ep(0xc04be7a0, 0xc1e5b7c0, ep1out-bulk)
[ 99.580377] g_ffs gadget: cfg 1/bf00b460 speeds: high full
[ 99.586595] g_ffs gadget: interface 0 = rndis/c1fc1cc0
[ 99.592747] g_ffs gadget: interface 1 = rndis/c1fc1cc0
[ 99.598779] g_ffs gadget: adding config #2 'FunctionFS + ECM'/bf00b4d4
[ 99.606703] g_ffs gadget: adding 'cdc_ethernet'/c1fc1c00 to config 'FunctionFS + ECM'/bf00b4d4
[ 99.616563] ep_matches, wrn: endpoint already claimed, ep(0xc04be754, 0xc1e5b7c0, ep1in-bulk)
[ 99.626163] ep_matches, wrn: endpoint already claimed, ep(0xc04be754, 0xc1e5b7c0, ep1in-bulk)
[ 99.635874] ep_matches, wrn: endpoint already claimed, ep(0xc04be7a0, 0xc1e5b7c0, ep1out-bulk)
[ 99.645672] gadget_is_softwinner_otg is not -int
[ 99.650926] gadget_is_softwinner_otg is not -int
[ 99.656443] g_ffs gadget: CDC Ethernet: dual speed IN/ep1in-bulk OUT/ep1out-bulk NOTIFY/ep4-int
[ 99.666270] g_ffs gadget: adding 'Function FS Gadget'/c0e68864 to config 'FunctionFS + ECM'/bf00b4d4
[ 99.676675] ep_matches, wrn: endpoint already claimed, ep(0xc04be754, 0xc1e5b7c0, ep1in-bulk)
[ 99.686389] ep_matches, wrn: endpoint already claimed, ep(0xc04be7a0, 0xc1e5b7c0, ep1out-bulk)
[ 99.696923] ep_matches, wrn: endpoint already claimed, ep(0xc04be754, 0xc1e5b7c0, ep1in-bulk)
[ 99.706668] ep_matches, wrn: endpoint already claimed, ep(0xc04be7a0, 0xc1e5b7c0, ep1out-bulk)
[ 99.716535] g_ffs gadget: cfg 2/bf00b4d4 speeds: high full
[ 99.722887] g_ffs gadget: interface 0 = cdc_ethernet/c1fc1c00
[ 99.729581] g_ffs gadget: interface 1 = cdc_ethernet/c1fc1c00
[ 99.736408] g_ffs gadget: adding config #3 'FunctionFS'/bf00b548
[ 99.743632] g_ffs gadget: adding 'Function FS Gadget'/c1fc8de4 to config 'FunctionFS'/bf00b548
[ 99.753619] g_ffs gadget: cfg 3/bf00b548 speeds: high full
[ 99.759978] g_ffs gadget: g_ffs ready
u-boot.cfg
lichee-v3s-ramdisk-linux.config
lichee-v3s-buildroot-ramdisk.config
Ramdisk配置.7z
如果遇到这样的错误:
[ 1.437777] ALSA device list:
[ 1.441278] #0: audiocodec
[ 1.445157] RAMDISK: gzip image found at block 0
[ 1.584502] VFS: Mounted root (ext2 filesystem) on device 1:0.
[ 1.591484] devtmpfs: mounted
[ 1.595207] Freeing init memory: 144K
mount: you must be root
mount: you must be root
mkdir: can't create directory '/dev/pts': Permission denied
mkdir: can't create directory '/dev/shm': Permission denied
mount: you must be root
hostname: sethostname: Operation not permitted
Starting logging: OK
Initializing random number generator... done.
Starting network: ip: RTNETLINK answers: Operation not permitted
ip: SIOCSIFFLAGS: Permission denied
FAIL
can't open /dev/console: Permission denied
can't open /dev/console: Permission denied
can't open /dev/console: Permission denied
查看busybox权限:
# buildroot-2017.08.1/output$ ll target/bin/busybox
-rwsr-xr-x 1 osboxes osboxes 675052 四月 12 04:35 target/bin/busybox*
解决办法:
chmod a-s busybox
1.1 修改内核配置选项
make ARCH=arm menuconfig
打开配置菜单,修改配置项
Ramdisk方式需要清空Initramfs source file(s)
之所以(4096)是因为我之后制作的ramdisk是4096KB大小的。
如果这个大小和你做的ramdisk不匹配,则启动时仍然会出现 kernel panic,提示ramdisk格式不正确,挂载不上ramdisk。
注意:ramdisk是一种内存虚拟磁盘技术,实质上并不是一种文件系统,它使用的文件系统是ext2文件系统。
1.2 文件系统配置
其中Toolchain path是kernel的交叉编译链的位置
kernel的版本,在交叉编译链下面查看:
libc/usr/include/linux/version.h
我这里的 LINUX_VERSION_CODE 版本是 262144
将262144转换16进制40000
我的编译链版本是4.0.0
保存配置开始编译
编译完成后生成根文件系统
2. 修改内核启动参数
2.1 安装mkimage
sudo apt install mkimage
采用修改u-boot的bootargs环境变量来传递启动参数
修改bsp.cmd文件:一键制作boot.src.7z
2.2 安装sunxi-tools工具,制作script参数配置
git clone -b v3s https://github.com/Icenowy/sunxi-tools.git
make && sudo make install
一键制作script参数配置bin文件
一键制作script.bin.7z
3. 制作ramdisk镜像
安装工具: sudo apt install genext2fs
编译buildroot
cd 到 buildroot/output 执行
$ genext2fs -b 4096 -d target/ ramdisk
$ gzip -9 -f ramdisk
制作出镜像
builtroot/output/ramdisk.gz
到此制作出全部启动文件: boot.scr script.bin u-boot-sunxi-with-spl.bin ramdisk.gz uImage
U-Boot SPL 2017.01-rc2-00057-g32ab180 (Apr 06 2021 - 04:01:39)
DRAM: 64 MiB
Trying to boot from FEL
U-Boot 2017.01-rc2-00057-g32ab180 (Apr 06 2021 - 04:01:39 -0400) Allwinner Technology
CPU: Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM: 64 MiB
MMC: SUNXI SD/MMC: 0
Card did not respond to voltage select!
*** Warning - MMC init failed, using default environment
Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In: serial@01c28000
Out: serial@01c28000
Err: serial@01c28000
U-Boot 2017.01-rc2-00057-g32ab180 (Apr 06 2021 - 04:01:39 -0400) Allwinner Technology
CPU: Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM: 64 MiB
MMC: SUNXI SD/MMC: 0
Card did not respond to voltage select!
*** Warning - MMC init failed, using default environment
Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In: serial@01c28000
Out: serial@01c28000
Err: serial@01c28000
Net: No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot: 0
(FEL boot)
## Executing script at 41e00000
## Booting kernel from Legacy Image at 41000000 ...
Image Name: Linux-3.4.39
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2457016 Bytes = 2.3 MiB
Load Address: 40008000
Entry Point: 40008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
Using machid 0x1029 from environment
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0
[ 0.000000] Linux version 3.4.39 (osboxes@osboxes) (gcc version 4.9.4 (Linaro GCC 4.9-2017.01) ) #29 Fri Apr 16 02:27:37 EDT 2021
[ 0.000000] Initialized persistent memory from 41d20800-41d307ff
[ 0.000000] Kernel command line: console=ttyS0,115200 panic=5 rootwait initrd=0x41b00000,0x200000 root=/dev/ram init=/linuxrc earlyprintk rw
[ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Memory: 64MB = 64MB total
[ 0.000000] Memory: 28316k/28316k available, 37220k reserved, 0K highmem
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] vmalloc : 0xc4800000 - 0xff000000 ( 936 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .text : 0xc0008000 - 0xc047f000 (4572 kB)
[ 0.000000] .init : 0xc047f000 - 0xc04a3000 ( 144 kB)
[ 0.000000] .data : 0xc04a4000 - 0xc04e8830 ( 275 kB)
[ 0.000000] .bss : 0xc04e8854 - 0xc0583494 ( 620 kB)
[ 0.000000] NR_IRQS:544
[ 0.000000] Architected local timer running at 24.00MHz.
[ 0.000000] Switching to timer-based delay loop
[ 0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
[ 0.000000] Console: colour dummy device 80x30
[ 0.000168] Calibrating delay loop (skipped), value calculated using timer frequency.. 4800.00 BogoMIPS (lpj=24000000)
[ 0.000188] pid_max: default: 32768 minimum: 301
[ 0.000327] Mount-cache hash table entries: 512
[ 0.000888] CPU: Testing write buffer coherency: ok
[ 0.001153] Setting up static identity map for 0x40359488 - 0x403594e0
[ 0.001812] devtmpfs: initialized
[ 0.003527] pinctrl core: initialized pinctrl subsystem
[ 0.004013] NET: Registered protocol family 16
[ 0.004356] DMA: preallocated 128 KiB pool for atomic coherent allocations
[ 0.004418] script_sysfs_init success
[ 0.005167] gpiochip_add: registered GPIOs 0 to 223 on device: sunxi-pinctrl
[ 0.006065] sunxi-pinctrl sunxi-pinctrl: initialized sunXi PIO driver
[ 0.006440] gpiochip_add: registered GPIOs 1024 to 1031 on device: axp-pinctrl
[ 0.007264] persistent_ram: error in header, 4
[ 0.007277] persistent_ram: no valid data in buffer (sig = 0x00000000)
[ 0.014391] console [ram-1] enabled
[ 0.015207] Not Found clk pll_isp in script
[ 0.015463] Not Found clk pll_video in script
[ 0.015597] Not Found clk pll_ve in script
[ 0.015730] Not Found clk pll_periph0 in script
[ 0.015975] Not Found clk pll_de in script
[ 0.019920] bio: create slab <bio-0> at 0
[ 0.020285] pwm module init!
[ 0.022663] SCSI subsystem initialized
[ 0.023026] usbcore: registered new interface driver usbfs
[ 0.023334] usbcore: registered new interface driver hub
[ 0.023612] usbcore: registered new device driver usb
[ 0.023873] twi_chan_cfg()340 - [twi0] has no twi_regulator.
[ 0.024125] twi_chan_cfg()340 - [twi1] has no twi_regulator.
[ 0.024956] sunxi_i2c_do_xfer()985 - [i2c0] incomplete xfer (status: 0x20, dev addr: 0x34)
[ 0.025226] axp20_board 0-0034: failed reading at 0x03
[ 0.025504] axp20_board: probe of 0-0034 failed with error -70
[ 0.025685] Linux video capture interface: v2.00
[ 0.026020] gpiochip_add: gpios 1024..1028 (axp_pin) failed to register
[ 0.026487] Advanced Linux Sound Architecture Driver Version 1.0.25.
[ 0.027421] Switching to clocksource arch_sys_counter
[ 0.029973] NET: Registered protocol family 2
[ 0.029973] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.030120] TCP established hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.030411] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.030565] TCP: Hash tables configured (established 2048 bind 2048)
[ 0.030810] TCP: reno registered
[ 0.030949] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.031205] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.031604] NET: Registered protocol family 1
[ 0.032052] Trying to unpack rootfs image as initramfs...
[ 0.033221] rootfs image is not initramfs (no cpio magic); looks like an initrd
[ 0.042563] Freeing initrd memory: 2048K
[ 0.042879] standby_mode = 1.
[ 0.043013] wakeup src cnt is : 3.
[ 0.043280] pmu1_enable = 0x1.
[ 0.043413] pmux_id = 0x1.
[ 0.043556] config_pmux_para: script_parser_fetch err.
[ 0.043801] pmu2_enable = 0x0.
[ 0.043938] add_sys_pwr_dm: get ldo name failed
[ 0.044072] add_sys_pwr_dm: get ldo name failed
[ 0.044320] add_sys_pwr_dm: get ldo name failed
[ 0.044453] add_sys_pwr_dm: get ldo name failed
[ 0.044585] add_sys_pwr_dm: get ldo name failed
[ 0.044829] add_sys_pwr_dm: get ldo name failed
[ 0.044961] add_sys_pwr_dm: get ldo name failed
[ 0.045205] add_sys_pwr_dm: get ldo name failed
[ 0.045337] add_sys_pwr_dm: get ldo name failed
[ 0.045469] add_sys_pwr_dm: get ldo name failed
[ 0.045712] after inited: sys_mask config = 0x0.
[ 0.045847] dynamic_standby enalbe = 0x0.
[ 0.046155] sunxi_reg_init enter
[ 0.048393] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.048583] jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
[ 0.049019] msgmni has been set to 59
[ 0.050146] io scheduler noop registered
[ 0.050406] io scheduler deadline registered
[ 0.050623] io scheduler cfq registered (default)
[ 0.051271] [DISP]disp_module_init
[ 0.051804] cmdline,disp=
[ 0.052472] [DISP] disp_get_rotation_sw,line:68:disp 0 out of range? g_rot_sw=0
[ 0.052853] [DISP] disp_init_connections,line:289:NULL pointer: 0, 0
[ 0.055430] [DISP] Fb_map_kernel_logo,line:924:Fb_map_kernel_logo failed!
[ 0.058206] [DISP] disp_sys_power_enable,line:387:some error happen, fail to get regulator
[ 0.059369] [DISP]disp_module_init finish
[ 0.059777] sw_uart_get_devinfo()1503 - uart0 has no uart_regulator.
[ 0.060454] uart0: ttyS0 at MMIO 0x1c28000 (irq = 32) is a SUNXI
[ 0.060602] sw_uart_pm()890 - uart0 clk is already enable
[ 0.060861] sw_console_setup()1233 - console setup baud 115200 parity n bits 8, flow n
[ 0.174413] console [ttyS0] enabled
[ 0.724937] brd: module loaded
[ 0.729069] sunxi_spi_chan_cfg()1376 - [spi-0] has no spi_regulator.
[ 0.737127] spi spi0: master is unqueued, this is deprecated
[ 0.745256] Failed to alloc md5
[ 0.748923] eth0: Use random mac address
[ 0.753535] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.781248] sunxi-ehci sunxi-ehci.1: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.790316] sunxi-ehci sunxi-ehci.1: new USB bus registered, assigned bus number 1
[ 0.799067] sunxi-ehci sunxi-ehci.1: irq 104, io mem 0xf1c1a000
[ 0.820035] sunxi-ehci sunxi-ehci.1: USB 0.0 started, EHCI 1.00
[ 0.827419] hub 1-0:1.0: USB hub found
[ 0.831767] hub 1-0:1.0: 1 port detected
[ 0.836836] sunxi-ehci sunxi-ehci.1: remove, state 1
[ 0.842522] usb usb1: USB disconnect, device number 1
[ 0.848976] sunxi-ehci sunxi-ehci.1: USB bus 1 deregistered
[ 0.865434] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.892637] sunxi-ohci sunxi-ohci.1: SW USB2.0 'Open' Host Controller (OHCI) Driver
[ 0.901321] sunxi-ohci sunxi-ohci.1: new USB bus registered, assigned bus number 1
[ 0.910003] sunxi-ohci sunxi-ohci.1: irq 105, io mem 0xf1c1a400
[ 0.974640] hub 1-0:1.0: USB hub found
[ 0.978944] hub 1-0:1.0: 1 port detected
[ 0.983825] sunxi-ohci sunxi-ohci.1: remove, state 1
[ 0.989610] usb usb1: USB disconnect, device number 1
[ 0.995909] sunxi-ohci sunxi-ohci.1: USB bus 1 deregistered
[ 1.012486] Initializing USB Mass Storage driver...
[ 1.018108] usbcore: registered new interface driver usb-storage
[ 1.025043] USB Mass Storage support registered.
[ 1.030611] file system registered
[ 1.035996] android_usb gadget: Mass Storage Function, version: 2009/09/11
[ 1.043963] android_usb gadget: Number of LUNs=1
[ 1.049333] lun0: LUN: removable file: (no medium)
[ 1.055498] android_usb gadget: android_usb ready
[ 1.061002] sunxikbd_script_init: key para not found, used default para.
[ 1.069744] sunxi-rtc sunxi-rtc: rtc core: registered sunxi-rtc as rtc0
[ 1.078199] platform reg-20-cs-dcdc2: Driver reg-20-cs-dcdc2 requests probe deferral
[ 1.087208] platform reg-20-cs-dcdc3: Driver reg-20-cs-dcdc3 requests probe deferral
[ 1.096194] platform reg-20-cs-ldo1: Driver reg-20-cs-ldo1 requests probe deferral
[ 1.104940] platform reg-20-cs-ldo2: Driver reg-20-cs-ldo2 requests probe deferral
[ 1.113720] platform reg-20-cs-ldo3: Driver reg-20-cs-ldo3 requests probe deferral
[ 1.122508] platform reg-20-cs-ldo4: Driver reg-20-cs-ldo4 requests probe deferral
[ 1.131158] platform reg-20-cs-ldoio0: Driver reg-20-cs-ldoio0 requests probe deferral
[ 1.140209] sunxi_wdt_init_module: sunxi WatchDog Timer Driver v1.0
[ 1.147583] sunxi_wdt_probe: devm_ioremap return wdt_reg 0xf1c20ca0, res->start 0x01c20ca0, res->end 0x01c20cbf
[ 1.159050] sunxi_wdt_probe: initialized (g_timeout=16s, g_nowayout=0)
[ 1.166767] wdt_enable, write reg 0xf1c20cb8 val 0x00000000
[ 1.173205] wdt_set_tmout, write 0x000000b0 to mode reg 0xf1c20cb8, actual timeout 16 sec
[ 1.183138] no led_3, ignore it!
[ 1.186959] no led_4, ignore it!
[ 1.190721] no led_5, ignore it!
[ 1.194427] no led_6, ignore it!
[ 1.198239] no led_7, ignore it!
[ 1.202696] usbcore: registered new interface driver usbhid
[ 1.209043] usbhid: USB HID core driver
[ 1.214200] ashmem: initialized
[ 1.217951] logger: created 256K log 'log_main'
[ 1.223297] logger: created 32K log 'log_events'
[ 1.228760] logger: created 32K log 'log_radio'
[ 1.234052] logger: created 32K log 'log_system'
[ 1.240949] script_get_item return type err, consider it no ldo
[ 1.248442] asoc: sndcodec <-> sunxi-codec mapping ok
[ 1.256344] TCP: cubic registered
[ 1.260322] NET: Registered protocol family 17
[ 1.265536] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 1.274441] ThumbEE CPU extension supported.
[ 1.279319] Registering SWP/SWPB emulation handler
[ 1.285818] platform reg-20-cs-ldoio0: Driver reg-20-cs-ldoio0 requests probe deferral
[ 1.294903] platform reg-20-cs-ldo4: Driver reg-20-cs-ldo4 requests probe deferral
[ 1.303601] platform reg-20-cs-ldo3: Driver reg-20-cs-ldo3 requests probe deferral
[ 1.312297] platform reg-20-cs-ldo2: Driver reg-20-cs-ldo2 requests probe deferral
[ 1.320867] platform reg-20-cs-ldo1: Driver reg-20-cs-ldo1 requests probe deferral
[ 1.329542] platform reg-20-cs-dcdc3: Driver reg-20-cs-dcdc3 requests probe deferral
[ 1.338413] platform reg-20-cs-dcdc2: Driver reg-20-cs-dcdc2 requests probe deferral
[ 1.347250] sunxi-rtc sunxi-rtc: setting system clock to 1970-01-01 00:34:49 UTC (2089)
[ 1.357772] ALSA device list:
[ 1.361277] #0: audiocodec
[ 1.365158] RAMDISK: gzip image found at block 0
[ 1.504469] VFS: Mounted root (ext2 filesystem) on device 1:0.
[ 1.511454] devtmpfs: mounted
[ 1.515177] Freeing init memory: 144K
Starting logging: OK
Initializing random number generator... done.
Starting network: OK
Welcome to Buildroot
buildroot login:
Welcome to Buildroot
buildroot login: root
#
#
#
# ls
#
#
# cd /
#
#
# ls
THIS_IS_NOT_YOUR_ROOT_FILESYSTEM mnt
bin opt
dev proc
etc root
init run
init_bk sbin
lib sys
lib32 tmp
linuxrc usr
lost+found var
media
#
#
编译BSP系统参考: https://whycan.com/t_682.html
1. 编译uboot
2. 生成boot.scr文件
编写boot.cmd
setenv bootdelay 0
setenv bootargs "console=ttyS0,115200 panic=5 rootwait root=/dev/ram0 rdinit=/linuxrc earlyprintk rw"
setenv bootm_boot_mode sec
setenv machid 1029
bootm 0x41000000
制作:
tools/mkimage -C none -A arm -T script -d boot.cmd boot.scr
3. 生成 script.bin文件
使用qianhao提供的sys_config.fex
fex2bin sys_config.fex > script.bin
4. 编译文件系统
使用https://buildroot.org/downloads/buildroot-2017.08.1.tar.gz
Toolchain
x x Toolchain type (External toolchain) ---> x x
x x *** Toolchain External Options *** x x
x x Toolchain (Custom toolchain) ---> x x
x x Toolchain origin (Pre-installed toolchain) ---> x x
x x (/opt/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf) Toolchain path
x x
x x (arm-linux-gnueabihf) Toolchain prefix x x
x x External toolchain gcc version (4.9.x) ---> x x
x x External toolchain kernel headers series (4.0.x) --->
x x
x x External toolchain C library (glibc/eglibc) ---> x x
Filesystem images 制作rootfs.cpio.gz
x x * cpio the root filesystem (for use as an initial RAM filesystem) x x
x x Compression method (gzip) --->
编译完成后,生成output/images/文件夹下的rootfs.cpio.gz
制作ramfs
mkimage -A arm -T ramdisk -C none -n uInitrd -d rootfs.cpio.gz rootfs.cpio.gz.uImage
5. 编译内核
cp lichee_BSP_config .config
配置内核
General setup --->
x x * Initial RAM filesystem and RAM disk (initramfs/initrd) support x x
x x (/home/osboxes/v3s/licheezero/rootfs/rootfs-bin) Initramfs source file(s)
x x (0) User ID to map to 0 (user root) x x
x x (0) Group ID to map to 0 (group root) x x
x x * Support initial ramdisks compressed using gzip x x
x x [ ] Support initial ramdisks compressed using bzip2 x x
x x [ ] Support initial ramdisks compressed using LZMA x x
x x [ ] Support initial ramdisks compressed using XZ x x
x x [ ] Support initial ramdisks compressed using LZO x x
x x Built-in initramfs compression mode (None) --->
其中/home/osboxes/v3s/licheezero/rootfs/rootfs-bin目录下存放制作好的rootfs.cpio.gz
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage -j8
上电进入FEL模式运行:
sunxi-fel.exe -p uboot u-boot-sunxi-with-spl.bin write 0x41000000 uImage write 0x41d00000 script.bin write 0x41e00000 boot.scr write 0x41A00000 rootfs.cpio.gz.uImage
系统启动后停在
[ 1.324816] Warning: unable to open an initial console.
[ 1.330947] Waiting for root device /dev/ram0...
输入回车没有反应。
U-Boot SPL 2017.01-rc2-00057-g32ab180 (Apr 06 2021 - 04:01:39)
DRAM: 64 MiB
Trying to boot from FEL
U-Boot 2017.01-rc2-00057-g32ab180 (Apr 06 2021 - 04:01:39 -0400) Allwinner Technology
CPU: Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM: 64 MiB
MMC: SUNXI SD/MMC: 0
Card did not respond to voltage select!
*** Warning - MMC init failed, using default environment
Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In: serial@01c28000
Out: serial@01c28000
Err: serial@01c28000
U-Boot 2017.01-rc2-00057-g32ab180 (Apr 06 2021 - 04:01:39 -0400) Allwinner Technology
CPU: Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM: 64 MiB
MMC: SUNXI SD/MMC: 0
Card did not respond to voltage select!
*** Warning - MMC init failed, using default environment
Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In: serial@01c28000
Out: serial@01c28000
Err: serial@01c28000
Net: No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot: 0
(FEL boot)
## Executing script at 41e00000
## Booting kernel from Legacy Image at 41000000 ...
Image Name: Linux-3.4.39
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3939328 Bytes = 3.8 MiB
Load Address: 40008000
Entry Point: 40008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
Using machid 0x1029 from environment
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0
[ 0.000000] Linux version 3.4.39 (osboxes@osboxes) (gcc version 4.9.4 (Linaro GCC 4.9-2017.01) ) #24 Wed Apr 14 02:02:59 EDT 2021
[ 0.000000] Initialized persistent memory from 41d20800-41d307ff
[ 0.000000] Kernel command line: console=ttyS0,115200 panic=5 rootwait root=/dev/ram0 rdinit=/linuxrc earlyprintk rw
[ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Memory: 64MB = 64MB total
[ 0.000000] Memory: 28932k/28932k available, 36604k reserved, 0K highmem
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] vmalloc : 0xc4800000 - 0xff000000 ( 936 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .text : 0xc0008000 - 0xc0476000 (4536 kB)
[ 0.000000] .init : 0xc0476000 - 0xc0609000 (1612 kB)
[ 0.000000] .data : 0xc060a000 - 0xc064e7b0 ( 274 kB)
[ 0.000000] .bss : 0xc064e7d4 - 0xc06e93d4 ( 619 kB)
[ 0.000000] NR_IRQS:544
[ 0.000000] Architected local timer running at 24.00MHz.
[ 0.000000] Switching to timer-based delay loop
[ 0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
[ 0.000000] Console: colour dummy device 80x30
[ 0.000164] Calibrating delay loop (skipped), value calculated using timer frequency.. 4800.00 BogoMIPS (lpj=24000000)
[ 0.000187] pid_max: default: 32768 minimum: 301
[ 0.000333] Mount-cache hash table entries: 512
[ 0.000885] CPU: Testing write buffer coherency: ok
[ 0.001153] Setting up static identity map for 0x40351820 - 0x40351878
[ 0.001815] devtmpfs: initialized
[ 0.003500] pinctrl core: initialized pinctrl subsystem
[ 0.003999] NET: Registered protocol family 16
[ 0.004326] DMA: preallocated 128 KiB pool for atomic coherent allocations
[ 0.004387] script_sysfs_init success
[ 0.005137] gpiochip_add: registered GPIOs 0 to 223 on device: sunxi-pinctrl
[ 0.006030] sunxi-pinctrl sunxi-pinctrl: initialized sunXi PIO driver
[ 0.006395] gpiochip_add: registered GPIOs 1024 to 1031 on device: axp-pinctrl
[ 0.007234] persistent_ram: uncorrectable error in header
[ 0.007251] persistent_ram: no valid data in buffer (sig = 0x42004000)
[ 0.014267] console [ram-1] enabled
[ 0.015084] Not Found clk pll_isp in script
[ 0.015231] Not Found clk pll_video in script
[ 0.015481] Not Found clk pll_ve in script
[ 0.015614] Not Found clk pll_periph0 in script
[ 0.015859] Not Found clk pll_de in script
[ 0.019832] bio: create slab <bio-0> at 0
[ 0.020250] pwm module init!
[ 0.022593] SCSI subsystem initialized
[ 0.022975] usbcore: registered new interface driver usbfs
[ 0.023177] usbcore: registered new interface driver hub
[ 0.023566] usbcore: registered new device driver usb
[ 0.023854] twi_chan_cfg()340 - [twi0] has no twi_regulator.
[ 0.024105] twi_chan_cfg()340 - [twi1] has no twi_regulator.
[ 0.024926] sunxi_i2c_do_xfer()985 - [i2c0] incomplete xfer (status: 0x20, dev addr: 0x34)
[ 0.025195] axp20_board 0-0034: failed reading at 0x03
[ 0.025470] axp20_board: probe of 0-0034 failed with error -70
[ 0.025652] Linux video capture interface: v2.00
[ 0.025871] gpiochip_add: gpios 1024..1028 (axp_pin) failed to register
[ 0.026457] Advanced Linux Sound Architecture Driver Version 1.0.25.
[ 0.027368] Switching to clocksource arch_sys_counter
[ 0.029976] NET: Registered protocol family 2
[ 0.029976] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.030088] TCP established hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.030383] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.030541] TCP: Hash tables configured (established 2048 bind 2048)
[ 0.030789] TCP: reno registered
[ 0.030927] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.031186] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.031588] NET: Registered protocol family 1
[ 0.036956] standby_mode = 1.
[ 0.037102] wakeup src cnt is : 3.
[ 0.037258] pmu1_enable = 0x1.
[ 0.037392] pmux_id = 0x1.
[ 0.037646] config_pmux_para: script_parser_fetch err.
[ 0.037780] pmu2_enable = 0x0.
[ 0.037917] add_sys_pwr_dm: get ldo name failed
[ 0.038161] add_sys_pwr_dm: get ldo name failed
[ 0.038294] add_sys_pwr_dm: get ldo name failed
[ 0.038539] add_sys_pwr_dm: get ldo name failed
[ 0.038673] add_sys_pwr_dm: get ldo name failed
[ 0.038805] add_sys_pwr_dm: get ldo name failed
[ 0.039049] add_sys_pwr_dm: get ldo name failed
[ 0.039184] add_sys_pwr_dm: get ldo name failed
[ 0.039429] add_sys_pwr_dm: get ldo name failed
[ 0.039562] add_sys_pwr_dm: get ldo name failed
[ 0.039693] after inited: sys_mask config = 0x0.
[ 0.039939] dynamic_standby enalbe = 0x0.
[ 0.040192] sunxi_reg_init enter
[ 0.042311] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.042608] jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
[ 0.042930] msgmni has been set to 56
[ 0.043972] io scheduler noop registered
[ 0.044118] io scheduler deadline registered
[ 0.044443] io scheduler cfq registered (default)
[ 0.044977] [DISP]disp_module_init
[ 0.045512] cmdline,disp=
[ 0.046199] [DISP] disp_get_rotation_sw,line:68:disp 0 out of range? g_rot_sw=0
[ 0.046584] [DISP] disp_init_connections,line:289:NULL pointer: 0, 0
[ 0.049270] [DISP] Fb_map_kernel_logo,line:924:Fb_map_kernel_logo failed!
[ 0.052038] [DISP] disp_sys_power_enable,line:387:some error happen, fail to get regulator
[ 0.053202] [DISP]disp_module_init finish
[ 0.053608] sw_uart_get_devinfo()1503 - uart0 has no uart_regulator.
[ 0.054219] uart0: ttyS0 at MMIO 0x1c28000 (irq = 32) is a SUNXI
[ 0.054366] sw_uart_pm()890 - uart0 clk is already enable
[ 0.054621] sw_console_setup()1233 - console setup baud 115200 parity n bits 8, flow n
[ 0.168106] console [ttyS0] enabled
[ 0.693158] sunxi_spi_chan_cfg()1376 - [spi-0] has no spi_regulator.
[ 0.701167] spi spi0: master is unqueued, this is deprecated
[ 0.709217] Failed to alloc md5
[ 0.712928] eth0: Use random mac address
[ 0.717581] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.745091] sunxi-ehci sunxi-ehci.1: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.754272] sunxi-ehci sunxi-ehci.1: new USB bus registered, assigned bus number 1
[ 0.763044] sunxi-ehci sunxi-ehci.1: irq 104, io mem 0xf1c1a000
[ 0.780033] sunxi-ehci sunxi-ehci.1: USB 0.0 started, EHCI 1.00
[ 0.787525] hub 1-0:1.0: USB hub found
[ 0.791980] hub 1-0:1.0: 1 port detected
[ 0.796902] sunxi-ehci sunxi-ehci.1: remove, state 1
[ 0.802702] usb usb1: USB disconnect, device number 1
[ 0.809884] sunxi-ehci sunxi-ehci.1: USB bus 1 deregistered
[ 0.826456] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.853566] sunxi-ohci sunxi-ohci.1: SW USB2.0 'Open' Host Controller (OHCI) Driver
[ 0.862347] sunxi-ohci sunxi-ohci.1: new USB bus registered, assigned bus number 1
[ 0.871029] sunxi-ohci sunxi-ohci.1: irq 105, io mem 0xf1c1a400
[ 0.934634] hub 1-0:1.0: USB hub found
[ 0.939056] hub 1-0:1.0: 1 port detected
[ 0.944018] sunxi-ohci sunxi-ohci.1: remove, state 1
[ 0.949665] usb usb1: USB disconnect, device number 1
[ 0.956101] sunxi-ohci sunxi-ohci.1: USB bus 1 deregistered
[ 0.972558] Initializing USB Mass Storage driver...
[ 0.978295] usbcore: registered new interface driver usb-storage
[ 0.985101] USB Mass Storage support registered.
[ 0.990762] file system registered
[ 0.996141] android_usb gadget: Mass Storage Function, version: 2009/09/11
[ 1.004080] android_usb gadget: Number of LUNs=1
[ 1.009328] lun0: LUN: removable file: (no medium)
[ 1.015344] android_usb gadget: android_usb ready
[ 1.020960] sunxikbd_script_init: key para not found, used default para.
[ 1.029586] sunxi-rtc sunxi-rtc: rtc core: registered sunxi-rtc as rtc0
[ 1.038112] platform reg-20-cs-dcdc2: Driver reg-20-cs-dcdc2 requests probe deferral
[ 1.047301] platform reg-20-cs-dcdc3: Driver reg-20-cs-dcdc3 requests probe deferral
[ 1.056172] platform reg-20-cs-ldo1: Driver reg-20-cs-ldo1 requests probe deferral
[ 1.064958] platform reg-20-cs-ldo2: Driver reg-20-cs-ldo2 requests probe deferral
[ 1.073743] platform reg-20-cs-ldo3: Driver reg-20-cs-ldo3 requests probe deferral
[ 1.082404] platform reg-20-cs-ldo4: Driver reg-20-cs-ldo4 requests probe deferral
[ 1.091162] platform reg-20-cs-ldoio0: Driver reg-20-cs-ldoio0 requests probe deferral
[ 1.100213] sunxi_wdt_init_module: sunxi WatchDog Timer Driver v1.0
[ 1.107475] sunxi_wdt_probe: devm_ioremap return wdt_reg 0xf1c20ca0, res->start 0x01c20ca0, res->end 0x01c20cbf
[ 1.118960] sunxi_wdt_probe: initialized (g_timeout=16s, g_nowayout=0)
[ 1.126787] wdt_enable, write reg 0xf1c20cb8 val 0x00000000
[ 1.133119] wdt_set_tmout, write 0x000000b0 to mode reg 0xf1c20cb8, actual timeout 16 sec
[ 1.143178] no led_3, ignore it!
[ 1.146916] no led_4, ignore it!
[ 1.150766] no led_5, ignore it!
[ 1.154468] no led_6, ignore it!
[ 1.158166] no led_7, ignore it!
[ 1.162781] usbcore: registered new interface driver usbhid
[ 1.169212] usbhid: USB HID core driver
[ 1.174278] ashmem: initialized
[ 1.178164] logger: created 256K log 'log_main'
[ 1.183516] logger: created 32K log 'log_events'
[ 1.188871] logger: created 32K log 'log_radio'
[ 1.194278] logger: created 32K log 'log_system'
[ 1.200956] script_get_item return type err, consider it no ldo
[ 1.208588] asoc: sndcodec <-> sunxi-codec mapping ok
[ 1.216351] TCP: cubic registered
[ 1.220218] NET: Registered protocol family 17
[ 1.225531] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 1.234380] ThumbEE CPU extension supported.
[ 1.239401] Registering SWP/SWPB emulation handler
[ 1.245869] platform reg-20-cs-ldoio0: Driver reg-20-cs-ldoio0 requests probe deferral
[ 1.255042] platform reg-20-cs-ldo4: Driver reg-20-cs-ldo4 requests probe deferral
[ 1.263759] platform reg-20-cs-ldo3: Driver reg-20-cs-ldo3 requests probe deferral
[ 1.272334] platform reg-20-cs-ldo2: Driver reg-20-cs-ldo2 requests probe deferral
[ 1.281020] platform reg-20-cs-ldo1: Driver reg-20-cs-ldo1 requests probe deferral
[ 1.289686] platform reg-20-cs-dcdc3: Driver reg-20-cs-dcdc3 requests probe deferral
[ 1.298452] platform reg-20-cs-dcdc2: Driver reg-20-cs-dcdc2 requests probe deferral
[ 1.307371] sunxi-rtc sunxi-rtc: setting system clock to 1970-01-01 04:37:28 UTC (16648)
[ 1.317941] ALSA device list:
[ 1.321435] #0: audiocodec
[ 1.324816] Warning: unable to open an initial console.
[ 1.330947] Waiting for root device /dev/ram0...
是不是bmp把dtb或者zImage的地址覆盖了?
bootcmd=fatload mmc 0:1 0x80008000 zImage;fatload mmc 0:1 0x80C00000 logo.bmp;bmp display 0x80C00000;fatload mmc 0:1 0x80C00000 dtb.bin;bootz 0x80008000 - 0x80C00000
bootdelay=0
把bootcmd里面的
fatload mmc 0:1 0x80C00000 logo.bmp;bmp display 0x80C00000;
去掉也是不能启动。。。
问题现象描述:
主线是TF卡启动(系统可以正常),
uboot不带bmp命令,增加指令,做开机logo,
打开uboot几个相关配置之后开机一直卡在Starting kernel ...
不修改uboot之前正常开机log:
U-Boot SPL 2018.01 (Jan 31 2021 - 20:25:53)
DRAM: 32 MiB
Trying to boot from MMC1U-Boot 2018.01 (Jan 31 2021 - 20:25:53 -0500) Allwinner Technology
CPU: Allwinner F Series (SUNIV)
Model: Lichee Pi Nano
DRAM: 32 MiB
MMC: SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environmentIn: serial@1c25000
Out: serial@1c25000
Err: serial@1c25000
Net: No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot: 0
reading zImage
4043624 bytes read in 286 ms (13.5 MiB/s)
reading splash.bmp
385078 bytes read in 52 ms (7.1 MiB/s)
Unknown command 'bmp' - try 'help'
reading dtb.bin
11834 bytes read in 34 ms (339.8 KiB/s)
## Flattened Device Tree blob at 80c00000
Booting using the fdt blob at 0x80c00000
Loading Device Tree to 816fa000, end 816ffe39 ... OKStarting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.15.0-rc8-licheepi-nano (root@osboxes) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #34 Fri Jan 29 03:05:50 EST 2021
[ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[ 0.000000] OF: fdt: Machine model: Lichee Pi Nano
[ 0.000000] Memory policy: Data cache writeback
修改uboot,使之增加bmp:
1.
-> ARM architecture
[ * ] Enable graphical uboot console on HDMI, LCD or VGA
LCD panel timing details:
x:800,y:480,depth:18,pclk_khz:33000,le:87,ri:40,up:31,lo:13,hs:1,vs:1,sync:3,vmode:0
(PE6) LCD panel backlight pwm pin
2.
-> Device Drivers
- > Graphics support
[ * ] Enable colour frame buffer console
3.
-> Command line interface
-> Misc commands
[ * ] Enable 'bmp' command
编译uboot,烧写到tf卡8k偏移,开机log:
U-Boot SPL 2018.01 (Feb 01 2021 - 01:53:16)
DRAM: 32 MiB
Trying to boot from MMC1U-Boot 2018.01 (Feb 01 2021 - 01:53:16 -0500) Allwinner Technology
CPU: Allwinner F Series (SUNIV)
Model: Lichee Pi Nano
DRAM: 32 MiB
MMC: SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environmentSetting up a 800x480 lcd console (overscan 0x0)
In: serial@1c25000
Out: serial@1c25000
Err: serial@1c25000
Net: No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot: 0
reading zImage
4043624 bytes read in 287 ms (13.4 MiB/s)
reading dtb.bin
11834 bytes read in 34 ms (339.8 KiB/s)
## Flattened Device Tree blob at 80c00000
Booting using the fdt blob at 0x80c00000
Loading Device Tree to 80e01000, end 80e06e39 ... OKStarting kernel ...
运行在这里系统就卡住了。。。
对比发现
Loading Device Tree to 816fa000, end 816ffe39
Loading Device Tree to 80e01000, end 80e06e39
修改前后设备树的地址相差很大,
求大佬指点!!!
【已解决】见下面
[ 1526.819255] usb 1-1: new high-speed USB device number 8 using musb-hdrc [ 1527.779254] usb 1-1: new high-speed USB device number 9 using musb-hdrc [ 1527.963969] rndis_host 1-1:1.0 eth0: register 'rndis_host' at usb-musb-hdrc.1.auto-1, RNDIS device, ac:4b:b3:b9:eb:e5 [ 1527.976257] option 1-1:1.2: GSM modem (1-port) converter detected [ 1527.984359] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0 [ 1527.992359] option 1-1:1.3: GSM modem (1-port) converter detected [ 1528.000486] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1 [ 1528.008418] option 1-1:1.4: GSM modem (1-port) converter detected [ 1528.016821] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
# ifconfig lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) usb0 Link encap:Ethernet HWaddr 92:50:ED:2C:61:50 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) #
为什么我按照你说的改完内核和配置还是找不到网卡呢,有ttyUSB1-3三个节点,
你的也是合宙模块么?
重点参考我的2.2章节,哦不好意思,我2.2里面的uid,pid截图时写的不对,你移植的时候修改下就可以了。
【填坑求精】荔枝派rndis-host驱动合宙4G模块,荔枝派插入WIN/Unbutu识别为Rndis网卡
http://whycan.com/t_5919.html
(出处:哇酷开发者社区)
还是rndis用着爽!
#
# 拔掉模块
#
# [ 1059.077876] usb 1-1: USB disconnect, device number 3
[ 1059.083457] rndis_host 1-1:1.0 usb1: unregister 'rndis_host' usb-musb-hdrc.1.auto-1, RNDIS device
[ 1059.098645] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[ 1059.106833] option 1-1:1.2: device disconnected
[ 1059.116525] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[ 1059.124824] option 1-1:1.3: device disconnected
[ 1059.132794] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
[ 1059.141145] option 1-1:1.4: device disconnected[2]+ Done cat /dev/ttyUSB1
#
#
# 再次插入
#
#
# [ 1066.278029] usb 1-1: new high-speed USB device number 4 using musb-hdrc
[ 1066.463978] rndis_host 1-1:1.0 usb1: register 'rndis_host' at usb-musb-hdrc.1.auto-1, RNDIS device, 82:06:9b:08:30:76
[ 1066.476685] option 1-1:1.2: GSM modem (1-port) converter detected
[ 1066.484978] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 1066.493156] option 1-1:1.3: GSM modem (1-port) converter detected
[ 1066.501482] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 1066.509829] option 1-1:1.4: GSM modem (1-port) converter detected
[ 1066.516747] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2#
#
# ifconfig -a
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)usb0 Link encap:Ethernet HWaddr 7A:B3:77:BF:1D:BC
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)usb1 Link encap:Ethernet HWaddr 82:06:9B:08:30:76
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)#
#
#
# udhcpc -i usb1
udhcpc: started, v1.27.1
udhcpc: sending discover
udhcpc: sending select for 192.168.43.101
udhcpc: lease of 192.168.43.101 obtained, lease time 86400
deleting routers
adding dns 192.168.43.1
#
#
# ping p***.china***.com
PING p***.china***.com (1**.255.205.19): 56 data bytes
64 bytes from 1**.255.205.19: seq=0 ttl=115 time=60.075 ms
64 bytes from 1**.255.205.19: seq=1 ttl=115 time=59.394 ms
64 bytes from 1**.255.205.19: seq=2 ttl=115 time=57.790 ms
64 bytes from 1**.255.205.19: seq=3 ttl=115 time=67.194 ms
64 bytes from 1**.255.205.19: seq=4 ttl=115 time=66.751 ms
64 bytes from 1**.255.205.19: seq=5 ttl=115 time=66.210 ms
64 bytes from 1**.255.205.19: seq=6 ttl=115 time=65.574 ms
64 bytes from 1**.255.205.19: seq=7 ttl=115 time=65.002 ms
^Z[2]+ Stopped ping p***.china***.com
#
需要注意的是合宙的模块内置自动拨号,移远的需要AT拨号才可以获取IP。
# [13676.718011] usb 1-1: new high-speed USB device number 3 using musb-hdrc
[13676.901065] option 1-1:1.0: GSM modem (1-port) converter detected
[13676.909600] option 1-1:1.1: GSM modem (1-port) converter detected
[13676.916634] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[13676.926004] option 1-1:1.2: GSM modem (1-port) converter detected
[13676.933237] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[13676.943394] option 1-1:1.3: GSM modem (1-port) converter detected
[13676.950619] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3
[13676.960851] option 1-1:1.4: GSM modem (1-port) converter detected
[13676.968054] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB4
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:25 errors:0 dropped:0 overruns:0 frame:0
TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2632 (2.5 KiB) TX bytes:2632 (2.5 KiB)
usb0 Link encap:Ethernet HWaddr 22:05:2C:1B:73:F2
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
合宙的手册说明usb0和usb1是网络网卡,在移植的过程中,发现usb1被识别成GSM串口,
ifconfig -a查看只有lo和usb0网卡,usb0网卡怎么都不能自动获取ip,发现usb0网卡移植
没有RUNNING,并且ping之后TX,RX数据还是零。
后来才知道usb0不是识别出来的4G模块,是RNDIS-DEVICE网卡。
知道问题所在,就好下手,检查下内核驱动,果然是驱动有问题。
1.内核usb相关配置
编译模块
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4 modules
安装模块
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules_install INSTALL_MOD_PATH=/home/osboxes/rootfs/buildroot-2017.08/output/target/lib
把你的 ko 文件用上面的命令安装到你的根文件系统(根据具体情况调整参数),并删除安装目录下面的build和source目录,它软连接到源码。
2. 修改内核使之能驱动合宙模块
2.1 添加usb vid和pid
[内核]/drivers/usb/serial/option.c
2.2 增加Zero Packet(上图3)
# ifconfig -a
eth0 Link encap:Ethernet HWaddr AC:00:00:CE:B4:38
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
usb0 Link encap:Ethernet HWaddr 92:E6:A8:7C:97:DE
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
#
# udhcpc -i eth0
udhcpc: started, v1.27.1
[ 1398.968142] musb-hdrc musb-hdrc.1.auto: int hwep alloc failed for 1x16
ifconfig: SIOCSIFFLAGS: No space left on device
udhcpc: sending discover
udhcpc: sending select for 192.168.0.100
udhcpc: lease of 192.168.0.100 obtained, lease time 86400
deleting routers
adding dns 192.168.0.1
#
#
# ping 123.149.232.30
PING 123.149.232.30 (123.149.232.30): 56 data bytes
64 bytes from 123.149.232.30: seq=0 ttl=118 time=1473.042 ms
64 bytes from 123.149.232.30: seq=2 ttl=118 time=847.767 ms
64 bytes from 123.149.232.30: seq=3 ttl=118 time=554.274 ms
^C
--- 123.149.232.30 ping statistics ---
4 packets transmitted, 3 packets received, 25% packet loss
round-trip min/avg/max = 554.274/958.361/1473.042 ms
#
搞定,搞定!!!
开机运行emwin demo 的固件: v3s_flash_32m_20191219_adbd_emwin.tgz
可以直接用 adb shell 进入命令行.
求大佬指教,V3s不是Arm9怎么运行的emwin?
也发一个荔枝派zero 全志V3s 32M spi flash 固件,800x480 LCD, 开机自动运行 Qt analogclock
http://whycan.com/t_3400.html#p47841
(出处:哇酷开发者社区)
可惜不能用这个固件测试,我的是荔枝派nano
udhcpc -i usb0
不行,
# udhcpc -i usb0
udhcpc: started, v1.27.1
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
^C
#
荔枝派nano插入合宙的4G模块,驱动识别出来了(这个模块在WIN10上面驱动可以正常使用)。
# [13676.718011] usb 1-1: new high-speed USB device number 3 using musb-hdrc
[13676.901065] option 1-1:1.0: GSM modem (1-port) converter detected
[13676.909600] option 1-1:1.1: GSM modem (1-port) converter detected
[13676.916634] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[13676.926004] option 1-1:1.2: GSM modem (1-port) converter detected
[13676.933237] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[13676.943394] option 1-1:1.3: GSM modem (1-port) converter detected
[13676.950619] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3
[13676.960851] option 1-1:1.4: GSM modem (1-port) converter detected
[13676.968054] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB4
#
# ifconfig -a
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:25 errors:0 dropped:0 overruns:0 frame:0
TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2632 (2.5 KiB) TX bytes:2632 (2.5 KiB)
usb0 Link encap:Ethernet HWaddr 22:05:2C:1B:73:F2
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
#
# ifconfig usb0 up
#
# udhcpc -i usb0
udhcpc: started, v1.27.1
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
^C
#
获取ip一直这样。。。
udhcpc: sending discover
检查了一下/usr/share/udhcpc/default.script这个文件也存在
# cat /usr/share/udhcpc/default.script
#!/bin/sh
# udhcpc script edited by Tim Riker <Tim@Rikers.org>
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
RESOLV_CONF="/etc/resolv.conf"
[ -e $RESOLV_CONF ] || touch $RESOLV_CONF
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"
case "$1" in
deconfig)
/sbin/ifconfig $interface up
/sbin/ifconfig $interface 0.0.0.0
# drop info from this interface
# resolv.conf may be a symlink to /tmp/, so take care
TMPFILE=$(mktemp)
grep -vE "# $interface\$" $RESOLV_CONF > $TMPFILE
cat $TMPFILE > $RESOLV_CONF
rm -f $TMPFILE
if [ -x /usr/sbin/avahi-autoipd ]; then
/usr/sbin/avahi-autoipd -k $interface
fi
;;
leasefail|nak)
if [ -x /usr/sbin/avahi-autoipd ]; then
/usr/sbin/avahi-autoipd -wD $interface --no-chroot
fi
;;
renew|bound)
if [ -x /usr/sbin/avahi-autoipd ]; then
/usr/sbin/avahi-autoipd -k $interface
fi
/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
if [ -n "$router" ] ; then
echo "deleting routers"
while route del default gw 0.0.0.0 dev $interface 2> /dev/null; do
:
done
for i in $router ; do
route add default gw $i dev $interface
done
fi
# drop info from this interface
# resolv.conf may be a symlink to /tmp/, so take care
TMPFILE=$(mktemp)
grep -vE "# $interface\$" $RESOLV_CONF > $TMPFILE
cat $TMPFILE > $RESOLV_CONF
rm -f $TMPFILE
# prefer rfc3359 domain search list (option 119) if available
if [ -n "$search" ]; then
search_list=$search
elif [ -n "$domain" ]; then
search_list=$domain
fi
[ -n "$search_list" ] &&
echo "search $search_list # $interface" >> $RESOLV_CONF
for i in $dns ; do
echo adding dns $i
echo "nameserver $i # $interface" >> $RESOLV_CONF
done
;;
esac
HOOK_DIR="$0.d"
for hook in "${HOOK_DIR}/"*; do
[ -f "${hook}" -a -x "${hook}" ] || continue
"${hook}" "${@}"
done
exit 0
#
#
使用AT命令都可以获取到模块ip
echo ATE0 > /dev/ttyUSB3
# cat /dev/ttyUSB3 &
#
# echo ATE0 > /dev/ttyUSB3
ATE0
#
# echo ATI > /dev/ttyUSB3
AirM2M_720SG_V290_LTE_AT
OK
#
# echo AT+CSTT="CMNET" > /dev/ttyUSB3
OK
# echo AT+CIICR > /dev/ttyUSB3
#
CONNECT
OK
# echo AT+CIFSR > /dev/ttyUSB3
#
10.152.249.168
#
正确识别4G驱动!
# ifconfig -a
eth0 Link encap:Ethernet HWaddr AC:00:00:CE:B4:38
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
usb0 Link encap:Ethernet HWaddr 92:E6:A8:7C:97:DE
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
#
# udhcpc -i eth0
udhcpc: started, v1.27.1
[ 1398.968142] musb-hdrc musb-hdrc.1.auto: int hwep alloc failed for 1x16
ifconfig: SIOCSIFFLAGS: No space left on device
udhcpc: sending discover
udhcpc: sending select for 192.168.0.100
udhcpc: lease of 192.168.0.100 obtained, lease time 86400
deleting routers
adding dns 192.168.0.1
#
#
# ping 123.149.232.30
PING 123.149.232.30 (123.149.232.30): 56 data bytes
64 bytes from 123.149.232.30: seq=0 ttl=118 time=1473.042 ms
64 bytes from 123.149.232.30: seq=2 ttl=118 time=847.767 ms
64 bytes from 123.149.232.30: seq=3 ttl=118 time=554.274 ms
^C
--- 123.149.232.30 ping statistics ---
4 packets transmitted, 3 packets received, 25% packet loss
round-trip min/avg/max = 554.274/958.361/1473.042 ms
#
=================================================================
荔枝派TF卡支持合宙4G模块系统镜像(usb支持adb,rdins,串口等)
F1C100S_RNDIS_HOST_4G_Module.7z
怎么是显示在虚拟机上?
可以写个模块,在模块里先释放这个pin,然后重新申请一遍。或者在kernel里加点printk定位下问题呗。
大帅 说:这么神奇!!!
我也遇到同样的问题了,在f1c600有两路pwm,PA2和PE6, PA2始终是错误,PE6正常:
root@TinaLinux:/# echo 0 > sys/class/pwm/pwmchip0/export
sh: write error: Resource busy
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/# echo 1 > sys/class/pwm/pwmchip0/export
root@TinaLinux:/#
同样的配置和驱动,在dts和sys_config.fex里面检查了很多次,配置没有冲突了,另外pwm的驱动移植到内核4.15跑起来两路pwm都正常,降低一下tina版本编译出来在c600上面跑两路也正常,
奇怪了,为什么在当前的tina3.5下面不行呢???
root@TinaLinux:/# cat tmp/pwm
platform/1c21000.pwm, 2 PWM devices
pwm-0 (lcd ): requested enabled
pwm-1 ((null) ):
这么神奇!!!
我也遇到同样的问题了,在f1c600有两路pwm,PA2和PE6, PA2始终是错误,PE6正常:
root@TinaLinux:/# echo 0 > sys/class/pwm/pwmchip0/export
sh: write error: Resource busy
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/# echo 1 > sys/class/pwm/pwmchip0/export
root@TinaLinux:/#
同样的配置和驱动,在dts和sys_config.fex里面检查了很多次,配置没有冲突了,另外pwm的驱动移植到内核4.15跑起来两路pwm都正常,降低一下tina版本编译出来在c600上面跑两路也正常,
奇怪了,为什么在当前的tina3.5下面不行呢???
root@TinaLinux:/# echo 0 > sys/class/pwm/pwmchip0/export
root@TinaLinux:/#
睡了一觉,解决了。
这么神奇!!!
我也遇到同样的问题了,在f1c600有两路pwm,PA2和PE6, PA2始终是错误,PE6正常:
root@TinaLinux:/# echo 0 > sys/class/pwm/pwmchip0/export
sh: write error: Resource busy
root@TinaLinux:/#
root@TinaLinux:/#
root@TinaLinux:/# echo 1 > sys/class/pwm/pwmchip0/export
root@TinaLinux:/#
同样的配置和驱动,在dts和sys_config.fex里面检查了很多次,配置没有冲突了,另外pwm的驱动移植到内核4.15跑起来两路pwm都正常,降低一下tina版本编译出来在c600上面跑两路也正常,
奇怪了,为什么在当前的tina3.5下面不行呢???
buildroot:root,licheepi
正确使用adb姿势:
./work/run_adbd.sh
正确演示ucgui姿势:
./work/ucgui-emblinux
触摸库:
./work/run_export_tslib.sh
固件,此处下载 f1c100s_20200714-1743.rar
包含烧写批处理,此处下载 f1c100s.rar
gui演示:
ucgui的颜色不对,还没有研究明白,正常颜色运行的在这看:
https://whycan.cn/t_3316.html
adb在win7下面驱动识别正常,但是不能发现adb device, 在虚拟机Ubuntu里面adb使用正常,可以看这里:
https://whycan.cn/t_4876.html
ns2009触摸使用演示可以看这里:
https://whycan.cn/t_4908.html
2009触摸有飞线,触摸点会跳,还没有研究明白怎么解决。
# [ 51.276001] g_ffs gadget: high-speed config #1: FunctionFS + RNDIS
[ 299.120687] g_ffs gadget: high-speed config #2: FunctionFS + ECM
发现在win7和Ubuntu下面,licheepi串口的消息不一样:
win7 : #1: FunctionFS + RNDIS
Ubuntu: #2: FunctionFS + ECM
win7 adb版本:
E:\桌面\platform-tools_r30.0.3-windows\platform-tools>adb version
Android Debug Bridge version 1.0.41
Version 30.0.3-6597393
Installed as E:\桌面\platform-tools_r30.0.3-windows\platform-tools\adb.exe
Ubuntu adb版本:
# osboxes@osboxes:~$ adb version
Android Debug Bridge version 1.0.32
osboxes@osboxes:~$
试一试这个固件: https://whycan.cn/t_3400.html#p48760
我用别人的固件是没有问题,由于要写一个驱动,没有别人的系统源码,自己从0移植了一套。
把软件包装上,然后先把手机adb测试成功再接开发板。
首先想到的是不是win7下面原来使用的adb比较老,于是在下载一个:
ADB和Fastboot for Windows
https://dl.google.com/android/repository/platform-tools-latest-windows.zip
用这个还adb是不行,信息在下面图片里面有。
然后去虚拟机里安装adb工具试试,一顿操作之后,可以使用了!
疑问: 有没有办法可以在win7下面使用adb?
即可起俺要焚香更衣,斋戒沐浴,叩等大佬赐教
俺也遇到这样的问题:
在公司的电脑win7 专业sp1,licheepi nano 必须要先短接flash的2-4管脚,然后用排针上面5v上电进入FEL模式,必须最后再插入usb线,电脑方能识别出芯片!!!
疑问1:不知道为什么住在海景别墅里面的大佬们,可以先短接flash的2-4管教,然后直接深深插入usb,电脑就识别出芯片了,然俺的就不行???
疑问2:在家里的电脑win7 旗舰版sp1上面装驱动,使用同样的操作姿势,电脑就是不能识别出芯片! 怀疑是系统的问题,然后msdn上搞个win7专业sp1重装系统,在纯洁的系统上,使用同样的操作姿势,还是不能识别出芯片,f1c100s进入FEL模式后,插入usb线电脑连叮咚声音都没有!!!
无数次的操作,usb的屁股都快插爆了,可恼哇可恼 。。。
特此俺是沐浴更衣,焚香斋戒,虔诚来海景别墅大门口求教。
取消下面两项试试:
Device Drivers > USB support > USB Gadget Support
[ ] RNDIS
[ ] Include configuration with RNDIS (Ethernet)
编译再烧写看看:
# modprobe g_ffs idVendor=0x18d1 idProduct=0x4e42 iSerialNumber="buildroot"
[ 203.119624] g_ffs: Unknown symbol rndis_borrow_net (err 0)
[ 203.127150] g_ffs: Unknown symbol rndis_borrow_net (err 0)
modprobe: can't load module g_ffs (kernel/drivers/usb/gadget/legacy/g_ffs.ko): unknown symbol in module, or unknown parameter
很明显失败了!!!
# reboot
# Stopping network: OK
Saving random seed... done.
Stopping logging: OK
umount: devtmpfs busy - remounted read-only
The system is going down NOW!
Sent SIGTERM to all processes
Sent SIGKILL to 20.550344 reboot: Restarting system
21.549981 Reboot failed -- System halted
修改设备树: (DockerLicheepi下面)
/work/c600/2.kernel/linux-f1c100s-480272lcd-test/arch/arm/boot/dts/suniv.dtsi
wdt: watchdog@1c20ca0 {
compatible = "allwinner,sun6i-a31-wdt";
reg = <0x01c20ca0 0x20>;
};
修改为:
wdt: watchdog@1c20ca0 {
compatible = "allwinner,sun6i-a31-wdt";
reg = <0x01c20ca0 0x20>;
status = "okay";
};
修改之后编译内核dts:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4 dtbs
上面不能解决问题!!!
==============================================================================
要是在配置linux内核时,未使能看门狗,而在系统restart的时候,主要是利用取消喂狗,来触发看门狗超时,从而引发复位。
选择 → Device Drivers → Watchdog Timer Support → WatchDog Timer Driver Core 和 Allwinner SoCs watchdog support
root@daeadcd74263:/work/c600/2.kernel/linux-f1c100s-480272lcd-test# make ARCH=arm menuconfig
---> Device Drivers
* Watchdog Timer Support --->
---> * WatchDog Timer Driver Core
...
---> <*> Allwinner SoCs watchdog support
保存退出再编译内核
root@daeadcd74263:/work/c600/2.kernel/linux-f1c100s-480272lcd-test# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4
问题解决了:
#
# reboot
# Stopping network: OK
Saving random seed... done.
Stopping logging: OK
umount: devtmpfs busy - remounted read-only
The system is going down NOW!
Sent SIGTERM to all processes
Sent SIGKILL to[ 21.795427] reboot: Restarting system
U-Boot SPL 2018.01 (Jul 08 2020 - 03:26:27)
DRAM: 32 MiB
Trying to boot from MMC1
Card did not respond to voltage select!
mmc_init: -95, time 22
spl: mmc init failed with error: -95
Trying to boot from sunxi SPI
U-Boot 2018.01 (Jul 08 2020 - 03:26:27 +0000) Allwinner Technology
CPU: Allwinner F Series (SUNIV)
Model: Lichee Pi Nano
DRAM: 32 MiB
MMC: SUNXI SD/MMC: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment
In: serial@1c25000
Out: serial@1c25000
Err: serial@1c25000
Net: No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0x100000, size 0x4000
SF: 16384 bytes @ 0x100000 Read: OK
device 0 offset 0x110000, size 0x400000
SF: 4194304 bytes @ 0x110000 Read: OK
## Flattened Device Tree blob at 80c00000
Booting using the fdt blob at 0x80c00000
Loading Device Tree to 816fa000, end 816ff144 ... OK
Starting kernel ...
昨天刚移植的系统,增加了adb,开机进shell里手动执行下面指令:
modprobe g_ffs idVendor=0x18d1 idProduct=0x4e42 iSerialNumber="buildroot"
mkdir -p /dev/usb-ffs/adb
mount -t functionfs adb /dev/usb-ffs/adb -o uid=2000,gid=2000
adbd &
然后插入usb,电脑也识别出adb设备了,但是在cmd里面adb shell错误:error: device not found
这是为啥?
插入usb之后提示:
[ 87.222118] g_ffs gadget: high-speed config #1: FunctionFS + RNDIS
是RNDIS影响的么?
1. 这是插入usb电脑驱动:
2. adb shell:
Microsoft Windows XP [版本 6.1.7601]
(C) 版权所有 1985-2001 Microsoft Corp.
F:\Lichee Nano\扩展\adb shell>adb shell
* daemon not running. starting it now *
* daemon started successfully *
error: device not found
3. 开机启动log:
#
U-Boot SPL 2018.01 (Jul 08 2020 - 03:26:27)
DRAM: 32 MiB
Trying to boot from MMC1
Card did not respond to voltage select!
mmc_init: -95, time 22
spl: mmc init failed with error: -95
Trying to boot from sunxi SPI
U-Boot 2018.01 (Jul 08 2020 - 03:26:27 +0000) Allwinner Technology
CPU: Allwinner F Series (SUNIV)
Model: Lichee Pi Nano
DRAM: 32 MiB
MMC: SUNXI SD/MMC: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment
In: serial@1c25000
Out: serial@1c25000
Err: serial@1c25000
Net: No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0x100000, size 0x4000
SF: 16384 bytes @ 0x100000 Read: OK
device 0 offset 0x110000, size 0x400000
SF: 4194304 bytes @ 0x110000 Read: OK
## Flattened Device Tree blob at 80c00000
Booting using the fdt blob at 0x80c00000
Loading Device Tree to 816fa000, end 816ff130 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.15.0-rc8-licheepi-nano (root@daeadcd74263) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #8 Tue Jul 7 03:34:50 UTC 2020
[ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[ 0.000000] OF: fdt: Machine model: Lichee Pi Nano
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] random: fast init done
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 8128
[ 0.000000] Kernel command line: console=ttyS0,115200 panic=5 rootwait root=/dev/mtdblock3 rw rootfstype=jffs2
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Memory: 22668K/32768K available (6144K kernel code, 240K rwdata, 1444K rodata, 1024K init, 249K bss, 10100K reserved, 0K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xc2800000 - 0xff800000 ( 976 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc2000000 ( 32 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0x(ptrval) - 0x(ptrval) (7136 kB)
[ 0.000000] .init : 0x(ptrval) - 0x(ptrval) (1024 kB)
[ 0.000000] .data : 0x(ptrval) - 0x(ptrval) ( 241 kB)
[ 0.000000] .bss : 0x(ptrval) - 0x(ptrval) ( 250 kB)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000045] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[ 0.000110] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000644] Console: colour dummy device 80x30
[ 0.000729] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[ 0.070230] pid_max: default: 32768 minimum: 301
[ 0.070537] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.070576] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.071988] CPU: Testing write buffer coherency: ok
[ 0.073611] Setting up static identity map for 0x80100000 - 0x80100058
[ 0.076117] devtmpfs: initialized
[ 0.082791] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.082854] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.083105] pinctrl core: initialized pinctrl subsystem
[ 0.085048] NET: Registered protocol family 16
[ 0.086441] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.088217] cpuidle: using governor menu
[ 0.114189] SCSI subsystem initialized
[ 0.114514] usbcore: registered new interface driver usbfs
[ 0.114689] usbcore: registered new interface driver hub
[ 0.114878] usbcore: registered new device driver usb
[ 0.115300] pps_core: LinuxPPS API ver. 1 registered
[ 0.115326] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.115387] PTP clock support registered
[ 0.115896] Advanced Linux Sound Architecture Driver Initialized.
[ 0.117367] clocksource: Switched to clocksource timer
[ 0.143820] NET: Registered protocol family 2
[ 0.145201] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.145278] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.145328] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.145579] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.145632] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.146079] NET: Registered protocol family 1
[ 0.147257] RPC: Registered named UNIX socket transport module.
[ 0.147296] RPC: Registered udp transport module.
[ 0.147313] RPC: Registered tcp transport module.
[ 0.147328] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.149611] NetWinder Floating Point Emulator V0.97 (double precision)
[ 0.151372] Initialise system trusted keyrings
[ 0.151939] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[ 0.167018] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.169373] NFS: Registering the id_resolver key type
[ 0.169456] Key type id_resolver registered
[ 0.169478] Key type id_legacy registered
[ 0.169591] jffs2: version 2.2. (NAND) ? 2001-2006 Red Hat, Inc.
[ 0.183954] Key type asymmetric registered
[ 0.183995] Asymmetric key parser 'x509' registered
[ 0.184189] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[ 0.184220] io scheduler noop registered
[ 0.184237] io scheduler deadline registered
[ 0.185024] io scheduler cfq registered (default)
[ 0.185058] io scheduler mq-deadline registered
[ 0.185077] io scheduler kyber registered
[ 0.186155] sun4i-usb-phy 1c13400.phy: Couldn't request ID GPIO
[ 0.195669] suniv-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.382501] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.389244] console [ttyS0] disabled
[ 0.409492] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 23, base_baud = 6250000) is a 16550A
[ 0.889289] console [ttyS0] enabled
[ 0.900051] panel-simple panel: panel supply power not found, using dummy regulator
[ 0.938039] brd: module loaded
[ 0.959194] loop: module loaded
[ 0.963055] SCSI Media Changer driver v0.25
[ 0.970823] m25p80 spi0.0: w25q128 (16384 Kbytes)
[ 0.975603] 4 ofpart partitions found on MTD device spi0.0
[ 0.981194] Creating 4 MTD partitions on "spi0.0":
[ 0.986006] 0x000000000000-0x000000100000 : "u-boot"
[ 0.993682] 0x000000100000-0x000000110000 : "dtb"
[ 1.000935] 0x000000110000-0x000000510000 : "kernel"
[ 1.008420] 0x000000510000-0x000001000000 : "rootfs"
[ 1.016399] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.023053] ehci-platform: EHCI generic platform driver
[ 1.028627] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.034846] ohci-platform: OHCI generic platform driver
[ 1.040543] usbcore: registered new interface driver usb-storage
[ 1.047767] i2c /dev entries driver
[ 1.107494] sunxi-mmc 1c0f000.mmc: base:0x3474c5ef irq:19
[ 1.114960] usbcore: registered new interface driver usbhid
[ 1.120655] usbhid: USB HID core driver
[ 1.142202] sun4i-codec 1c23c00.codec: ASoC: Failed to create component debugfs directory
[ 1.154898] sun4i-codec 1c23c00.codec: Codec <-> 1c23c00.codec mapping ok
[ 1.170129] NET: Registered protocol family 17
[ 1.174794] Key type dns_resolver registered
[ 1.181519] Loading compiled-in X.509 certificates
[ 1.197136] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc073a258)
[ 1.206032] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc073953c)
[ 1.213809] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 1.220461] [drm] No driver support for vblank timestamp query.
[ 1.274475] Console: switching to colour frame buffer device 60x34
[ 1.297793] sun4i-drm display-engine: fb0: frame buffer device
[ 1.304921] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[ 1.314088] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 1.326074] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 1.332038] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 1
[ 1.342196] hub 1-0:1.0: USB hub found
[ 1.346159] hub 1-0:1.0: 1 port detected
[ 1.353146] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 1.370531] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 1.377285] vcc3v3: disabling
[ 1.380374] ALSA device list:
[ 1.383350] #0: Loopback 1
[ 1.386268] #1: F1C100s Audio Codec
[ 1.390908] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 1.399624] cfg80211: failed to load regulatory.db
[ 1.502386] random: crng init done
[ 2.465482] VFS: Mounted root (jffs2 filesystem) on device 31:3.
[ 2.473507] devtmpfs: mounted
[ 2.481232] Freeing unused kernel memory: 1024K
Starting logging: OK
Initializing random number generator... done.
Starting network: OK
Welcome to Buildroot
Lichee login: root
Password:
#
#
# ls
# cd /
# ls
bin lib media proc sbin usr
dev lib32 mnt root sys var
etc linuxrc opt run tmp
#
#
# modprobe g_ffs idVendor=0x18d1 idProduct=0x4e42 iSerialNumber="buildroot"
[ 47.826561] file system registered
#
# mkdir -p /dev/usb-ffs/adb
#
# mount -t functionfs adb /dev/usb-ffs/adb -o uid=2000,gid=2000
#
# adbd &
#
# install_listener('tcp:5037','*smartsocket*')
[ 73.867570] read descriptors
[ 73.870542] read strings
[ 73.873285] using random self ethernet address
[ 73.877892] using random host ethernet address
[ 73.882405] using random self ethernet address
[ 73.886849] using random host ethernet address
[ 73.892646] usb0: HOST MAC 5e:9e:62:f6:5a:b5
[ 73.897026] usb0: MAC e2:63:4f:78:06:04
[ 73.901264] g_ffs gadget: g_ffs ready
[ 87.222118] g_ffs gadget: high-speed config #1: FunctionFS + RNDIS
#
这个板子玩一阵跑的挺欢腾的,
上周把F1C600板子上的norflash用热吹枪吹下来,吹到lichee nano上面,看cpu不一样能不能跑得起来,结果没跑起来。。。
接着就又把原来正常的norflash又吹到licheepi nano上了,
自从开启了抓狂模式。。。
电脑上怎么也识别不了licheepi nano了,不知道硬件哪里影响了?
短接norflash的1&4脚,2&4脚,1&2脚,芯片都快捣烂了,就是不能识别,驱动也装过来换过去,最后把norflash焊掉插usb还是不识别,
用F1C600的一个板测试了一下电脑得驱动没有问题,
licheepi咋这么顽固,不知道坛里高手能否给点指点,看看nano板子上是不是哪里有问题?
修改打印等级
想看看启动时候驱动的printk
想确定下,加载驱动的时候,能不能读取文件
只有loglevel=0时,功能正常,开机正常,7和8就不能开机了,这是什么道理?
#kernel command arguments
enforcing=1
earlyprintk=sunxi-uart,0x01c25000
initcall_debug=0
console=ttyS0,115200
nor_root=/dev/mtdblock4
nand_root=/dev/nandd
mmc_root=/dev/mmcblk0p7
init=/sbin/init
rdinit=/rdinit
loglevel=7
#loglevel=8
#loglevel=0
俺是这么干的更狠一些,看着应该没什么错,我再试试你的,感觉不像是a的问题。
https://whycan.cn/files/members/1398/QQ图片20200604104033.png
卧槽,卧槽,丢塔喽木~~~
问题原来一直是空间分配的太小了。。。。。。 __Gui_NumBytes__=8192000
其实只要看下arm汇编,以及对照下970的手册,查找下对应函数的功能,自己就可以搞定。
毕竟emwin这个涉及到商业产品。
百思不得其解。。。
参照regbbs的思路修改了一处,重新编译,
为啥俺的就是申请不到内存空间给gui?
void GUI_X_Config(void) {
printf("GUI_X_Config()\n");
static U32 aMemory[GUI_NUMBYTES / 4];
GUI_ALLOC_AssignMemory(aMemory, GUI_NUMBYTES);
GUI_SetDefaultFont(GUI_FONT_6X8);
unsigned int GetNumFreeBytes;
GetNumFreeBytes = GUI_ALLOC_GetNumUsedBlocks();
printf("GUI_ALLOC_GetNumUsedBlocks()=0x%x\n",GetNumFreeBytes);
GUI_ALLOC_DATATYPE i = GUI_ALLOC_GetNumFreeBytes();
printf("%d = GUI_ALLOC_GetNumFreeBytes().\n", i);
if ( i < (1024L * 2200) ){ //if ( i <RECOMMENDED_MEMORY) { //(1024L * 2200)
printf("Not enough memory available.\n");
return;
}
}
编译gcc:arm-2014.05/bin/arm-none-linux-gnueabi-gcc
运行结果:
# ./GUIDemo
uVideoSize = 0x177000
var.xres = 0x320
var.yres = 0x1e0
pVideoBuffer = 0xb6e78000
Main Task thread
WM_SetCreateFlags(WM_CF_MEMDEV)
GUI_Init()
GUI_X_Config()
GUI_ALLOC_GetNumUsedBlocks()=0x0
0 = GUI_ALLOC_GetNumFreeBytes().
Not enough memory available.
LCD_X_Config()
### g_xres=800 g_yres=480 g_bits_per_pixel=32
LCD_GetSwapXY()
No LCD calibration
800, 480, 32
0=GUI_Init()
WM_MULTIBUF_Enable(1)
GUIDEMO_Main()
GUIDEMO_Main()
Not enough memory available.
#
确实是有检测是否是Nuvoton的代码。但是跳过后,会出现 Illegal instruction。还没用查找到具体是哪个地方出现的这个。
https://whycan.cn/files/members/3640/em.png
流弊,继续跟进!!!
[ 1.469081] Waiting for root device /dev/mtdblock3...
[ 195.813232] random: crng init done
开机启动失败:
修改源码设备树,增加spi0分区信息:
增加设备树spi0下面分区信息:
partitions {
compatible = "fixed-partitions";
#address-cells = <0x1>;
#size-cells = <0x1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x100000>;
read-only;
};
partition@100000 {
label = "dtb";
reg = <0x100000 0x10000>;
read-only;
};
partition@110000 {
label = "kernel";
reg = <0x110000 0x400000>;
read-only;
};
partition@510000 {
label = "rootfs";
reg = <0x510000 0xaf0000>;
};
};
编译过程中的错误,需要修改源码如下:
1.linux_patch\drivers\dma\Makefile屏蔽mediatek和ti
#obj-y += mediatek/
obj-y += qcom/
#obj-y += ti/
obj-y += xilinx/
2.linux_patch\drivers\dma\Kconfig屏蔽mediatek和ti
source "drivers/dma/bestcomm/Kconfig"
#source "drivers/dma/mediatek/Kconfig"
source "drivers/dma/qcom/Kconfig"
source "drivers/dma/dw/Kconfig"
source "drivers/dma/hsu/Kconfig"
source "drivers/dma/sh/Kconfig"
#source "drivers/dma/ti/Kconfig"
3. linux_patch\sound\soc\sunxi\suniv-codec.c结构成员use_pmdown_time修改为pmdown_time
.pmdown_time = 1, /*.use_pmdown_time = 1,*/
用grep搜源码目录,我记得是脚本生成
惭愧。。。。
查找指令用错了,找到了!
Binary file drivers/net/mii.ko matches
Binary file drivers/net/usb/rtl8150.mod.o matches
Binary file drivers/net/usb/rtl8150.ko matches
Binary file arch/arm/boot/Image matches
Binary file .tmp_vmlinux1 matches
include/config/kernel.release:1:4.15.0-rc8-licheepi-nano
include/generated/utsrelease.h:1:#define UTS_RELEASE "4.15.0-rc8-licheepi-nano"
Binary file init/version.o matches
Binary file kernel/sys.o matches
Binary file kernel/module.o matches
Binary file .tmp_vmlinux2 matches
Binary file vmlinux matches
Binary file crypto/echainiv.mod.o matches
Binary file crypto/echainiv.ko matches
Binary file vmlinux.o matches
# dmesg
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.15.0-rc8-licheepi-nano
log日志的Linux version 4.15.0-rc8-licheepi-nano在内核代码里哪地方定义?
find . -name "*4.15.0-rc8-licheepi-nano*"
怎么搜索不到?
再次搜索只能在设备树里找到一些
find . -name "*licheepi*"
./arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
./arch/arm/boot/dts/sun5i-a13-licheepi-one.dts
./arch/arm/boot/dts/.suniv-f1c100s-licheepi-nano.dtb.dts.tmp
./arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts
./arch/arm/boot/dts/suniv-f1c100s-licheepi-nano.dts
./arch/arm/boot/dts/.suniv-f1c100s-licheepi-nano.dtb.cmd
./arch/arm/boot/dts/.suniv-f1c100s-licheepi-nano.dtb.d.pre.tmp
./arch/arm/boot/dts/.suniv-f1c100s-licheepi-nano.dtb.d.dtc.tmp
./arch/arm/boot/dts/suniv-f1c100s-licheepi-nano.dtb
F:\gosunxifel>gosunxifel.exe
2020/05/07 15:12:47 config.go 44 F://gosunxifel
2020/05/07 15:12:47 main.go 15 Running with CPUs:4
2020/05/07 15:12:47 main.go 19 app-version:v0.0.1
2020/05/07 15:12:47 ui.go 37 exec: "": executable file not found in %PATH%
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x74b159]
goroutine 1 [running]:
main.(*Myweb).Run(0xb5ff00)
F:/go_work/src/gosunxifel/ui.go:45 +0x49
main.main()
F:/go_work/src/gosunxifel/main.go:31 +0x95
F:\gosunxifel>
参考: https://whycan.cn/t_2041.html#p39583
针对主线kernel4.19,我增加了声卡驱动,原来正常的启动的固件uboot和rootfs没有修改,编译后zImage和dtb打包烧写后启动失败,求指点,这大致是什么原因?
U-Boot SPL 2018.01-00050-g85fc4ff3d1-dirty (Sep 01 2019 - 16:37:09)
DRAM: 32 MiB
SPL: Unsupported Boot Device!
Trying to boot from sunxi SPI
U-Boot 2018.01-00050-g85fc4ff3d1-dirty (Sep 01 2019 - 16:37:09 +0800) Allwinner Technology
CPU: Allwinner F Series (SUNIV)
Model: Lichee Pi Nano
DRAM: 32 MiB
Using default environment
Setting up a 800x480 lcd console (overscan 0x0)
In: serial@1c25000
Out: serial@1c25000
Err: serial@1c25000
Hit any key to stop autoboot: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0x60000, size 0x10000
SF: 65536 bytes @ 0x60000 Read: OK
Uncompressed size: 385078 = 0x5E036
device 0 offset 0x100000, size 0x4000
SF: 16384 bytes @ 0x100000 Read: OK
device 0 offset 0x110000, size 0x400000
SF: 4194304 bytes @ 0x110000 Read: OK
## Flattened Device Tree blob at 80c00000
Booting using the fdt blob at 0x80c00000
Loading Device Tree to 80ea4000, end 80ea9825 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.15.0-rc8-licheepi-nano (root@d8328ec61965) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #2 Mon Apr 27 02:08:11 UTC 2020
[ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[ 0.000000] OF: fdt: Machine model: Lichee Pi Nano
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] random: fast init done
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 8128
[ 0.000000] Kernel command line: console=ttyS0,115200 panic=5 rootwait root=/dev/mtdblock3 rw rootfstype=jffs2 vt.global_cursor_default=0
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Memory: 22668K/32768K available (6144K kernel code, 239K rwdata, 1420K rodata, 1024K init, 247K bss, 10100K reserved, 0K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xc2800000 - 0xff800000 ( 976 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc2000000 ( 32 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0x(ptrval) - 0x(ptrval) (7136 kB)
[ 0.000000] .init : 0x(ptrval) - 0x(ptrval) (1024 kB)
[ 0.000000] .data : 0x(ptrval) - 0x(ptrval) ( 240 kB)
[ 0.000000] .bss : 0x(ptrval) - 0x(ptrval) ( 248 kB)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000050] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[ 0.000119] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000766] Console: colour dummy device 80x30
[ 0.000863] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[ 0.070244] pid_max: default: 32768 minimum: 301
[ 0.070555] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.070598] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.072060] CPU: Testing write buffer coherency: ok
[ 0.074002] Setting up static identity map for 0x80100000 - 0x80100058
[ 0.076711] devtmpfs: initialized
[ 0.084927] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.085003] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.085268] pinctrl core: initialized pinctrl subsystem
[ 0.087349] NET: Registered protocol family 16
[ 0.089420] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.091474] cpuidle: using governor menu
[ 0.122661] SCSI subsystem initialized
[ 0.123064] usbcore: registered new interface driver usbfs
[ 0.123223] usbcore: registered new interface driver hub
[ 0.123454] usbcore: registered new device driver usb
[ 0.123977] pps_core: LinuxPPS API ver. 1 registered
[ 0.124005] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.124074] PTP clock support registered
[ 0.124637] Advanced Linux Sound Architecture Driver Initialized.
[ 0.126328] clocksource: Switched to clocksource timer
[ 0.155472] NET: Registered protocol family 2
[ 0.157174] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.157255] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.157306] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.157664] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.157737] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.158279] NET: Registered protocol family 1
[ 0.159565] RPC: Registered named UNIX socket transport module.
[ 0.159605] RPC: Registered udp transport module.
[ 0.159621] RPC: Registered tcp transport module.
[ 0.159636] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.161973] NetWinder Floating Point Emulator V0.97 (double precision)
[ 0.164008] Initialise system trusted keyrings
[ 0.164613] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[ 0.183212] NFS: Registering the id_resolver key type
[ 0.183304] Key type id_resolver registered
[ 0.183325] Key type id_legacy registered
[ 0.197632] Key type asymmetric registered
[ 0.197677] Asymmetric key parser 'x509' registered
[ 0.197904] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[ 0.197940] io scheduler noop registered
[ 0.197958] io scheduler deadline registered
[ 0.198778] io scheduler cfq registered (default)
[ 0.198808] io scheduler mq-deadline registered
[ 0.198826] io scheduler kyber registered
[ 0.200180] sun4i-usb-phy 1c13400.phy: Couldn't request ID GPIO
[ 0.210474] suniv-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.402120] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.409690] console [ttyS0] disabled
[ 0.429972] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 27, base_baud = 6250000) is a 16550A
[ 0.900221] console [ttyS0] enabled
[ 0.914714] panel-simple panel: panel supply power not found, using dummy regulator
[ 0.958972] brd: module loaded
[ 0.984794] loop: module loaded
[ 0.988969] SCSI Media Changer driver v0.25
编译错误:
结构体成员名不一样,这是为什么? 是内核不一样?还是Mesih Kilinc书写错误?
发现这个结构体没有成员.use_pmdown_time
static const struct snd_soc_component_driver sun8i_a23_codec_codec = {
.controls = sun8i_a23_codec_codec_controls,
.num_controls = ARRAY_SIZE(sun8i_a23_codec_codec_controls),
.dapm_widgets = sun8i_a23_codec_codec_widgets,
.num_dapm_widgets = ARRAY_SIZE(sun8i_a23_codec_codec_widgets),
.idle_bias_on = 1,
.use_pmdown_time = 1,
.endianness = 1,
.non_legacy_dai_naming = 1,
};
我的内核里结构体声明成员 是 pmdown_time:
/* component interface */
struct snd_soc_component_driver {
const char *name;
/* Default control and setup, added after probe() is run */
const struct snd_kcontrol_new *controls;
unsigned int num_controls;
const struct snd_soc_dapm_widget *dapm_widgets;
unsigned int num_dapm_widgets;
const struct snd_soc_dapm_route *dapm_routes;
unsigned int num_dapm_routes;
int (*probe)(struct snd_soc_component *);
void (*remove)(struct snd_soc_component *);
int (*suspend)(struct snd_soc_component *);
int (*resume)(struct snd_soc_component *);
/* pcm creation and destruction */
int (*pcm_new)(struct snd_soc_pcm_runtime *);
void (*pcm_free)(struct snd_pcm *);
/* component wide operations */
int (*set_sysclk)(struct snd_soc_component *component,
int clk_id, int source, unsigned int freq, int dir);
int (*set_pll)(struct snd_soc_component *component, int pll_id,
int source, unsigned int freq_in, unsigned int freq_out);
int (*set_jack)(struct snd_soc_component *component,
struct snd_soc_jack *jack, void *data);
/* DT */
int (*of_xlate_dai_name)(struct snd_soc_component *component,
struct of_phandle_args *args,
const char **dai_name);
int (*of_xlate_dai_id)(struct snd_soc_component *comment,
struct device_node *endpoint);
void (*seq_notifier)(struct snd_soc_component *, enum snd_soc_dapm_type,
int subseq);
int (*stream_event)(struct snd_soc_component *, int event);
int (*set_bias_level)(struct snd_soc_component *component,
enum snd_soc_bias_level level);
const struct snd_pcm_ops *ops;
const struct snd_compr_ops *compr_ops;
/* probe ordering - for components with runtime dependencies */
int probe_order;
int remove_order;
/* bits */
unsigned int idle_bias_on:1;
unsigned int suspend_bias_off:1;
unsigned int pmdown_time:1; /* care pmdown_time at stop */
unsigned int endianness:1;
unsigned int non_legacy_dai_naming:1;
};
sound/soc/sunxi/suniv-codec.c:862:3: error: 'const struct snd_soc_component_driver' has no member named 'use_pmdown_time'; did you mean 'pmdown_time'?
.use_pmdown_time = 1,
^~~~~~~~~~~~~~~
pmdown_time
sound/soc/sunxi/suniv-codec.c:1170:3: error: 'const struct snd_soc_component_driver' has no member named 'use_pmdown_time'; did you mean 'pmdown_time'?
.use_pmdown_time = 1,
^~~~~~~~~~~~~~~
pmdown_time
sound/soc/sunxi/suniv-codec.c:1198:3: error: 'const struct snd_soc_component_driver' has no member named 'use_pmdown_time'; did you mean 'pmdown_time'?
.use_pmdown_time = 1,
^~~~~~~~~~~~~~~
pmdown_time
sound/soc/sunxi/suniv-codec.c:1427:3: error: 'const struct snd_soc_component_driver' has no member named 'use_pmdown_time'; did you mean 'pmdown_time'?
.use_pmdown_time = 1,
^~~~~~~~~~~~~~~
pmdown_time
各路大神,这是什么错误啊?
root@osboxes:/work/EmbedSky/AWTK/awtk-linux-fb# scons
Traceback (most recent call last):
File "/usr/local/bin/scons", line 195, in <module>
import SCons.Script
File "/usr/local/lib/scons/SCons/Script/__init__.py", line 94, in <module>
from . import Main
File "/usr/local/lib/scons/SCons/Script/Main.py", line 1016
except SCons.Errors.StopError as e:
^
SyntaxError: invalid syntax
root@osboxes:/work/EmbedSky/AWTK/awtk-linux-fb#
arm-linux-gnueabi-gcc --with-arch=armv4 --static
编译的时候, 加上这个指令试一试。
或者:
arm-linux-gnueabi-gcc --with-arch=armv5te --static
error: unrecognized command line option ‘--with-arch=armv5te’; did you mean ‘-march=armv5te’?
root@osboxes:/work/Lichee/helloword/emWin/Sample/GUIDemo# make
/work/Lichee/helloword/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc --with-arch=armv5te -MD -O2 -D__Gui_NumBytes__=512000 -I. -I../../Config -I../../Include -Itslib -c Application/GUIDEMO_Automotive.c -o Application/GUIDEMO_Automotive.o
arm-linux-gnueabi-gcc: error: unrecognized command line option ‘--with-arch=armv5te’; did you mean ‘-march=armv5te’?
Makefile:34: recipe for target 'Application/GUIDEMO_Automotive.o' failed
make: *** [Application/GUIDEMO_Automotive.o] Error 1
@晕哥
我下载这个怎么有没有ARMv5?
用这个编译运行
# ./NuvotonGUIDemo
Illegal instruction
root@osboxes:/work/Lichee/helloword/emWin/Sample/GUIDemo# cd /work/Lichee/helloword/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi/bin/
root@osboxes:/work/Lichee/helloword/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi/bin# ./arm-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=./arm-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/work/Lichee/helloword/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi/bin/../libexec/gcc/arm-linux-gnueabi/7.4.1/lto-wrapper
Target: arm-linux-gnueabi
Configured with: '/home/tcwg-buildslave/workspace/tcwg-make-release_0/snapshots/gcc.git~linaro-7.4-2019.02/configure' SHELL=/bin/bash --with-mpc=/home/tcwg-buildslave/workspace/tcwg-make-release_0/_build/builds/destdir/x86_64-unknown-linux-gnu --with-mpfr=/home/tcwg-buildslave/workspace/tcwg-make-release_0/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gmp=/home/tcwg-buildslave/workspace/tcwg-make-release_0/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gnu-as --with-gnu-ld --disable-libmudflap --enable-lto --enable-shared --without-included-gettext --enable-nls --with-system-zlib --disable-sjlj-exceptions --enable-gnu-unique-object --enable-linker-build-id --disable-libstdcxx-pch --enable-c99 --enable-clocale=gnu --enable-libstdcxx-debug --enable-long-long --with-cloog=no --with-ppl=no --with-isl=no --disable-multilib --with-float=soft --with-mode=thumb --with-tune=cortex-a9 --with-arch=armv7-a --enable-threads=posix --enable-multiarch --enable-libstdcxx-time=yes --enable-gnu-indirect-function --with-build-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release_0/_build/sysroots/arm-linux-gnueabi --with-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release_0/_build/builds/destdir/x86_64-unknown-linux-gnu/arm-linux-gnueabi/libc --enable-checking=release --disable-bootstrap --enable-languages=c,c++,fortran,lto --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=arm-linux-gnueabi --prefix=/home/tcwg-buildslave/workspace/tcwg-make-release_0/_build/builds/destdir/x86_64-unknown-linux-gnu
Thread model: posix
gcc version 7.4.1 20181213 [linaro-7.4-2019.02 revision 56ec6f6b99cc167ff0c2f8e1a2eed33b1edc85d4] (Linaro GCC 7.4-2019.02)
root@osboxes:/work/Lichee/helloword/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi/bin#
sorry,你不能使用nuvoton里的LCDConf.c,要自己适配一个。
用这个模板即可,稍微改一下就行的。
比如你制作了自己的GUIDRV_Template16_API或者GUIDRV_Template32_API,然后把这个替换LCDConf.c里的这里
if (g_bits_per_pixel == 32)
GUI_DEVICE_CreateAndLink(&GUIDRV_Template32_API, GUICC_M888, 0, 0);
else
GUI_DEVICE_CreateAndLink(&GUIDRV_Template16_API, GUICC_M565, 0, 0);
模板:
https://whycan.cn/files/members/1592/GUIDRV_Template_c.txt为什么要自己适配呢?因为nuvoton改写了emWin源码,把库里的GUIDRV_LIN_32/GUIDRV_LIN_16改成依赖ge2d的了。
自己适配一个就不用它们,自己来实现一个在内存块里绘制点、线、面的驱动程序。当然这并不复杂,因为emWin有模板。
@armstrong
哇呀呀,万分的感谢大佬,~~ 又有动力继续搞了,哈哈
s3c2410/s3c2440是armv4t;
s3c2416才是跟f1c100s一样的,跟nuvoton也是一样的。
@armstrong
大神我在f1c100上面试了: 提示打不开/dev/ge2d,没有硬件加速。。。
另外我编译的时候用的是arm-none-linux-gnueabi-gcc不知道影响不?
# ./NuvotonGUIDemo
uVideoSize = 0x177000
var.xres = 0x320
var.yres = 0x1e0
pVideoBuffer = 0xb6d8f000
Main Task thread
WM_SetCreateFlags(WM_CF_MEMDEV)
GUI_Init()
GUI_X_Config()
GUI_ALLOC_GetNumUsedBlocks()=0x0
LCD_X_Config()
### g_xres=800 g_yres=480 g_bits_per_pixel=32
LCD_GetSwapXY()
LCD_SetVRAMAddrEx(0, (void *)pVideoBuffer)
No LCD calibration
Cannot open ge2d!
^C
#
#
还记得某位大神分享的emWin演示吗?它用的就是nuvoton发布的emWin库,运行几天几夜不死机。
https://whycan.cn/t_2689.html
谢谢大神,下载下来晚上回去试试~~
@armstrong 这是我在另外一个贴里的求助~~
//
// Recommended memory to run the sample with adequate performance
//
#define RECOMMENDED_MEMORY (1024L * 200)//(1024L * 2200)
void GUIDEMO_Main(void) {
printf("GUIDEMO_Main.1()\n");
#if GUI_WINSUPPORT
FRAMEWIN_SKINFLEX_PROPS Framewin_Props;
#endif
#if GUIDEMO_USE_AUTO_BK
U32 NumFreeBytes;
int BitsPerPixel;
#endif
//
// Check if recommended memory for the sample is available
//
if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
GUI_ErrorOut("Not enough memory available.");
U32 GetNumFreeBytes = GUI_ALLOC_GetNumFreeBytes();
printf("GUI_ALLOC_GetNumFreeBytes()=0x%x\n",GetNumFreeBytes);
printf("Not enough memory available.\n");
return;
}
printf("GUIDEMO_Main.2()\n");
[root@EmbedSky sky]# chmod 777 GUIDemo
[root@EmbedSky sky]# ./GUIDemo
uVideoSize = 0x25800
var.xres = 0x140
var.yres = 0xf0
pVideoBuffer = 0x40001000
Main Task thread
MainTask()
GUI_Init()
GUIDEMO_Main.1()
GUI_ALLOC_GetNumFreeBytes()=0x0
Not enough memory available.
[root@EmbedSky sky]#
为什么我编译新塘的emwin运行后老是这里申请不到内存呢?
下面是配置的emwin内存大小
#define GUI_NUMBYTES (5 * 1024 * 1024) //0x1000 //0x20000
static U32 aMemory[GUI_NUMBYTES / 4];
#define GUI_BLOCKSIZE 0x100
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* GUI_X_Config
*
* Purpose:
* Called during the initialization process in order to set up the
* available memory for the GUI.
*/
void GUI_X_Config(void) {
//
// 32 bit aligned memory area
//
// static U32 aMemory[GUI_NUMBYTES / 4];
//
// Assign memory to emWin
//
GUI_ALLOC_AssignMemory(aMemory, GUI_NUMBYTES);
//设置由存储器管理系统分配的存储块的平均尺寸
GUI_ALLOC_SetAvBlockSize(GUI_BLOCKSIZE); //块平均尺寸
//
// Set default font
//
GUI_SetDefaultFont(GUI_FONT_6X8);
}
emwin只需要fb0映射得到的一个虚拟内存指针,这个指针交给emwin,剩下的事情emwin自己能搞定。所有绘图函数emwin自带的。
能共享下新塘的V5.48k么?或者告知下在哪个下载,我在新塘github下的是5.46
我用的是#define GUI_VERSION 546081
用这个编译后运行,不知道GUI_Init()怎么没有调用这些函数GUI_X_Config();LCD_X_Config();
我手动加上这些函数,发现GUI_ALLOC_AssignMemory(aMemory, GUI_NUMBYTES);不论申请多大的空间都是失败,
并且查询下GUI_ALLOC_GetNumFreeBytes() 一直是等于0.
if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
GUI_ErrorOut("Not enough memory available.");
return;
}
往高手能指点迷津~~
欢迎大家测试,但是因为工作关系不方便回复,请大家谅解。
大家对固件有需求或者意见可以到下方跟帖留言,我在后面再改进,发布新版本。
//
// Recommended memory to run the sample with adequate performance
//
#define RECOMMENDED_MEMORY (1024L * 200)//(1024L * 2200)
void GUIDEMO_Main(void) {
printf("GUIDEMO_Main.1()\n");
#if GUI_WINSUPPORT
FRAMEWIN_SKINFLEX_PROPS Framewin_Props;
#endif
#if GUIDEMO_USE_AUTO_BK
U32 NumFreeBytes;
int BitsPerPixel;
#endif
//
// Check if recommended memory for the sample is available
//
if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
GUI_ErrorOut("Not enough memory available.");
U32 GetNumFreeBytes = GUI_ALLOC_GetNumFreeBytes();
printf("GUI_ALLOC_GetNumFreeBytes()=0x%x\n",GetNumFreeBytes);
printf("Not enough memory available.\n");
return;
}
printf("GUIDEMO_Main.2()\n");
[root@EmbedSky sky]# chmod 777 GUIDemo
[root@EmbedSky sky]# ./GUIDemo
uVideoSize = 0x25800
var.xres = 0x140
var.yres = 0xf0
pVideoBuffer = 0x40001000
Main Task thread
MainTask()
GUI_Init()
GUIDEMO_Main.1()
GUI_ALLOC_GetNumFreeBytes()=0x0
Not enough memory available.
[root@EmbedSky sky]#
为什么我编译新塘的emwin运行后老是这里申请不到内存呢?
下面是配置的emwin内存大小
#define GUI_NUMBYTES (5 * 1024 * 1024) //0x1000 //0x20000
static U32 aMemory[GUI_NUMBYTES / 4];
#define GUI_BLOCKSIZE 0x100
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* GUI_X_Config
*
* Purpose:
* Called during the initialization process in order to set up the
* available memory for the GUI.
*/
void GUI_X_Config(void) {
//
// 32 bit aligned memory area
//
// static U32 aMemory[GUI_NUMBYTES / 4];
//
// Assign memory to emWin
//
GUI_ALLOC_AssignMemory(aMemory, GUI_NUMBYTES);
//设置由存储器管理系统分配的存储块的平均尺寸
GUI_ALLOC_SetAvBlockSize(GUI_BLOCKSIZE); //块平均尺寸
//
// Set default font
//
GUI_SetDefaultFont(GUI_FONT_6X8);
}
本站下载: KEIL_Crack_2032.rar
虽然有好,还是表示感谢!
https://whycan.cn/files/members/1833/QQ图片20191025190053.png
这是tina的声卡开机日志,司徒的手撸的,没深入研究过,而且没法直接上100s的
0. 我看的miyoo.c作者是不是司徒大佬?
1. 你不是弄好了么?
2. 没法直接上100s,意思是这个驱动是f1c500的,需要修改驱动源码才能在f1c100上用是么?
3. tina声卡,是指tinyalsa吧, 不明白tinyalsa和alsa的区别,是不是如果底层硬件驱动好了话,这两都可以用没有啥区别?
刚未入门的小白,一下问得有点多,先谢谢大佬们的耐心解答!
可能在包涵的 dtsi 文件里面
我把dtb转为dts,dtsi会全部展开,里面并没有codec,
suniv-f1c100s-licheepi-nano-800480.dtb ---> suniv-f1c100s-licheepi-nano-800480.dts
<code>
/dts-v1/;
/ {
#address-cells = <0x1>;
#size-cells = <0x1>;
interrupt-parent = <0x1>;
model = "Lichee Pi Nano";
compatible = "licheepi,licheepi-nano", "allwinner,suniv-f1c100s", "allwinner,suniv";
clocks {
#address-cells = <0x1>;
#size-cells = <0x1>;
ranges;
clk-24M {
#clock-cells = <0x0>;
compatible = "fixed-clock";
clock-frequency = <0x16e3600>;
clock-output-names = "osc24M";
phandle = <0x6>;
};
clk-32k {
#clock-cells = <0x0>;
compatible = "fixed-clock";
clock-frequency = <0x8000>;
clock-output-names = "osc32k";
phandle = <0xb>;
};
clk-100M {
#clock-cells = <0x0>;
compatible = "fixed-clock";
clock-frequency = <0x5f5e100>;
clock-output-names = "fake-100M";
};
};
cpus {
#address-cells = <0x0>;
#size-cells = <0x0>;
cpu {
compatible = "arm,arm926ej-s";
device_type = "cpu";
};
};
display-engine {
compatible = "allwinner,suniv-display-engine";
allwinner,pipelines = <0x2>;
status = "okay";
};
soc {
compatible = "simple-bus";
#address-cells = <0x1>;
#size-cells = <0x1>;
ranges;
sram-controller@1c00000 {
compatible = "allwinner,sun4i-a10-sram-controller";
reg = <0x1c00000 0x30>;
#address-cells = <0x1>;
#size-cells = <0x1>;
ranges;
sram@10000 {
compatible = "mmio-sram";
reg = <0x10000 0x1000>;
#address-cells = <0x1>;
#size-cells = <0x1>;
ranges = <0x0 0x10000 0x1000>;
sram-section@0 {
compatible = "allwinner,sun4i-a10-sram-d";
reg = <0x0 0x1000>;
status = "okay";
phandle = <0x13>;
};
};
};
lradc@1c23400 {
compatible = "allwinner,sun4i-a10-lradc-keys";
reg = <0x1c23400 0x400>;
interrupts = <0x16>;
status = "okay";
vref-supply = <0x3>;
button@200 {
label = "Volume Up";
linux,code = <0x73>;
channel = <0x0>;
voltage = <0x30d40>;
};
button@400 {
label = "Volume Down";
linux,code = <0x72>;
channel = <0x0>;
voltage = <0x61a80>;
};
button@600 {
label = "Select";
linux,code = <0x161>;
channel = <0x0>;
voltage = <0x927c0>;
};
button@800 {
label = "Start";
linux,code = <0x160>;
channel = <0x0>;
voltage = <0xc3500>;
};
};
spi@1c05000 {
compatible = "allwinner,suniv-spi", "allwinner,sun8i-h3-spi";
reg = <0x1c05000 0x1000>;
interrupts = <0xa>;
clocks = <0x4 0x11 0x4 0x11>;
clock-names = "ahb", "mod";
resets = <0x4 0x4>;
status = "okay";
#address-cells = <0x1>;
#size-cells = <0x0>;
pinctrl-names = "default";
pinctrl-0 = <0x5>;
flash@0 {
#address-cells = <0x1>;
#size-cells = <0x1>;
compatible = "winbond,w25q128", "jedec,spi-nor";
reg = <0x0>;
spi-max-frequency = <0x2625a00>;
partitions {
compatible = "fixed-partitions";
#address-cells = <0x1>;
#size-cells = <0x1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x100000>;
read-only;
};
partition@100000 {
label = "dtb";
reg = <0x100000 0x10000>;
read-only;
};
partition@110000 {
label = "kernel";
reg = <0x110000 0x400000>;
read-only;
};
partition@510000 {
label = "rootfs";
reg = <0x510000 0xaf0000>;
};
};
};
};
spi@1c06000 {
compatible = "allwinner,suniv-spi", "allwinner,sun8i-h3-spi";
reg = <0x1c06000 0x1000>;
interrupts = <0xb>;
clocks = <0x4 0x12 0x4 0x12>;
clock-names = "ahb", "mod";
resets = <0x4 0x5>;
status = "disabled";
#address-cells = <0x1>;
#size-cells = <0x0>;
};
lcd-controller@1c0c000 {
compatible = "allwinner,suniv-tcon";
reg = <0x1c0c000 0x1000>;
interrupts = <0x1d>;
clocks = <0x4 0x15 0x4 0x39 0x6>;
clock-names = "ahb", "tcon-ch0", "tcon-ch1";
clock-output-names = "tcon-pixel-clock";
resets = <0x4 0x8>;
reset-names = "lcd";
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <0x7>;
ports {
#address-cells = <0x1>;
#size-cells = <0x0>;
port@0 {
#address-cells = <0x1>;
#size-cells = <0x0>;
reg = <0x0>;
endpoint@0 {
reg = <0x0>;
remote-endpoint = <0x8>;
phandle = <0x16>;
};
};
port@1 {
#address-cells = <0x1>;
#size-cells = <0x0>;
reg = <0x1>;
endpoint@0 {
reg = <0x0>;
remote-endpoint = <0x9>;
phandle = <0x17>;
};
};
};
};
mmc@1c0f000 {
compatible = "allwinner,suniv-mmc", "allwinner,sun7i-a20-mmc";
reg = <0x1c0f000 0x1000>;
clocks = <0x4 0xe 0x4 0x28 0x4 0x2a 0x4 0x29>;
clock-names = "ahb", "mmc", "output", "sample";
resets = <0x4 0x1>;
reset-names = "ahb";
interrupts = <0x17>;
pinctrl-names = "default";
pinctrl-0 = <0xa>;
status = "okay";
#address-cells = <0x1>;
#size-cells = <0x0>;
vmmc-supply = <0x3>;
bus-width = <0x4>;
broken-cd;
};
mmc@1c10000 {
compatible = "allwinner,suniv-mmc", "allwinner,sun7i-a20-mmc";
reg = <0x1c10000 0x1000>;
clocks = <0x4 0xf 0x4 0x2b 0x4 0x2d 0x4 0x2c>;
clock-names = "ahb", "mmc", "output", "sample";
resets = <0x4 0x2>;
reset-names = "ahb";
interrupts = <0x18>;
status = "disabled";
#address-cells = <0x1>;
#size-cells = <0x0>;
};
clock@1c20000 {
compatible = "allwinner,suniv-ccu";
reg = <0x1c20000 0x400>;
clocks = <0x6 0xb>;
clock-names = "hosc", "losc";
#clock-cells = <0x1>;
#reset-cells = <0x1>;
phandle = <0x4>;
};
interrupt-controller@1c20400 {
compatible = "allwinner,suniv-ic";
reg = <0x1c20400 0x400>;
interrupt-controller;
#interrupt-cells = <0x1>;
phandle = <0x1>;
};
pinctrl@1c20800 {
compatible = "allwinner,suniv-pinctrl";
reg = <0x1c20800 0x400>;
interrupts = <0x26 0x27 0x28>;
clocks = <0x4 0x24 0x6 0xb>;
clock-names = "apb", "hosc", "losc";
gpio-controller;
interrupt-controller;
#interrupt-cells = <0x3>;
#gpio-cells = <0x3>;
phandle = <0xd>;
spi0-pins-pc {
pins = "PC0", "PC1", "PC2", "PC3";
function = "spi0";
phandle = <0x5>;
};
lcd-rgb666-pins {
pins = "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", "PD18", "PD19", "PD20", "PD21";
function = "lcd";
phandle = <0x7>;
};
rtp-pins {
pins = "PA0", "PA1", "PA2", "PA3";
function = "rtp";
phandle = <0xe>;
};
uart-pins-pe {
pins = "PE0", "PE1";
function = "uart0";
phandle = <0x10>;
};
uart-pins-pe78 {
pins = "PE7", "PE8";
function = "uart2";
phandle = <0x11>;
};
i2c0 {
pins = "PE11", "PE12";
function = "i2c0";
phandle = <0xc>;
};
mmc0-pins {
pins = "PF0", "PF1", "PF2", "PF3", "PF4", "PF5";
function = "mmc0";
phandle = <0xa>;
};
pwm0 {
pins = "PE12";
function = "pwm0";
};
pwm1 {
pins = "PE6";
function = "pwm1";
phandle = <0xf>;
};
};
i2c@1C27000 {
compatible = "allwinner,sun6i-a31-i2c";
reg = <0x1c27000 0x400>;
interrupts = <0x7>;
clocks = <0x4 0x21>;
resets = <0x4 0x14>;
pinctrl-names = "default";
pinctrl-0 = <0xc>;
status = "okay";
#address-cells = <0x1>;
#size-cells = <0x0>;
rtc@51 {
compatible = "nxp,pcf8563";
reg = <0x51>;
};
touchscreen@5d {
compatible = "goodix,gt911";
reg = <0x5d>;
interrupt-parent = <0xd>;
interrupts = <0x4 0x3 0x2>;
pinctrl-names = "default";
irq-gpios = <0xd 0x4 0x3 0x0>;
reset-gpios = <0xd 0x4 0x9 0x0>;
touchscreen-swapped-x-y;
};
touchscreen@14 {
compatible = "goodix,gt911";
reg = <0x14>;
interrupt-parent = <0xd>;
interrupts = <0x4 0x3 0x2>;
pinctrl-names = "default";
irq-gpios = <0xd 0x4 0x3 0x0>;
reset-gpios = <0xd 0x4 0x9 0x0>;
touchscreen-swapped-x-y;
};
};
rtp@1c24800 {
compatible = "allwinner,sun4i-a10-ts";
reg = <0x1c24800 0x100>;
interrupts = <0x14>;
allwinner,ts-attached;
#thermal-sensor-cells = <0x0>;
pinctrl-names = "default";
pinctrl-0 = <0xe>;
status = "okay";
};
pwm@1c21000 {
compatible = "allwinner,sun7i-a20-pwm";
reg = <0x1c21000 0xc>;
clocks = <0x6>;
#pwm-cells = <0x3>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <0xf>;
};
timer@1c20c00 {
compatible = "allwinner,suniv-timer";
reg = <0x1c20c00 0x90>;
interrupts = <0xd>;
clocks = <0x6>;
};
watchdog@1c20ca0 {
compatible = "allwinner,sun6i-a31-wdt";
reg = <0x1c20ca0 0x20>;
interrupts = <0x10>;
status = "okay";
};
serial@1c25000 {
compatible = "snps,dw-apb-uart";
reg = <0x1c25000 0x400>;
interrupts = <0x1>;
reg-shift = <0x2>;
reg-io-width = <0x4>;
clocks = <0x4 0x25>;
resets = <0x4 0x17>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <0x10>;
rts-gpio = <0xd 0x4 0x9 0x0>;
rs485-rts-active-high;
rs485-rts-delay = <0x0 0x0>;
linux,rs485-enabled-at-boot-time;
};
serial@1c25400 {
compatible = "snps,dw-apb-uart";
reg = <0x1c25400 0x400>;
interrupts = <0x2>;
reg-shift = <0x2>;
reg-io-width = <0x4>;
clocks = <0x4 0x26>;
resets = <0x4 0x18>;
status = "disabled";
};
serial@1c25800 {
compatible = "snps,dw-apb-uart";
reg = <0x1c25800 0x400>;
interrupts = <0x3>;
reg-shift = <0x2>;
reg-io-width = <0x4>;
clocks = <0x4 0x27>;
resets = <0x4 0x19>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <0x11>;
rts-gpio = <0xd 0x4 0xa 0x0>;
rs485-rts-active-high;
rs485-rts-delay = <0x0 0x0>;
linux,rs485-enabled-at-boot-time;
};
usb@1c13000 {
compatible = "allwinner,suniv-musb";
reg = <0x1c13000 0x400>;
clocks = <0x4 0x13>;
resets = <0x4 0x6>;
interrupts = <0x1a>;
interrupt-names = "mc";
phys = <0x12 0x0>;
phy-names = "usb";
extcon = <0x12 0x0>;
allwinner,sram = <0x13 0x1>;
status = "okay";
dr_mode = "otg";
};
phy@1c13400 {
compatible = "allwinner,suniv-usb-phy";
reg = <0x1c13400 0x10>;
reg-names = "phy_ctrl";
clocks = <0x4 0x30>;
clock-names = "usb0_phy";
resets = <0x4 0x0>;
reset-names = "usb0_reset";
#phy-cells = <0x1>;
status = "okay";
usb0_id_det-gpio = <0xd 0x4 0x2 0x0>;
phandle = <0x12>;
};
display-frontend@1e00000 {
compatible = "allwinner,suniv-display-frontend";
reg = <0x1e00000 0x20000>;
interrupts = <0x1e>;
clocks = <0x4 0x1b 0x4 0x38 0x4 0x35>;
clock-names = "ahb", "mod", "ram";
resets = <0x4 0xe>;
status = "disabled";
phandle = <0x2>;
ports {
#address-cells = <0x1>;
#size-cells = <0x0>;
port@1 {
#address-cells = <0x1>;
#size-cells = <0x0>;
reg = <0x1>;
endpoint@0 {
reg = <0x0>;
remote-endpoint = <0x14>;
phandle = <0x15>;
};
};
};
};
display-backend@1e60000 {
compatible = "allwinner,suniv-display-backend";
reg = <0x1e60000 0x10000>;
reg-names = "be";
interrupts = <0x1f>;
clocks = <0x4 0x1a 0x4 0x37 0x4 0x36>;
clock-names = "ahb", "mod", "ram";
resets = <0x4 0xd>;
reset-names = "be";
assigned-clocks = <0x4 0x37>;
assigned-clock-rates = <0x11e1a300>;
ports {
#address-cells = <0x1>;
#size-cells = <0x0>;
port@0 {
#address-cells = <0x1>;
#size-cells = <0x0>;
reg = <0x0>;
endpoint@0 {
reg = <0x0>;
remote-endpoint = <0x15>;
phandle = <0x14>;
};
};
port@1 {
#address-cells = <0x1>;
#size-cells = <0x0>;
reg = <0x1>;
endpoint@0 {
reg = <0x0>;
remote-endpoint = <0x16>;
phandle = <0x8>;
};
};
};
};
};
aliases {
serial0 = "/soc/serial@1c25000";
serial2 = "/soc/serial@1c25800";
spi0 = "/soc/spi@1c05000";
};
chosen {
stdout-path = "serial0:115200n8";
};
panel {
compatible = "okaya,rs800480t-7x0gp", "simple-panel";
#address-cells = <0x1>;
#size-cells = <0x0>;
port@0 {
reg = <0x0>;
#address-cells = <0x1>;
#size-cells = <0x0>;
endpoint@0 {
reg = <0x0>;
remote-endpoint = <0x17>;
phandle = <0x9>;
};
};
};
vcc3v3 {
compatible = "regulator-fixed";
regulator-name = "vcc3v3";
regulator-min-microvolt = <0x325aa0>;
regulator-max-microvolt = <0x325aa0>;
phandle = <0x3>;
};
};
</code>
司徒的miyoo kernel 可以播放声音: https://github.com/qq516333132/f1c500s_kernel
前面 @傅伟清 已经放弃治疗了, 改用 tina3.x
1. 这个问题是出在哪里了?内核么?
2. @傅伟清 已经放弃了,用tinyalsa可以了么,意思是alsa在这个nano上不行,还是哪里不对?
Nano板子开机没有识别出硬件声卡,这个问题该如何下手解决?
[ 3.626561] ALSA device list:
[ 3.629602] #0: Loopback 1
# ls -lh /sys/firmware/devicetree/base/
total 0
-r--r--r-- 1 root root 4 Jan 1 00:00 #address-cells
-r--r--r-- 1 root root 4 Jan 1 00:00 #size-cells
drwxr-xr-x 2 root root 0 Jan 1 00:00 aliases
drwxr-xr-x 2 root root 0 Jan 1 00:00 chosen
drwxr-xr-x 5 root root 0 Jan 1 00:00 clocks
-r--r--r-- 1 root root 63 Jan 1 00:00 compatible
drwxr-xr-x 3 root root 0 Jan 1 00:00 cpus
drwxr-xr-x 2 root root 0 Jan 1 00:00 display-engine
-r--r--r-- 1 root root 4 Jan 1 00:00 interrupt-parent
drwxr-xr-x 2 root root 0 Jan 1 00:00 memory
-r--r--r-- 1 root root 15 Jan 1 00:00 model
-r--r--r-- 1 root root 1 Jan 1 00:00 name
drwxr-xr-x 3 root root 0 Jan 1 00:00 panel
drwxr-xr-x 24 root root 0 Jan 1 00:00 soc
drwxr-xr-x 2 root root 0 Jan 1 00:00 vcc3v3
#
# ls /dev/snd -l
total 0
crw-rw---- 1 root audio 116, 0 Jan 1 00:00 controlC0
crw-rw---- 1 root audio 116, 24 Jan 1 00:00 pcmC0D0c
crw-rw---- 1 root audio 116, 16 Jan 1 00:00 pcmC0D0p
crw-rw---- 1 root audio 116, 25 Jan 1 00:00 pcmC0D1c
crw-rw---- 1 root audio 116, 17 Jan 1 00:00 pcmC0D1p
crw-rw---- 1 root audio 116, 33 Jan 1 00:00 timer
#
# cat /proc/asound/cards
0 [Loopback ]: Loopback - Loopback
Loopback 1
#
# cat /proc/asound/devices
0: [ 0] : control
16: [ 0- 0]: digital audio playback
17: [ 0- 1]: digital audio playback
24: [ 0- 0]: digital audio capture
25: [ 0- 1]: digital audio capture
33: : timer
#
# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
#
开机日志:
==========================================================================
# dmesg
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.15.0-licheepi-nano+ (root@ubuntu) (gcc version 7.4.1 20181213 [linaro-7.4-2019.02 revision 56ec6f6b99cc167ff0c2f8e1a2eed33b1edc85d4] (Linaro GCC 7.4-2019.02)) #42 Sat Aug 24 10:33:10 EDT 2019
[ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[ 0.000000] OF: fdt: Machine model: Lichee Pi Nano
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] On node 0 totalpages: 8192
[ 0.000000] Normal zone: 64 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 8192 pages, LIFO batch:0
[ 0.000000] random: fast init done
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 8128
[ 0.000000] Kernel command line: console=ttyS0,115200 panic=5 rootwait root=/dev/mtdblock3 rw rootfstype=jffs2 vt.global_cursor_default=0
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Memory: 22672K/32768K available (6144K kernel code, 236K rwdata, 1412K rodata, 1024K init, 245K bss, 10096K reserved, 0K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xc2800000 - 0xff800000 ( 976 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc2000000 ( 32 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0x(ptrval) - 0x(ptrval) (7136 kB)
[ 0.000000] .init : 0x(ptrval) - 0x(ptrval) (1024 kB)
[ 0.000000] .data : 0x(ptrval) - 0x(ptrval) ( 237 kB)
[ 0.000000] .bss : 0x(ptrval) - 0x(ptrval) ( 246 kB)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000047] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[ 0.000109] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000636] Console: colour dummy device 80x30
[ 0.000734] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[ 0.070236] pid_max: default: 32768 minimum: 301
[ 0.070566] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.070620] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.072227] CPU: Testing write buffer coherency: ok
[ 0.073955] Setting up static identity map for 0x80100000 - 0x80100058
[ 0.076584] devtmpfs: initialized
[ 0.084820] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.084896] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.085175] pinctrl core: initialized pinctrl subsystem
[ 0.087484] NET: Registered protocol family 16
[ 0.088935] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.091036] cpuidle: using governor menu
[ 0.120649] SCSI subsystem initialized
[ 0.121052] usbcore: registered new interface driver usbfs
[ 0.121213] usbcore: registered new interface driver hub
[ 0.121457] usbcore: registered new device driver usb
[ 0.121985] pps_core: LinuxPPS API ver. 1 registered
[ 0.122015] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.122093] PTP clock support registered
[ 0.122693] Advanced Linux Sound Architecture Driver Initialized.
[ 0.124967] clocksource: Switched to clocksource timer
[ 0.153741] NET: Registered protocol family 2
[ 0.155448] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.155541] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.155606] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.155968] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.156047] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.156591] NET: Registered protocol family 1
[ 0.157910] RPC: Registered named UNIX socket transport module.
[ 0.157956] RPC: Registered udp transport module.
[ 0.157974] RPC: Registered tcp transport module.
[ 0.157990] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.160374] NetWinder Floating Point Emulator V0.97 (double precision)
[ 0.162305] Initialise system trusted keyrings
[ 0.162842] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[ 0.181402] NFS: Registering the id_resolver key type
[ 0.181505] Key type id_resolver registered
[ 0.181526] Key type id_legacy registered
[ 0.181657] jffs2: version 2.2. (NAND) ? 2001-2006 Red Hat, Inc.
[ 0.197288] Key type asymmetric registered
[ 0.197333] Asymmetric key parser 'x509' registered
[ 0.197560] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[ 0.197596] io scheduler noop registered
[ 0.197617] io scheduler deadline registered
[ 0.198467] io scheduler cfq registered (default)
[ 0.198505] io scheduler mq-deadline registered
[ 0.198526] io scheduler kyber registered
[ 0.199909] sun4i-usb-phy 1c13400.phy: Couldn't request ID GPIO
[ 0.210220] suniv-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.395428] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.402690] console [ttyS0] disabled
[ 0.422975] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 27, base_baud = 6250000) is a 16550A
[ 0.905055] console [ttyS0] enabled
[ 0.931427] 1c25800.serial: ttyS2 at MMIO 0x1c25800 (irq = 28, base_baud = 6250000) is a 16550A
[ 0.948607] panel-simple panel: panel supply power not found, using dummy regulator
[ 0.958138] SCSI Media Changer driver v0.25
[ 0.966575] m25p80 spi0.0: w25q128 (16384 Kbytes)
[ 0.972330] 4 ofpart partitions found on MTD device spi0.0
[ 0.977959] Creating 4 MTD partitions on "spi0.0":
[ 0.982777] 0x000000000000-0x000000100000 : "u-boot"
[ 0.990467] 0x000000100000-0x000000110000 : "dtb"
[ 0.997997] 0x000000110000-0x000000510000 : "kernel"
[ 1.005613] 0x000000510000-0x000001000000 : "rootfs"
[ 1.013867] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.020544] ehci-platform: EHCI generic platform driver
[ 1.026193] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.032428] ohci-platform: OHCI generic platform driver
[ 1.038194] usbcore: registered new interface driver usb-storage
[ 1.046467] input: 1c23400.lradc as /devices/platform/soc/1c23400.lradc/input/input0
[ 1.056980] input: 1c24800.rtp as /devices/platform/soc/1c24800.rtp/input/input1
[ 1.065461] i2c /dev entries driver
[ 3.125051] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
[ 3.131614] rtc-pcf8563 0-0051: pcf8563_write_block_data: err=-110 addr=0e, data=03
[ 3.139325] rtc-pcf8563 0-0051: pcf8563_probe: write error
[ 3.144934] rtc-pcf8563: probe of 0-0051 failed with error -5
[ 3.153188] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 3.215112] sunxi-mmc 1c0f000.mmc: base:0xcffafbc9 irq:20
[ 3.222947] usbcore: registered new interface driver usbhid
[ 3.228666] usbhid: USB HID core driver
[ 3.251896] NET: Registered protocol family 17
[ 3.256750] Key type dns_resolver registered
[ 3.263278] Loading compiled-in X.509 certificates
[ 3.280221] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc0739cb8)
[ 3.289139] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc0738f9c)
[ 3.296925] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 3.303536] [drm] No driver support for vblank timestamp query.
[ 3.502927] Console: switching to colour frame buffer device 100x30
[ 3.541741] sun4i-drm display-engine: fb0: frame buffer device
[ 3.548986] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[ 3.558294] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 3.570331] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 3.576273] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 1
[ 3.586688] hub 1-0:1.0: USB hub found
[ 3.590637] hub 1-0:1.0: 1 port detected
[ 3.596699] hctosys: unable to open rtc device (rtc0)
[ 3.602256] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 3.619720] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 3.626561] ALSA device list:
[ 3.629602] #0: Loopback 1
[ 3.633417] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 3.642148] cfg80211: failed to load regulatory.db
[ 3.736825] random: crng init done
[ 5.307121] VFS: Mounted root (jffs2 filesystem) on device 31:3.
[ 5.316115] devtmpfs: mounted
[ 5.326284] Freeing unused kernel memory: 1024K
[ 14.927256] file system registered
[ 15.229620] uart closed, irq=27 .....................
[ 16.252087] read descriptors
[ 16.255210] read strings
[ 16.258031] g_ffs gadget: g_ffs ready
#
#
要使用的工具dtc
操作方法:
1.位置在:kernel目录/scripts/dtc/dtc下面,将dtc工具拷贝到交叉工具链所在的bin目录下,使用dtc -help查看是否成功。
2.也可以使用apt install device-tree-compiler直接将dtc工具安装到Ubuntu下,使用dtc -help查看是否成功。
root@osboxes:/work/Lichee/git-image# ls
linux-f1c100s-480272lcd-test linux-f1c100s-480272lcd-test.zip suniv-f1c100s-licheepi-nano-800480.dtb
使用转化命令:(譬如:要将suniv-f1c100s-licheepi-nano-800480.dtb转换为dts)
dtc -I dtb -O dts -o ./f1c100s-licheepi-nano-800480.dts ./suniv-f1c100s-licheepi-nano-800480.dtb
root@osboxes:/work/Lichee/git-image# ls
f1c100s-licheepi-nano-800480.dts linux-f1c100s-480272lcd-test.zip
linux-f1c100s-480272lcd-test suniv-f1c100s-licheepi-nano-800480.dtb
==========================================================================
安装时,会出现一下的情况:
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
重启Ubuntu解决。
-----------------------------------------------
16M spiflash adb & emwin 版本下载: suniv_f1c100s_w25q128_usb_adb_emwin_20190901.7z
可以提供下这个固件里面的emwin源码么? 或者库么?
表情:=)
https://whycan.cn/t_2860.html#p23405
应该是用了错误的工具链,或者使用了默认的配置,导致生成arm9无法识别的指令集
试一试这个: arm-2014.05-29-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
谢谢晕哥,可以了!
# ls
hello helloword.c
# ./hello
Hello World!
#
如果你的 c编译和制作文件系统的c编译不一致, 那么用静态链接:
arm-linux-gnueabi-gcc -o hello helloword.c -static
1.编译
root@e57c70d751e4:/work/helloword# arm-linux-gnueabi-gcc -o hello helloword.c -static
root@e57c70d751e4:/work/helloword# ls
hello helloword.c
静态编译出来3.88M的hello
2.adb push运行:
# ./hello
Illegal instruction
# ls -l hello
-rwxrwxrwx 1 root root 4063920 Sep 17 2019 hello
还是运行不了,变成Illegal instruction错误!
helloword.c
#include<stdio.h>
int main()
{
printf("Hello World!\n");
return 0;
}
-----------------------------------------------
16M spiflash adb & emwin 版本下载: suniv_f1c100s_w25q128_usb_adb_emwin_20190901.7z
烧写这个固件,我用gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi:
arm-linux-gnueabi-gcc -o hello helloword.c ,编译一个helloword,adb push到板子上运行,
# ./hello
Segmentation fault
怎么不能正常运行?
这个固件应该是什么gcc编译一个helloword?
小白请教大佬