您尚未登录。

#2 全志 SOC » Nano 运行lvgl 8.1的demo widgets死机问题求助。 » 2021-12-19 08:22:52

skliu
回复: 0

Lichee nano, lvgl 8.1, RGB 1024*600, Linux5.4.92(使用到了aodzip的buildroot包),使能触摸屏ns2009.
运行了20多分钟就死机了。 这个会是哪里问题?谢谢。

主频设定: cpu 768, RAM 200

# ./Ui_widgets
The framebuffer device was opened successfully.
1024x600, 32bpp
The framebuffer device was mapped to memory successfully.
[  283.924994] input input0: Poll touch data failed: -22
[  457.284939] input input0: Poll touch data failed: -22
[  580.724974] input input0: Poll touch data failed: -22
[ 1319.445066] input input0: Poll touch data failed: -22
[ 1503.725011] input input0: Poll touch data failed: -22
[ 1860.685013] input input0: Poll touch data failed: -22
[ 2165.845118] input input0: Poll touch data failed: -22
[ 2292.244920] input input0: Poll touch data failed: -22
[ 2503.299110] 8<--- cut here ---
[ 2503.302191] Unable to handle kernel NULL pointer dereference at virtual address 00000004
[ 2503.310261] pgd = f4c3d10b
[ 2503.312961] [00000004] *pgd=00000000
[ 2503.316535] Internal error: Oops: 817 [#1] ARM
[ 2503.320960] Modules linked in:
[ 2503.324017] CPU: 0 PID: 0 Comm: swapper Not tainted 5.4.92 #5
[ 2503.329738] Hardware name: Allwinner suniv Family
[ 2503.334452] PC is at callchain_trace+0x44/0x64
[ 2503.338899] LR is at generic_handle_irq+0x20/0x34
[ 2503.343586] pc : [<c010e51c>]    lr : [<c014a254>]    psr: a0000093
[ 2503.349826] sp : c0a01ee8  ip : c17f1184  fp : 00000001
[ 2503.355029] r10: c0a0329c  r9 : c0a00000  r8 : c17f3200
[ 2503.360232] r7 : 00000000  r6 : 00000001  r5 : c0a38768  r4 : 00000080
[ 2503.366733] r3 : c010e518  r2 : 00000000  r1 : 00000010  r0 : c17e5000
[ 2503.373235] Flags: NzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment none
[ 2503.380428] Control: 0005317f  Table: 80028000  DAC: 00000051
[ 2503.386154] Process swapper (pid: 0, stack limit = 0x9f80f19e)
[ 2503.391964] Stack: (0xc0a01ee8 to 0xc0a02000)
[ 2503.396313] 1ee0:                   00000010 c014a7e0 c0a6d0dc c0a01f18 ffffffff c0a01f4c
[ 2503.404466] 1f00: c0a2e508 c0353e44 c01095e8 60000013 ffffffff c0102188 00000000 0005317f
[ 2503.412618] 1f20: 0005217f 60000013 ffffe000 00000000 c0a03288 00000000 c0a2e508 c0a03228
[ 2503.420769] 1f40: c0a0329c 00000001 600000d3 c0a01f68 c01095f0 c01095e8 60000013 ffffffff
[ 2503.428921] 1f60: 00000053 00000000 ffffe000 c01397e0 c0a03220 c0a3f000 00000000 477d485f
[ 2503.437071] 1f80: 00000001 c0a3f048 c0a03228 c0a03220 c0a3f000 00000000 c1d59420 00000001
[ 2503.445223] 1fa0: c0925a30 c0139b18 c0a3f048 c0900ccc ffffffff ffffffff 00000000 c0900580
[ 2503.453374] 1fc0: 00000000 c0925a30 47784c03 00000000 00000000 c0900330 00000053 00003135
[ 2503.461525] 1fe0: 00000000 817f9000 41069265 00053177 00000000 00000000 00000000 00000000
[ 2503.469699] [<c010e51c>] (callchain_trace) from [<c014a7e0>] (__handle_domain_irq+0x48/0xa8)
[ 2503.478126] [<c014a7e0>] (__handle_domain_irq) from [<c0353e44>] (sun4i_handle_irq+0x3c/0x58)
[ 2503.486632] [<c0353e44>] (sun4i_handle_irq) from [<c0102188>] (__irq_svc+0x68/0x84)
[ 2503.494256] Exception stack(0xc0a01f18 to 0xc0a01f60)
[ 2503.499288] 1f00:                                                       00000000 0005317f
[ 2503.507439] 1f20: 0005217f 60000013 ffffe000 00000000 c0a03288 00000000 c0a2e508 c0a03228
[ 2503.515591] 1f40: c0a0329c 00000001 600000d3 c0a01f68 c01095f0 c01095e8 60000013 ffffffff
[ 2503.523754] [<c0102188>] (__irq_svc) from [<c01095e8>] (arch_cpu_idle+0x24/0x34)
[ 2503.531156] [<c01095e8>] (arch_cpu_idle) from [<c01397e0>] (do_idle+0x164/0x200)
[ 2503.538539] [<c01397e0>] (do_idle) from [<c0139b18>] (cpu_startup_entry+0xc/0x10)
[ 2503.546005] [<c0139b18>] (cpu_startup_entry) from [<c0900ccc>] (start_kernel+0x39c/0x444)
[ 2503.554158] Code: e1a03004 e5824000 e2a00000 e0824184 (e5820004)
[ 2503.560232] ---[ end trace 0b8c5897efa10081 ]---
[ 2503.564834] Kernel panic - not syncing: Fatal exception in interrupt
[ 2503.571166] ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]---

#3 Re: 全志 SOC » F1C100 licheeNano 修改屏幕分辨率问题 » 2021-12-14 20:09:50

感谢回复。我修改成800×600也没问题的。 已经弄好了,问题关闭了。

#4 Re: 全志 SOC » F1C100 licheeNano 修改屏幕分辨率问题 » 2021-12-13 20:40:33

CONFIG_FORCE_MAX_ZONEORDER=12
暂时修改这个搞定。

#5 Re: 全志 SOC » F1C100 licheeNano 修改屏幕分辨率问题 » 2021-12-12 15:18:10

感觉是framebuffer太小了。 这个如何修改呢?

#6 全志 SOC » F1C100 licheeNano 修改屏幕分辨率问题 » 2021-12-12 12:16:08

skliu
回复: 4

使用aodzip的buildroot-tiny200
屏幕是1024*600, RGB的(Sinlinx的7寸RBG).
修改了uboot_deconfig.

make sippeed_lichee_nano_deconfig
make

下载到spiflash运行。 如果uboot打印到屏幕,显示正常的。
进入linux, fbset发现是480x272的。
修改linux的dts里面的pannel.(“etron-dy,e231732"看这个分辨率一样,rgb666), 编译,写入flash,运行:

panel: panel {
 compatible = "netron-dy,e231732", "simple-panel";
 #address-cells = <1>;
 #size-cells = <0>;

  port@0 {
   reg = <0>;
   #address-cells = <1>;
   #size-cells = <0>;

   panel_input: endpoint@0 {
    reg = <0>;
    remote-endpoint = <&tcon0_out_lcd>;
   };
  };
 };

运行的有错误。

[    1.235407] fb0: switching to sun4i-drm-fb from simple
[    1.243647] [drm] Initialized sun4i-drm 1.0.0 20150629 for soc:display-engine on minor 0
[    1.252675] [drm] kms: can't enable cloning when we probably wanted to.
[    1.260758] sun4i-drm soc:display-engine: [drm:drm_fbdev_client_hotplug] *ERROR* fbdev: Failed to setup generic emulation (ret=-12)

请问哪里还需要修改?
谢谢。

#7 全志 SOC » 求一个buildroot的config,包含QT opengl测试。 Lima或者Mali都行。感谢 » 2021-08-29 08:40:36

skliu
回复: 0

好几天没搞好,郁闷。 过来求一个。也不知道自己哪里设置不对。

测试同一个QT的opengl例子:
使用全志库,失败信息如下:

...
Got keys from plugin meta data ("webp")
QFactoryLoader::QFactoryLoader() checking directory path "/boot/imageformats" ...
loaded library "/usr/lib/qt/plugins/imageformats/libqgif.so"
loaded library "/usr/lib/qt/plugins/imageformats/libqicns.so"
loaded library "/usr/lib/qt/plugins/imageformats/libqico.so"
loaded library "/usr/lib/qt/plugins/imageformats/libqjpeg.so"
loaded library "/usr/lib/qt/plugins/imageformats/libqsvg.so"
loaded library "/usr/lib/qt/plugins/imageformats/libqtga.so"
loaded library "/usr/lib/qt/plugins/imageformats/libqtiff.so"
loaded library "/usr/lib/qt/plugins/imageformats/libqwbmp.so"
loaded library "/usr/lib/qt/plugins/imageformats/libqwebp.so"
Unable to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt/plugins/styles" ...
QFactoryLoader::QFactoryLoader() checking directory path "/boot/styles" ...
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt/plugins/accessiblebridge" ...
QFactoryLoader::QFactoryLoader() checking directory path "/boot/accessiblebridge" ...
EGL Error : Could not create the egl surface: error = 0x3003

Aborted

转用主线开源lima+mesa3d.测试同样的qt例子。

...
Got keys from plugin meta data ("eglfs_kms")
QFactoryLoader::QFactoryLoader() checking directory path "/boot/egldeviceintegrations" ...
loaded library "/usr/lib/qt/plugins/egldeviceintegrations/libqeglfs-kms-integration.so"
MESA-LOADER: failed to open lima: /usr/lib/dri/lima_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/dri)
failed to load driver: lima
MESA-LOADER: failed to open kms_swrast: /usr/lib/dri/kms_swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/dri)
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/dri)
failed to load swrast driver
Could not create GBM device (No such file or directory)
Could not open DRM device
Aborted

#8 Re: 全志 SOC » 执行Qt程序,提示库文件找不到。 » 2021-08-28 09:35:24

拷贝一下的确可以。
先这样把。 谢谢。

#9 Re: 全志 SOC » 执行Qt程序,提示库文件找不到。 » 2021-08-28 09:26:07

目标板的rootfs根本就没有这个目录。 是虚拟机上的ubuntu的, 它怎么去那里找。
运行的程序也没有opengl的调用啊。
执行个非OPENGL的代码怎么都要去找opengl库。 下面这个analogclock经典程序也是这个问题。

# /boot/analogclock -platform linuxfb
/boot/analogclock: error while loading shared libraries: /home/gzpeite/buildroot-2019.11.3/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libGLESv2.so: cannot open shared object file: No such file or directory

#10 Re: 全志 SOC » 执行Qt程序,提示库文件找不到。 » 2021-08-28 09:05:30

我有编译OpengGL的。 问题不是这个。
问题是:
1. 这个程序么有eglfs的参数,怎么找opengl库?
2. openGL库我在/usr/lib下面有的,它怎么不去这里搜索,路径也添加了啊。
谢谢。

#11 全志 SOC » 执行Qt程序,提示库文件找不到。 » 2021-08-28 07:59:20

skliu
回复: 7

使用buildroot2019生成的kenerl 和 rootfs。
执行一个qt的程序, 之搜索编译路径,确认usr/lib下面那些库都在的,竟然没去搜索。
不知道哪里需要设定,谢谢。 (同样的xxx_defconfig文件, buildroot2020.8 版本我没碰到这个问题)


# /boot/dynamicspline -platform linuxfb
/boot/dynamicspline: error while loading shared libraries: /home/gzpeite/buildroot-2019.11.3/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libGLESv2.so: cannot open shared object file: No such file or directory
# export
export EDITOR='/bin/vi'
export HOME='/root'
export LD_LIBRARY_PATH='/lib:/usr/lib/'
export LOGNAME='root'
export PATH='/bin:/sbin:/usr/bin:/usr/sbin'
export PS1='# '
export PWD='/root'
export QT_PLUGIN_PATH='/usr/lib/qt/plugins/'
export QT_QPA_FONTDIR='/usr/share/fonts/liberation/'
export SHELL='/bin/sh'
export SHLVL='1'
export TERM='vt100'
export TSLIB_CALIBFILE='/etc/pointercal'
export TSLIB_CONFFILE='/etc/ts.conf'
export TSLIB_FBDEVICE='/dev/fb0'
export TSLIB_PLUGINDIR='/usr/lib/ts'
export TSLIB_TSDEVICE='/dev/input/event1'
export USER='root'

#12 Re: 全志 SOC » A33 EMMC启动问题 » 2021-08-23 11:33:57

感谢解惑。
我用的是主线。 那就是用软件弥补硬件的不可靠。 先记录下来。还在折腾OpenGL. 头大。

#13 Re: 全志 SOC » EGL Error : Could not create the egl surface: error = 0x3003 问题请教 » 2021-08-22 20:03:11

请问这个你是测试过吗?
我用A33, uboot里面是simplefb_lcd. 没看到里面的深度设定。
用过下面方法没用。
ech0 16 > /sys/class/graphics/fb0/bits_per_pixel

使用下面语句在uboot里面操作,无效。
setenv video "video=simplefb_lcd0:dev=ldb,LDB-XGA,if=RGB24,bpp=16 fbpix=RGB24 consoleblank=0 fbmem=28M ldb=dul0"


修改uboot里面的dtsi方法没试过。

#14 全志 SOC » EGL Error : Could not create the egl surface: error = 0x3003 问题请教 » 2021-08-22 19:30:43

skliu
回复: 2

使用buildroot生成的img。
make xxx_defconfig
make linux-menuconfig (设定DRM_FBDEV_LEAK_PHYS_SMEM 需要的依赖,修改overalloc=400)
make生成img,在tf卡上运行测试的。
由于不会编译mali/test. 所以编译了qt的2dpainting测试。结果如何。
内核: 5.4.142

下面是引用大神的总结。(第四条是自己加的:))
1.    Must enable DRM_FBDEV_LEAK_PHYS_SMEM from kernel   确认已选择
2.    set drm_leak_fbdev_smem on compile time (for some reason, passing in command line did not help) in drm_fb_helper.c 确认已设定true(有两个地方)
3.    use latest r8p1   使用buildroot生成的mali.ko.
4.     CONFIG_DRM_FBDEV_OVERALLOC=400   从100修改到了400。


 insmod /lib/modules/5.4.142/extra/mali.ko
[   62.494686] mali: loading out-of-tree module taints kernel.
[   62.511242] Allwinner sunXi mali glue initialized
[   62.516464] Mali:
[   62.516469] Found Mali GPU Mali-400 MP r1p1
[   62.523508] Mali:
[   62.523512] 2+0 PP cores initialized
[   62.529704] Mali:
[   62.529707] Mali device driver loaded
[   62.535946] sun8i-a33-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator

# ./2dpainting -platform eglfs linuxfb
Unable to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
EGL Error : Could not create the egl surface: error = 0x3003

Aborted

感谢。

#15 Re: 全志 SOC » A33 EMMC启动问题 » 2021-08-21 13:57:10

换了另外一家的板子就可以了。 看来PET33的EMMC部分有问题。

#16 全志 SOC » 小白问题: 编译sunxi-mali的test.c提示错误。 » 2021-08-21 07:35:32

skliu
回复: 0

参考地址:
https://github.com/linux-sunxi/sunxi-mali/
在vmware的ubuntu 18.4下面执行。make test 提示如下:

gzpeite@PET:~/sunxi-mali$ make test
make -f Makefile.config
make[1]: Entering directory '/home/gzpeite/sunxi-mali'
ABI="" (Detected)
Makefile.config:37: Unknown/unhandled ABI ""
Makefile.config:38: Use ABI=armel or ABI=armhf instead
Makefile.config:39: *** Unknown/unhandled ABI "".  Stop.
make[1]: Leaving directory '/home/gzpeite/sunxi-mali'
Makefile:12: recipe for target 'config.mk' failed
make: *** [config.mk] Error 2

请问这个是arm库没配置好吗?如何配置呢?
谢谢

#17 Re: 全志 SOC » A33 EMMC启动问题 » 2021-08-19 16:13:27

找到一些线索, 还的清大神们帮忙看看; 读取文件大了就会出错。 不知道哪里毛病。

# ls /dev/mmcblk
mmcblk0       mmcblk0p2     mmcblk1boot0
mmcblk0p1     mmcblk1       mmcblk1boot1
# dd if=/dev/mmcblk1 of=/dev/null bs=16k count=6
6+0 records in
6+0 records out
# dd if=/dev/mmcblk1 of=/dev/null bs=16k count=65
65+0 records in
65+0 records out
# dd if=/dev/mmcblk1 of=/dev/null bs=16k count=650
[ 3673.752201] sunxi-mmc 1c11000.mmc: data error, sending stop command
[ 3674.710698] sched: RT throttling activated
[ 3674.750700] sunxi-mmc 1c11000.mmc: send stop command failed
。。。挂机了

#19 全志 SOC » A33 EMMC启动问题 » 2021-08-16 14:49:14

skliu
回复: 6

两个问题:
1. 单独EMMC启动, 经常卡死。

U-Boot SPL 2021.07 (Aug 11 2021 - 17:35:12 +0800)
DRAM: 1024 MiB
Trying to boot from MMC2
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

2. 偶尔可以通过, 但是无法读取zImage文件。 .dtb文件可以读取。

U-Boot SPL 2021.07 (Aug 11 2021 - 17:35:12 +0800)
DRAM: 1024 MiB
Trying to boot from MMC2


U-Boot 2021.07 (Aug 11 2021 - 17:35:12 +0800) Allwinner Technology

CPU:   Allwinner A33 (SUN8I 1667)
Model: Sinlinx SinA33
DRAM:  1 GiB
MMC:   mmc@1c0f000: 0, mmc@1c11000: 1
Loading Environment from FAT... Unable to read "uboot.env" from mmc1:1... Setting up a 1024x600 lcd console (overscan 0x0)
In:    serial
Out:   vidconsole
Err:   vidconsole
Allwinner mUSB OTG (Peripheral)
Net:   eth0: usb_ether
starting USB...
Bus usb@1c1a000: USB EHCI 1.00
Bus usb@1c1a400: USB OHCI 1.0
scanning bus usb@1c1a000 for devices... 3 USB Device(s) found
scanning bus usb@1c1a400 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
Found U-Boot script /boot.scr
310 bytes read in 1 ms (302.7 KiB/s)
## Executing script at 43100000
Error reading cluster
** Unable to read file /boot/zImage **
Failed to load '/boot/zImage'
23164 bytes read in 3 ms (7.4 MiB/s)
Kernel image @ 0x46000000 [ 0x000000 - 0x49e820 ]
## Flattened Device Tree blob at 49000000
   Booting using the fdt blob at 0x49000000
   Using Device Tree in place at 49000000, end 49008a7b

Starting kernel ...

使用TF启动,在SPL里面,手动加载EMMC的zImage也只是偶尔成功。
===================dtb文件每次都可以。

=> fatload mmc 1 0x49000000 /boot/sun8i-a33-sinlinx-sina33.dtb
23164 bytes read in 2 ms (11 MiB/s)
=> fatload mmc 1 0x49000000 /boot/sun8i-a33-sinlinx-sina33.dtb
23164 bytes read in 2 ms (11 MiB/s)
=> fatload mmc 1 0x49000000 /boot/sun8i-a33-sinlinx-sina33.dtb
23164 bytes read in 3 ms (7.4 MiB/s)
=> fatload mmc 1 0x49000000 /boot/sun8i-a33-sinlinx-sina33.dtb
23164 bytes read in 3 ms (7.4 MiB/s)
=> fatload mmc 1 0x49000000 /boot/sun8i-a33-sinlinx-sina33.dtb
23164 bytes read in 2 ms (11 MiB/s)

====================zImage经常不成功

=> fatload mmc 1 0x46000000 /boot/zImage
Error reading cluster
** Unable to read file /boot/zImage **
Failed to load '/boot/zImage'
=> fatload mmc 1 0x46000000 /boot/zImage
4843552 bytes read in 222 ms (20.8 MiB/s)
=> fatload mmc 1 0x46000000 /boot/zImage
4843552 bytes read in 222 ms (20.8 MiB/s)
=> fatload mmc 1 0x46000000 /boot/zImage
Error reading cluster
** Unable to read file /boot/zImage **
Failed to load '/boot/zImage'
=> fatload mmc 1 0x46000000 /boot/zImage
Error reading cluster
** Unable to read file /boot/zImage **
Failed to load '/boot/zImage'
=> fatload mmc 1 0x46000000 /boot/zImage
4843552 bytes read in 221 ms (20.9 MiB/s)
=>

验证过:
uboot里面调整EMMC的驱动能力。 从40改成30。 没效果。

EMMC感觉不可靠。核心板是买的, 烧录SDK可以正常运行。 所以这里不怀疑板子硬件。

请各位高手指点一下。
谢谢。

#20 Re: 全志 SOC » 主线 EMMC写入uboot启动问题 » 2020-08-16 19:43:08

jkl 说:

楼主,这个问题我已经解决了,在你进行了分区后,之后进入uboot界面,手动输入boot.cmd中的各个命令,看是否能够让系统跑起来,能够跑起来的话,你这样的分区就没有问题,你的boot.cmd应该通过这个指令生成boot.src
mkimage -C none -A arm -T script -d boot.cmd boot.src
看看是否能够从emmc启动。

前几个礼拜忙别的。 今天回来继续折腾。
很高兴看到同路的。 你讲的不够详细。 你的意思是我分区有问题?
我在tf卡启动后的系统里面做的。 拿掉tf卡就卡在主题描述的位置。
那你是在哪里输入boot.cmd呢? 用tf卡启动进入uboot?

我的uboot是buildroot里面编译的,准备单独去下载编译一个看看。
谢谢。

#21 Re: 全志 SOC » 主线 EMMC写入uboot启动问题 » 2020-07-30 08:49:59

这里顺便问一下: boot0里面会打印信息的吗?
同样的uboot,在tf卡上启动到uboot里面。可以看到emmc的。 还有哪里需要检查。 感谢。

U-Boot SPL 2020.07 (Jul 28 2020 - 21:14:53 +0800)
DRAM: 1024 MiB
Trying to boot from MMC1


U-Boot 2020.07 (Jul 28 2020 - 21:14:53 +0800) Allwinner Technology

CPU:   Allwinner A33 (SUN8I 1667)
Model: Sinlinx SinA33
DRAM:  1 GiB
MMC:   mmc@1c0f000: 0, mmc@1c11000: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment

Setting up a 1024x600 lcd console (overscan 0x0)
In:    serial
Out:   vga
Err:   vga
Allwinner mUSB OTG (Peripheral)
Net:
Warning: usb_ether using MAC address from ROM
eth0: usb_ether
starting USB...
Bus usb@1c1a000: USB EHCI 1.00
Bus usb@1c1a400: USB OHCI 1.0
scanning bus usb@1c1a000 for devices... 2 USB Device(s) found
scanning bus usb@1c1a400 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
=>

mms list
Unknown command 'mms' - try 'help'
=> mmc list
mmc@1c0f000: 0
mmc@1c11000: 1 (eMMC)
=> mmc dev 1
switch to partitions #0, OK
mmc1(part 0) is current device
=> mmc party
mmc - MMC sub system

Usage:
mmc info - display info of the current MMC device
mmc read addr blk# cnt
mmc write addr blk# cnt
mmc erase blk# cnt
mmc rescan
mmc part - lists available partition on current mmc device
mmc dev [dev] [part] - show or set current mmc device [partition]
mmc list - lists available devices
mmc wp - power on write protect boot partitions
mmc hwpartition [args...] - does hardware partitioning
  arguments (sizes in 512-byte blocks):
    [user [enh start cnt] [wrrel {on|off}]] - sets user data area attributes
    [gp1|gp2|gp3|gp4 cnt [enh] [wrrel {on|off}]] - general purpose partition
    [check|set|complete] - mode, complete set partitioning completed
  WARNING: Partitioning is a write-once setting once it is set to complete.
  Power cycling is required to initialize partitions after set to complete.
mmc bootbus dev boot_bus_width reset_boot_bus_width boot_mode
 - Set the BOOT_BUS_WIDTH field of the specified device
mmc bootpart-resize <dev> <boot part size MB> <RPMB part size MB>
 - Change sizes of boot and RPMB partitions of specified device
mmc partconf dev [boot_ack boot_partition partition_access]
 - Show or change the bits of the PARTITION_CONFIG field of the specified device
mmc rst-function dev value
 - Change the RST_n_FUNCTION field of the specified device
   WARNING: This is a write-once field and 0 / 1 / 2 are the only valid values.
mmc setdsr <value> - set DSR register value

=> mmc part

Partition Map for MMC device 1  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            38913           00000000-01     0c
  2     40961           15228927        00000000-02     83
=>

#22 Re: 全志 SOC » 主线 EMMC写入uboot启动问题 » 2020-07-30 07:15:12

感谢上面两位: 不过问题不在这里。 暂时还没找到。
我用的sinlinx_a33的配置。 对应的dts文件没看出问题。
主要疑点就是spl下载emmc的,能打印第一行证明emmc驱动没问题,不然走不了的,不知对否?
感觉启动环境错误了。

#23 Re: 全志 SOC » 主线 EMMC写入uboot启动问题 » 2020-07-29 11:16:00

那这个SPL也在emmc里面,为什么可以运行的?
列出来uboot的.config的所有MMC关键字信息。帮我看看。谢谢。

CONFIG_SPL_MMC_SUPPORT=y
CONFIG_MMC0_CD_PIN="PB4"
CONFIG_MMC1_CD_PIN=""
CONFIG_MMC2_CD_PIN=""
CONFIG_MMC3_CD_PIN=""
CONFIG_MMC1_PINS=""
CONFIG_MMC2_PINS=""
CONFIG_MMC3_PINS=""
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x50
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET=0x0
# CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION is not set
# CONFIG_SUPPORT_EMMC_BOOT_OVERRIDE_PART_CONFIG is not set
# CONFIG_SPL_MMC_TINY is not set
# CONFIG_SPL_MMC_WRITE is not set
CONFIG_CMD_MMC=y
# CONFIG_CMD_MMC_SWRITE is not set
# CONFIG_ENV_IS_IN_MMC is not set
# CONFIG_DFU_MMC is not set
CONFIG_FASTBOOT_FLASH_MMC=y
CONFIG_FASTBOOT_FLASH_MMC_DEV=1
# MMC Host controller Support
CONFIG_MMC=y
CONFIG_MMC_WRITE=y
# CONFIG_MMC_BROKEN_CD is not set
CONFIG_DM_MMC=y
# CONFIG_ARM_PL180_MMCI is not set
CONFIG_MMC_QUIRKS=y
CONFIG_MMC_HW_PARTITIONING=y
# CONFIG_SUPPORT_EMMC_RPMB is not set
CONFIG_SUPPORT_EMMC_BOOT=y
# CONFIG_MMC_IO_VOLTAGE is not set
# CONFIG_SPL_MMC_IO_VOLTAGE is not set
# CONFIG_MMC_HS400_ES_SUPPORT is not set
# CONFIG_SPL_MMC_HS400_ES_SUPPORT is not set
# CONFIG_MMC_HS400_SUPPORT is not set
# CONFIG_SPL_MMC_HS400_SUPPORT is not set
# CONFIG_MMC_HS200_SUPPORT is not set
# CONFIG_SPL_MMC_HS200_SUPPORT is not set
CONFIG_MMC_VERBOSE=y
# CONFIG_MMC_TRACE is not set
# CONFIG_MMC_DW is not set
# CONFIG_MMC_MXC is not set
# CONFIG_MMC_PCI is not set
# CONFIG_MMC_OMAP_HS is not set
# CONFIG_MMC_SDHCI is not set
CONFIG_MMC_SUNXI=y
# CONFIG_STM32_SDMMC2 is not set

#24 全志 SOC » 主线 EMMC写入uboot启动问题 » 2020-07-29 09:58:10

skliu
回复: 14

参考这里(感谢):
https://whycan.cn/t_3633.html

ums无法设别成sdx之类的。也不清楚哪里问题。

我的步骤:
1. 使用TF卡启动。 将板载的emmc格式化,分区如下:

Disk /dev/mmcblk1: 7456 MB, 7818182656 bytes, 15269888 sectors
238592 cylinders, 4 heads, 16 sectors/track
Units: sectors of 1 * 512 = 512 bytes

Device       Boot StartCHS    EndCHS        StartLBA     EndLBA    Sectors  Size Id Type
/dev/mmcblk1p1    32,0,1      640,0,1           2048      40960      38913 19.0M  c Win95 FAT32 (LBA)
/dev/mmcblk1p2    640,0,2     1023,3,16        40961   15269887   15228927 7435M 83 Linux

2. 拷贝zImage, boot.scr, sunxi**.dtb到 mmcblk1p1.  mmcblk1p2先空着。
boot.cmd内容如下:

fatload mmc 1:1 0x46000000 zImage
fatload mmc 1:1 0x49000000 sun8i-a33-sinlinx-sina33.dtb

setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk1p2 rootwait panic=10

bootz 0x46000000 - 0x49000000

3. dd命令把 u-boot-sunxi-with-spl.bin写入mmcblk1。
4. tf开启动到uboot,修改过启动:

mmc partconf 1 0 7 0

5. 拿到tf卡,启动信息如下:

U-Boot SPL 2020.07 (Jul 28 2020 - 18:22:48 +0800)
DRAM: 1024 MiB
Trying to boot from MMC2
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

同样的 u-boot-sunxi-with-spl.bin写入tf卡的,启动没问题,可以进入系统的。

请大家帮忙分析一下。 谢谢了。

#26 Re: 全志 SOC » A33 系统空片烧录系统的几个问题 » 2020-07-27 19:35:34

这个先结帖了。 换了一个板子。  从TF启动,加载emmc,然后格式化写入uboot,再修改uda启动。可以看到SPL,但是还有错误。继续折腾中。
这里谢谢Shaoxi2010的解答。

#27 Re: 全志 SOC » A33 系统空片烧录系统的几个问题 » 2020-07-26 16:05:56

下面是正常启动系统的信息:
[mmc]: mmc driver ver 2014-8-11 15:06:39
[mmc]: ***Try SD card 2***
[mmc]: mmc 2 cmd 8 timeout, err 00000100
[mmc]: mmc 2 cmd 8 err 00000100
[mmc]: mmc 2 send if cond failed
[mmc]: mmc 2 cmd 55 timeout, err 00000100
[mmc]: mmc 2 cmd 55 err 00000100
[mmc]: mmc 2 send app cmd failed
[mmc]: ***Try MMC card 2***
[mmc]: MMC ver 5.0
[mmc]: SD/MMC Card: 4bit, capacity: 7456MB
[mmc]: vendor: Man 00110100 Snr 0079dbcc
[mmc]: product: 008G7
[mmc]: revision: 3.0
[mmc]: ***SD/MMC 2 init OK!!!***
sdcard 2 init ok
The size of uboot is 000c8000.
sum=142c7960
src_sum=142c7960
set_mmc_para,sdly 50M 0
set_mmc_para,sdly 25M 0
Succeed in loading uboot from sdmmc flash.

这个eMMC不是8bit的吗?
dts里面的配置:
&mmc0 {
    pinctrl-names = "default";
    pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_sina33>;
    vmmc-supply = <&reg_dcdc1>;
    bus-width = <4>;
    cd-gpios = <&pio 1 4 GPIO_ACTIVE_LOW>;
    status = "okay";
};

&mmc2 {
    pinctrl-names = "default";
    pinctrl-0 = <&mmc2_8bit_pins>;
    vmmc-supply = <&reg_dcdc1>;
    bus-width = <8>;
    non-removable;
    cap-mmc-hw-reset;
    status = "okay";
};

&mmc2_8bit_pins {
    /* Increase drive strength for DDR modes */
    drive-strength = <40>;
    /* eMMC is missing pull-ups */
    bias-pull-up;
};

另外一个问题就是: 这个板子插上TF卡就无法启动。(串口没有任何信息)

#28 Re: 全志 SOC » A33 系统空片烧录系统的几个问题 » 2020-07-26 15:54:08

又碰到新问题。折腾半天了。
进入fel,然后通过sunxi-fel uboot下载自己编译的uboot到目标板,运行的结果。
信息如下:

U-Boot SPL 2019.01-rc3-g829407b58f-dirty (Jul 26 2020 - 15:20:41 +0800)
DRAM: 1024 MiB
Trying to boot from FEL


U-Boot 2019.01-rc3-g829407b58f-dirty (Jul 26 2020 - 15:20:41 +0800) Allwinner Technology

CPU:   Allwinner A33 (SUN8I 1667)
Model: Sinlinx SinA33
DRAM:  setup_dest_addr1 GiB
MMC:   MMC0: 01c20060 = 0x1004140, 01c20088 = 0x0, 01c202c0 = 0x1004140
MMC2: 01c20060 = 0x1004540, 01c20090 = 0x0, 01c202c0 = 0x1004540
mmc@1c0f000: 0, mmc@1c11000: 1
Loading Environment from FAT... Card did not respond to voltage select!
Setting up a 1280x720 lcd console (overscan 0x0)
In:    serial
Out:   vga
Err:   vga
Allwinner mUSB OTG (Peripheral)
Net:
Warning: usb_ether using MAC address from ROM
eth0: usb_ether
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
scanning bus 0 for devices... 2 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
=>
=>
=> mmc rescan
MMC: no card present
=> mmc info
MMC: no card present
=> mmc dev 1
Card did not respond to voltage select!
=> mmc list
mmc@1c0f000: 0
mmc@1c11000: 1
=> mmc dev 1
Card did not respond to voltage select!

板子自己运行可以从emmc启动系统。 系统是通过phoenixUSBpro写入的。
emmc的电压也从3.0改到3.3还是上面提示。
有碰到给个建议。 估计boot里面没搞对。
谢谢。

#30 Re: 全志 SOC » A33 系统空片烧录系统的几个问题 » 2020-07-25 21:20:39

shaoxi2010 说:

主线的uboot可以通过sunxi-tools下载到内存中,再用dfu下载就行了

DFU具体怎么用的?
或者说烧写主线uboot之类的有没有其它方法? 我看phoenixUSBpro比较方便,就是不知道怎么生成“合格”的img文件。
我看看uboot的设定去:)

谢谢

#31 Re: 全志 SOC » A33 系统空片烧录系统的几个问题 » 2020-07-25 21:11:39

DFU全称Device Firmware Upgrade设备固件更新。
谢谢。

#32 Re: 全志 SOC » A33 系统空片烧录系统的几个问题 » 2020-07-25 21:02:32

shaoxi2010 说:

主线的uboot可以通过sunxi-tools下载到内存中,再用dfu下载就行了

可以写入内存,启动uboot没问题。也可以启动tf卡上的linux。 但是进去linux我也没找到emmc。
什么是dfu?

谢谢。

#33 Re: 全志 SOC » A33 系统空片烧录系统的几个问题 » 2020-07-25 20:38:34

空片的确可以进入FEL模式。
现在问题是: 如何把主线的uboot, zimage等写道emmc? 怎么分区?
主线的uboot等打包的img文件phoenixUSBpro不认, 好像看到有说主线的不能用这个工具刷,什么原因呢?
谢谢。

#34 Re: 全志 SOC » A33 系统空片烧录系统的几个问题 » 2020-07-25 08:04:54

shaoxi2010 说:

只要写了SPL就不会到FEL模式下去,就需要各种方法强制打断emmc执行,对了,emmc的boot0下可能还存在一份启动文件

windows资源管理器可以看到设备:USB Device(VID_1f3a_PID_efe8)
如果需要操作emmc,需要使用sun-fel工具的吗?windows还是linux下面操作?
如果板子刚贴片回来(空片)默认可以连接usb的吗?
谢谢

#35 Re: 全志 SOC » A33 系统空片烧录系统的几个问题 » 2020-07-25 08:02:38

伍零壹 说:

下载到emmc  可以按下fel按键下载   或者短接SDIO的CLK或者CMD,我测试过全志的部分芯片  是可行的,SPI FLASH也是短接CLK  。(使用PhoenixSuit软件  自动跳出烧录界面)

原先有代码运行的的确可以通过此方法联机。 如果没代码的(空片),此方法还是不行,不知道是板子问题还是需要怎么初始化呢?

#36 Re: 全志 SOC » A33 系统空片烧录系统的几个问题 » 2020-07-24 17:50:41

shaoxi2010 说:

a.无法通过软件进入,需要制作boot卡或者短接掉emmc
b.设备管理器,没有就是有问题
c.这个除了自己弄其他也没办法阿,毕竟设计都不一样

a. 短接是个好方法。 可以试试。
b. 我的另外一个正常的A33开发板,开机自动走TF卡。 但是设备管理器也没有usb设备显示。 可以通过安检进入uboot,usb就可以刷机了。 我的意思是,如果没有uboot或者uboot写错了呢?
c. 谢谢。

#37 全志 SOC » A33 系统空片烧录系统的几个问题 » 2020-07-24 16:08:54

skliu
回复: 18

好久不过来名字够改了,A33被遗弃了:(

关于A33一直困扰的几个问题。
背景: 拿到一个空白的板子(怀疑是的), 电压都正常,但是上电连接usb到电脑没有反应。 根据量产的手册看, 可以通过usb下载或者tf卡下载到板载EMMC:
a.如果是一个被烧录过的板子,那么如何通过phoenixUSBpro重新进入量产模式,烧录img文件?
b.如果是个没有烧录过的板子,上电没有连接上usb(设备管理器没有新设备检测到), 需要检查哪里呢?
c.如果通过tf卡量产, 请问这个img是哪里有下载的吗?还是需要自己做一个?

谢谢。

#38 Re: 全志 SOC » A33 主线rootfs问题 » 2020-06-21 11:16:51

1.buildroot下载到了。 编译中。
2. 第二个启动配置输出再哪里配置的,又知道的回复一下。 感谢。

#39 全志 SOC » A33 主线rootfs问题 » 2020-06-20 18:28:04

skliu
回复: 2

1. A33主线的rootfs参考哪里? SDK包的rootfs好像可以工作,但是有错误提示。 不过可以登录。
2. SDK时候配置有个sys_config.fex文件。 请问主线配置在哪里修改? 想驱动vga输出看看。

新手问题,请见谅。
谢谢。

#40 Re: 全志 SOC » boot.scr 无法启动zImage, 手动可以。 请教了。 » 2020-06-18 20:49:11

通过修改sun8i.h直接把上面的写入头文件里面。 暂时回避这个问题了。

#41 Re: 全志 SOC » boot.scr 无法启动zImage, 手动可以。 请教了。 » 2020-06-18 11:24:52

谁能在这里发我一个boot.scr文件? 读取zImage即可。 测试看看到底哪里问题, boot.scr可以读取。证明mmc没问题。 手动加载可以,证明文件也没问题。 就是出在boot.scr文件自身了。 非常感谢。 下面是boot.cmd。
setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait panic=5
fatload mmc 0:1 0x46000000 zImage
fatload mmc 0:1 0x49000000 sun8i-a33-sinlinx-sina33.dtb
bootz 0x46000000 - 0x49000000

#42 Re: 全志 SOC » boot.scr 无法启动zImage, 手动可以。 请教了。 » 2020-06-18 09:19:41

版主, 你那个链接是好几个搜索结果。 我下载前面几个。没有看到boot.scr。 具体哪一个呢? 谢谢了。

#43 Re: 全志 SOC » boot.scr 无法启动zImage, 手动可以。 请教了。 » 2020-06-17 21:56:25

上面的boot.cmd
通过下面吗命令生成的。
mkimage -C none -A arm -T script -d boot.cmd boot.scr

#44 Re: 全志 SOC » boot.scr 无法启动zImage, 手动可以。 请教了。 » 2020-06-17 21:49:47

的确是这个提示。 我手动键入竟然可以。所以来问问有没碰到的人。给点建议。

#45 全志 SOC » boot.scr 无法启动zImage, 手动可以。 请教了。 » 2020-06-17 21:11:46

skliu
回复: 10

Scanning mmc 0:1...
Found U-Boot script /boot.scr
286 bytes read@in 1 ms (279.3 KiB/s)
## Executing script at 43100000
Un
' - try 'help' '
**Unable to read file zImage
**Unable to read file sun8i-a33-sinlinx-sina33.dtb
' - try 'help'd '
SCRIPT FAILED: co`tinuing...
22856 bytes read in 2 ms (10.9 MiB/s)
switch to partitions #0, OK
mmc1(part 0) is current device
** Unrecognized filesystem type **

上面是信息部分内容。感谢。
手动执行可以。 boot.cmd如下:
setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait panic=5



fatload mmc 0:1 0x46000000 zImage

fatload mmc 0:1 0x49000000 sun8i-a33-sinlinx-sina33.dtb



bootz 0x46000000 - 0x49000000

#46 Re: 全志 SOC » A33 u-boot 错误信息帮忙分析。 » 2020-06-17 11:09:24

调试半天。最后把主频降到720M顺利走下去了。 默认是1.1Ghz。

#47 Re: 全志 SOC » A33 u-boot 错误信息帮忙分析。 » 2020-06-15 10:50:39

就是说我不用sunxi-fel写入板载emmc。 而通过tf卡可以启动? 目前来看,是uboot里面就错了吗?就是说与板tf卡里面有没系统,和src文件无关?
配置检查过了:SDRAM一样,emmc一样,串口一样,不知道还有哪里可以检查的? 谢谢

#48 Re: 全志 SOC » A33 u-boot 错误信息帮忙分析。 » 2020-06-15 10:35:08

感谢回复。降低DRAM的频率,MCU还没将(不知道着呢麽设定的) 信息不停的输出下面这段落:应该是不停的复位重启。
U-Boot SPL 2019.01-rc3-g829407b-dirty (Jun 14 2020 - 17:00:38 +0800)
DRAM: 1024 MiB

在这里问一个问题:
目前我是板子上的emmc没动,只是把uboot写入tf卡,插板子上运行的。 tf卡上的fat16里面的内容可能不对。 回事这个原因吗?
谢谢

#49 全志 SOC » A33 u-boot 错误信息帮忙分析。 » 2020-06-14 18:00:59

skliu
回复: 6

下载地址 : git clone https://github.com/linux-sunxi/u-boot-sunxi u-boot-sunxi
使用configs/Sinlinx_SinA33_defconfig
编辑对应的.dts文件。主要是TF-CD不同。
emmc硬件连接相同。 配置1G+8G.

编译通过,通过dd写入后启动的信息如下。
u-boot运行两次。第二次DRAM是0了?  帮忙分析一下。谢谢了。
=========================以下输出信息。
U-Boot SPL 2019.01-rc3-g829407b-dirty (Jun 14 2020 - 17:00:38 +0800)
DRAM: 1024 MiB

U-Boot SPL 2019.01-rc3-g829407b-dirty (Jun 14 2020 - 17:00:38 +0800)
DRAM: 0 MiB
### ERROR ### Please RESET the board ###

#50 Re: 全志 SOC » 新手 A33想入主线问题请教 » 2020-06-14 08:48:55

感谢回复。 还是按照通用方法,去研究跑主线。

#51 Re: 全志 SOC » 新手 A33想入主线问题请教 » 2020-06-13 19:04:27

有空继续折腾中。 今天碰到新问题,还请大侠帮忙分析:
1. 用最新的kernel(5.7)替换原先的3.4的kernel。
2. 改了sunxi_defconfig。 编译顺利完成。 也可以按照厂家的方法打包成功。生成的img文件烧录后。卡在starting kernel。。。

百度后怀疑是设备树。 但是我在厂家提供的SDK方式的包里面没看到有对应的设备树文件。大家给点思路。
新问题: 只是升级kernel部省级uboot可以吗?
下面是uboot信息:
U-Boot 2011.09-rc1-00000-g1030d04-dirty (Jun 05 2020 - 19:41:27) Allwinner Technology

谢谢。

#52 Re: 全志 SOC » A33主线Linux跑起OpenGL/ES » 2020-06-09 09:22:57

楼主大侠,能出一个新手教程吗? A33也想跑Linux+qt+opengl。 感谢。

#53 Re: 全志 SOC » 新手 A33想入主线问题请教 » 2020-06-08 16:55:22

感谢回复。
回复的连接很好,明白套路。谢谢。
1. 如果emmc方式麻烦, 那开发板厂家是怎么量产的? 就是说必须有TF卡的座子?
2. 我看sunxi-fel boot xxx.bin写uboot。请问这个是写到TF卡吗?
5. 替换内核我再去研究下。 是不是简单的替换掉UImage文件呢?

#54 全志 SOC » 新手 A33想入主线问题请教 » 2020-06-08 15:24:32

skliu
回复: 5

目前购买了PET-A33-P01, 看中他们提供QT5.8+Linux和Android 6.0。 目前Android运行没问题。
Linux+QT 想折腾一下OPENGL。 搜索到这个网站,需要入主线。有几个问提请教一下大侠(有点小白)。
以下都在ubuntu的虚拟机完成的。
1. 按照 https://whycan.cn/t_3643.html 这个里面说明,是通过外部TF卡启动的。我还是想保留原有的EMMC方式。前三步已完成。
2. 生成的u-boot-sunxi-with-spl.bin, 是通过sunxi-fel把这个uboot二进制文件写入eMMC的吗? 硬件是OTG口吗?
3. 如果写入新的uboot之后还能回去厂家提供的SDK方式吗? 如果uboot有错误,如果救砖?
4. 厂家给的SDK编译步骤:a)编译内核,b)编译uboot, c)编译Rootfs:最后是pack成一个img文件,在windows下面通过PhoenixSuit写入的。这里的b)步骤有编译uboot,不知道是不是我得第二步编译的一样呢(当然有硬件管脚问题,这个已经修改)?就是说每次通过windows软件写入的image包含了uboot+linux内核+。。。。 那第二步的问题是可以通过windows软件PhoenixSuit写uboot,只不过这个软件只认img文件。
5. 可否偷梁换柱的方式,把内核换掉而已呢?

谢谢回复。

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn