@海石生风
“zig这个编译时特性在众多编程言语中是绝无仅有的” 这个特性确实是非常适合搞声明UI的,你这个选择非常正确。
看来你走的路线是利用binding来更新属性而不是对vdom进行diff再更新
我个人更喜欢reactjs这种vdom diff的方式,不用显式声明属性绑定,每次model变化,把整个UI 的builder重新运行一遍,再根据vdom实例化组件
坏处是开销大了不少;好处是可以任意方式写UI,每一帧的UI都可以是完全和上一帧不一样,是动态决定的。比如
if (fail_happen)
Text(‘error is {erro_code}')
else
Button(text=stat?'Yes':'No')
end
binding除了写起来有点繁琐以外,如果model值不能直接用于UI显示的话,还需要写转化函数。比如:
erro_code -> ‘error is {erro_code}'
stat -> stat?'Yes':'No'
以前玩微软XAML写UI就把我烦死了,写个binding还得写个converter
刚刚看到一个磨损均衡的库:https://github.com/azure-rtos/levelx
所以说,,磨损均衡还是挺复杂的,,
嵌入式Linux直接用spi nand默认有磨损均衡吗?
有已经配好的固件吗?在主页没看到下载地方
@海石生风
有些逻辑是UI相关的逻辑,如果描述语言无法实现描述的动态性和逻辑,实际反而不方便。以前我也觉得逻辑是逻辑,UI是UI,必须分开。但是看过ReactJS之后我又动摇了,现在流行的是业务逻辑-》数据-》UI逻辑和状态-》View这样的单向数据流,反而不提倡UI和逻辑放的太开。
高级语言当然有用,可以实现UI和逻辑的无缝组合,多位一体,不用创造和学习一个特定的描述语言;既可以写逻辑也可以写UI,想分开就分开,想合在一起就合在一起,想组合就组合,灵活多变,表达能力强。
AWTK这种有点像Vue,创造了很多扩展语法到XML,要想写UI和逻辑,你得在XML,扩展语法,C或者JS三者之间跳转
QML这种,你得在QML,JS,C++三者中跳转
ReactJS这种,你只需要JS语法和一点点XML的组织形式(其实也只是可选项)。比如Flutter,语言本身就可以实现类似XML的嵌套结构和可变参数,所以它只需要一个语言。
因芯片本身没加密,所以至少SPL那阶段是不加密的。
你可以程序起来后,根据ID自己算一份,然后自己把自己给更新了。
顶楼上,烧的时候可以烧一个bin,启动的时候读了SPI flash的ID后自己改flash某个地方,实现绑定ID
我用Python也做了个声明式框架,一直没有完工,这是初步效果:支持class组件和stateless函数组件
class AgeComponent(Component):
def render(self):
return Text(text = f"I\'m {self.props['year']} years old")
# stateless functional component
def AgeFunctionComponent(age):
if age < 15:
return <AgeComponent year=10 />
else:
return <Text text=" I'm Adult" />
class MyApp(Component):
age = State(9)
@thread
def add_age(self):
for i in range(100):
self.age += 1
print(f'age:{self.age}')
# time.sleep(0.01)
def render(self):
return (
<App>
{<Text text=" I'm Child" visible = {self.age > 15}/> if self.age < 18 else <Text text=" I'm Adult" />}
<Text text=" ---------------------------- " />
<AgeFunctionComponent age = {self.age} />
<AgeComponent year={self.age + 1} />
<Button text = 'Press Me' on_press = {self.add_age}/>
</App>
)
render(<MyApp/>)
达克罗德大佬:这个示例能给mangopi r3用吗?我已经刷好了,但是在UART0上接上串口转接卡,无法看到输出字符“A”。
https://gd4.alicdn.com/imgextra/i4/479269519/O1CN01GTb4S02KBkpY6rcjS_!!479269519.jpg_400x400.jpg
应该能用的,你接的是UART0 是GPIOE1 and GPIOE0吗?
多层毛玻璃,一层是progress bar控件被贴了个毛玻璃,另一个glass窗体贴了个毛玻璃。
https://whycan.com/files/members/2137/6_20210630-1054.mp4
效果不错!不过我看到帧率有明显降低
移植8.0到 STM32H750会进入HardFault_Handler, 在lv_refr.c的138行出问题,具体原因没找到
https://whycan.com/files/members/2275/微信截图_20210622112255.png
有没有哪位大佬比较熟悉,看是啥原因,
移植driver没写好吧,看截图好像和LCD驱动有关
达克罗德 说:我记得,要在kernel打开sunxi的DRM和panel驱动,没有DRM驱动,GPU是不会生成节点的
搞定了,非常感谢“达克罗德”的帮助!
犯了个低级错误。缺少了 CONFIG_DRM_PANEL_SIMPLE=y
要选上这个就必须先选上以下这两个才行:
Graphics support --->
Backlight & LCD device support ---
<*> Lowlevel Backlight controls
要选上才能选下面的
Display Panels --->
<*> support for simple panels是这个吗?
是这个!
声明式ui,还是流行的web前端比较合适(html,css,js三剑客)。sciter就是基于这种技术实现,体积也比较小,不过需要linux(gtk)。
https://whycan.com/files/members/1315/Screenshot211109.png
sciter不是完整实现,React和VUE都跑不起来的。
不过作为一个HTML引擎,sciter确实很小巧才几个MB。我也关注很久了,学生时代就关注过,那时候它还很简陋,现在强大多了
不用神话声明式GUI,概略的看它跟立即式GUI很像,flutter的runApp()就是xui_loop(),它内部也是不断调用build()函数,build()函数不断调用里面的widget生成函数去实例化widget,就跟xui的应用不断调用xui_begin_xxx()一样。只不过由于flutter和jetpack compose的语言有一些便利的语法,写出来的代码看上去像声明一个个widget而不是创建一个个widget,其实内在是创建一个个widget。
如果是实现立即式GUI,用过程式编程语言就可以了;如果是实现保留式GUI,面向对象语言更合适;而要实现声明式GUI,更现代的语言才行。声明式GUI的流行可能是前端开发人员在不断采用现代化的语言的过程中受了立即式GUI的启发慢慢发展和流行出来的吧。
你对声明式UI理解有误,你说的是声明式创建控件,但是其实声明式UI直接创建的不是控件而是一个类似json结构的VDOM。然后才根据VDOM去创建或者更新真正的DOM控件。否则光有声明式创建,无法实现变量绑定和按需更新
我也是自己做了个React的Python版才真正理解了这点
不知道xui怎么解决多余重绘问题的,譬如某个控件的状态变化了,整个画面需要重画。在保留模式下因为修改控件的状态必须调用控件接口,所以控件的状态都由自己记录,控件可以知道自己状态有没有改变,没有就不需要重画。
某个控件状态改变导致整个画面重绘的问题很耗cpu,在嵌入式里面恐怕难以接受。
可以学学react的做法,控件函数里面只记录状态,控件api调用完成时(譬如xui_end_window()或xui_end()时)把整个ui树的状态发送到另一个线程做界面绘制。因为绘制线程拿到整个ui树各个控件的状态,这还可以在绘制前做优化。也可以在性能不足的时候把某些帧跳过,只需要忽略掉某次主线程发过来的状态。
XUI是绘图命令级别的脏矩形刷新,不是控件级别的局部刷新
嗯? 怎么理解呢,意思是,双缓冲下,在硬件disp控制器读帧过程中顿一下么, vsync机制是当前帧被使用的时候不会被填充么
达克罗德 说:光双缓冲,没有vsync处理,应该还是有小概率产生撕裂吧
就怕切缓冲buff地址时候,如果发生在读帧过程中,一样会导致画面撕裂。感觉和硬件设计和驱动程序有关,也许某些SOC硬件可以保证直接切换地址不会导致问题。
不过我看许多SOC都还是明确要求在帧中断去切缓冲。
DRM的文档有关于这个双缓冲和VSync的说明:
https://github.com/dvdhrm/docs/blob/master/drm-howto/modeset-double-buffered.c
https://github.com/dvdhrm/docs/blob/master/drm-howto/modeset-vsync.c
If you run this example, you will notice that there is almost no flickering,
* anymore. The buffers are now swapped as a whole so each new frame shows
* always the whole new image. If you look carefully, you will notice that the
* modeset.c example showed many screen corruptions during redraw-cycles.
*
* However, this example is still not perfect. Imagine the display-controller is
* currently scanning out a new image and we call drmModeSetCrtc()
* simultaneously. It will then have the same effect as if we used a single
* buffer and we get some tearing. But, the chance that this happens is a lot
* less likely as with a single-buffer. This is because there is a long period
* between each frame called vertical-blank where the display-controller does
* not perform a scanout. If we swap the buffers in this period, we have the
* guarantee that there will be no tearing. See the modeset-vsync.c example if
* you want to know how you can guarantee that the swap takes place at a
* vertical-sync.
根据这个理解,即使硬件支持任意切缓冲不会导致画面撕裂,也还是会有问题。当绘图刷新率不稳定的时候,有可能会导致掉帧现象。你可以想象在一帧的时间里,如果不在v-blank时间来切缓冲,有可能刚好错过当前这一帧的数据。所以PC游戏里一般有个选项,锁定帧刷新到显卡vsync
达克罗德 说:暗装,虚拟机,片外加密芯片
单片机里面如何跑虚拟机?兄台能否指点下?
达克罗德 说:转自另一帖:
启动时PLL_VIDEO时钟只有198MHZ,而全志要求和pixel时钟的倍数必须大于等于4,实际我发现大于等于6才行。所以33Mhz以上TCON时钟工作不正常
需要把PLL video时钟设高一点
把sys_clock.c中
write32(F1C100S_CCU_BASE + CCU_PLL_VIDEO_CTRL, 0x81004107);
时钟输出=24000000*(0x41+1)/(0x07+1)=198Mhz
改为
write32(F1C100S_CCU_BASE + CCU_PLL_VIDEO_CTRL, 0x81004103);
时钟输出=24000000*(0x41+1)/(0x03+1)=396Mhz
这时候pixel_clock_hz能设置成更高时钟了
您这个改的是uboot的还是内核啊
裸机
原来-l需要放到object之后
有个文章专门解释了这个问题
https://stackoverflow.com/a/43305704/388520
结贴
编译一个APP时,链接出错:
/usr/bin/ld: out/obj/keyboard.o: in function `keyboard_state_get_plain_codepoint':
/mnt/flutter/src/keyboard.c:365: undefined reference to `xkb_state_key_get_utf32'
我的链接命令:
cc -I./include -I/usr/include/libdrm -DBUILD_TEXT_INPUT_PLUGIN -DBUILD_TEST_PLUGIN -O0 -ggdb -lgbm -ldrm -lGLESv2 -lEGL -lsystemd -linput -ludev -lxkbcommon -lrt -lpthread -ldl -lm -L/usr/lib/arm-linux-gnueabihf
明明libxkbcommon.so里有这个函数:
nm -D /usr/lib/arm-linux-gnueabihf/libxkbcommon.so
...
00014c5c T xkb_state_key_get_utf32@@V_0.5.0
..
而且不光是这个函数,所有动态链接的函数都找不到。
我是在qemu-user-static模式下编译的,不知道和这个有关吗
https://whycan.com/files/members/5025/QQ图片20201024082850.jpg
modetest -M sun4i-drm -P 31@47:480x272+10+10 -P 35@47:480x272+100+100 -P 39@47:480x272+150+150 -P 43@47:320x240+200+200
在 @HackforFun 大佬帮助下, 终于初步搞定四层测试
请问drm实现的是硬件4层还是软件4层?
感谢!资料蛮丰富
这是虚拟机跑Linux?
--在Lua中 false nil表示为假,其它,0.。都表示为真
-- and or not
-- and 如果第一个要计算的操作数是假的话,返回第一个操作数,反之返回第二个操作数
print( 1 and 5) -- 5
print( 0 and 5) --5
print( false and 5) --false
print( nil and 5) -- nil
--or 如果第一个操作数是真的假,返回第一个操作数,反之返回第二个操作数
print( 1 or 5) -- 1
print(0 or 5) -- 0
print( nil or 5)--5
print(false or 5) --5
--not 永远返回的是true和false
print(not nil) -- true
print(not 1) --false
print(not 0) --false
print(not false) --true
你先网上看看基础语法教程吧
lua的逻辑判断和别的语言有些不同
你这个很像Ringo,我的这个小玩具就是受到Ringo的inspire
你这个资源正是我要找的,非常感谢!
你的为啥和官网界面有点不一样?
https://github.com/nanfang2000/X1000_BB
这是我的git,这里面有AP6212的原理图和PCB,验证过是OK的
很多你以为是知识,其实只是知道,与刷抖音、头条差不多,不要因此而感动自己。
不要夸大自己的付出,而贬底别人的付出,这总觉得不公平。
也不要夸大自己的收获,,这易觉得满足。既然选择了技术这条路线,“学而实习之,不亦乐乎。有朋自远方来不亦乐乎。人不知而不愠,不亦君子乎”更适合。
学到的东西能在现实中实用(习)到,很开心呀,到群里与搞技术的朋友沟通,也更开心了。如果你是天才,你的知识比我们这些凡人都强,也不要生气,给我们讲解,就是君子了。相对其它行业,我们理工科更客观些,对就是对、错就是错,别人能做到的,你只要努力也能做到(只要有硬件环境)。
说得真好,表达能力真强
你需要的正是jailhouse。我没用过但有人给我推荐过
https://github.com/siemens/jailhouse
https://www.tinkercad.com 这个网址你可以看下,上手比较简单,在线设计3D模型。
看了下,只能组合修改已有模型,不能自己直接设计模型?
各位大神能否告知怎么改DDR运行频率吗,我发现用F1C100S跑个图像算法耗时太大了,光是拷贝一个VGA的图像数据就花了9毫秒了。主频我都升到900MHZ去了,估计是RAM速度太慢的。
timer怎么弄?我试了下用for循环去循环读取Windows的时间,但也是等待for循环执行结束后才加载整个界面
对,因为这还是UI线程,你停在这里的时候,UI就不能执行别的操作。不光是这个llvgl,PC上界面也是的。
定一个定时器,比如100ms周期。动画总长1秒,所以把你的动画分成10个状态:
(idle,LED1 On,LED1 OFF, LED2 On, LED2 OFF。。。)
在定时响应函数里每个状态干一个事情就好。
因为你每次干的事情比较短,马上就干完回到UI了,就不会阻塞UI刷新了。
我不熟悉lvgl,具体timer 怎么定义你要去查资料了。
来给大家带来点好消息,经过测试发现最新的主线驱动修复啦不少问题,我觉得已经到了可以使用的状态啦,使用基本没遇到明显缺陷。
我这个跑得是A64,大家可以试试其他的。
1. gtk的花屏问题,再也没发现啦
2. 1080p下的卡顿问题也解决的啦
3. alpha通道叠加也正常啦
4. 渲染CPU还是消耗过大,但是比上一版本下降一大堆
5. 电路还有点问题,不知道QT的烟雾效果修复没有https://whycan.cn/files/members/1749/F8D4725B-D11D-41E6-8190-905562D3D4BA.jpeg
请问你测的是lima驱动吗?opengles选mesa3D吗?
Devices Drivers->Graphics support->ARM devices->ARM Mali Display processor
Devices Drivers->Graphics support->LIMA (DRM support for ARM Mali 400/450 GPU)&mali{
status="okay";
};
作为新手,使用主线配置这两项。并在 arch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dts 也加上了ok,就是没看见/dev/mali设备。暂时尝试失败。
文件系统用的是debian buster 通过debootstrap来创建以下是启动信息:
[ 0.788007] lima 1c40000.gpu: IRQ ppmmu2 not found
[ 0.792802] lima 1c40000.gpu: IRQ ppmmu3 not found
[ 0.797650] lima 1c40000.gpu: gp - mali400 version major 1 minor 1
[ 0.803868] lima 1c40000.gpu: pp0 - mali400 version major 1 minor 1
[ 0.810191] lima 1c40000.gpu: pp1 - mali400 version major 1 minor 1
[ 0.816505] lima 1c40000.gpu: IRQ pp2 not found
[ 0.821032] lima 1c40000.gpu: IRQ pp3 not found
[ 0.825577] lima 1c40000.gpu: l2 cache 64K, 4-way, 64byte cache line, 64bit external bus
[ 0.834043] lima 1c40000.gpu: bus rate = 200000000
[ 0.838856] lima 1c40000.gpu: mod rate = 384000000
[ 0.844045] [drm] Initialized lima 1.0.0 20190217 for 1c40000.gpu on minor 0
我当时是选上了sun4i的drm,你试试
能不能把你的具体编译流程说一下,我这边除了用4.19.5然后手动打网上的patch外,其他还没有成功过
#if IS_ENABLED(CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM)
static bool drm_leak_fbdev_smem = true;
module_param_unsafe(drm_leak_fbdev_smem, bool, 0600);
MODULE_PARM_DESC(drm_leak_fbdev_smem,
"Allow unsafe leaking fbdev physical smem address [default=false]");
#endif
我记得有人说4.x之后需要这样改动:
config打开CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM
然后在drm_fb_helper.c中drm_leak_fbdev_smem设置true;
其他就是按照那个github说明编maili.ko
楼主,我按照这个克隆uboot “git clone https://github.com/linux-sunxi/u-boot-sunxi u-boot-sunxi” 编译后可以用sunxi-fel启动正常了
主线uboot,我是直接ftp://ftp.denx.de/pub/u-boot/ 这个网站下面下载 u-boot-2020.04-rc3.tar.bz2,然后步骤是
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make Sinlinx_SinA33_defconfig
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make
不知道这样编译是不是有问题,还是编译前还需要做什么?
对,我也是这么操作
4.5s进Kernel,7秒到命令行是我的极限了……
[0.000000 0.000000] [0.000567 0.000567] U-Boot SPL 2019.04 (Mar 15 2020 - 20:25:30 +0800) [0.004723 0.004156] DRAM: 32 MiB [0.016690 0.011967] SPL: Unsupported Boot Device! [0.002319 0.002319] Trying to boot from sunxi SPI [0.345268 0.342949] [0.345360 0.000092] [0.345387 0.000027] U-Boot 2019.04 (Mar 15 2020 - 20:25:30 +0800) Allwinner Technology [0.351057 0.005670] [0.351088 0.000031] CPU: Allwinner F Series (SUNIV) [0.354100 0.003011] Model: Lotlab ACT Monitor [0.357005 0.002906] DRAM: 32 MiB [0.879050 0.522044] Setting up a 480x272 lcd console (overscan 0x0) [0.967089 0.088039] In: serial [0.968047 0.000958] Out: vga [0.969033 0.000986] Err: vga [0.971987 0.002954] Hit any key to stop autoboot: 0 [0.980985 0.008999] SF: Detected w25q64cv with page size 256 Bytes, erase size 4 KiB, total 8 MiB [0.991056 0.010071] device 0 offset 0x3c000, size 0x4000 [1.015056 0.024000] SF: 16384 bytes @ 0x3c000 Read: OK [1.019068 0.004012] device 0 offset 0x40000, size 0x240000 [3.719108 2.700040] SF: 2359296 bytes @ 0x40000 Read: OK [3.724043 0.004935] ## Flattened Device Tree blob at 80c00000 [3.728991 0.004948] Booting using the fdt blob at 0x80c00000 [3.735000 0.006009] Loading Device Tree to 80eab000, end 80eb01a2 ... OK [3.746073 0.011072] [3.746195 0.000122] Starting kernel ... [3.748125 0.001930] [4.503158 0.755033] [ 0.000000] Booting Linux on physical CPU 0x0 [4.508012 0.004854] [ 0.000000] Linux version 5.2.4 (jim@jim-pc) (gcc version 8.3.0 (Buildroot 2020.02)) #5 Sun Mar 15 20:14:37 CST 2020 [4.518121 0.010109] [ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f [4.525092 0.006971] [ 0.000000] CPU: VIVT data cache, VIVT instruction cache [4.530318 0.005226] [ 0.000000] OF: fdt: Machine model: Lichee Pi Nano [4.535147 0.004828] [ 0.000000] Memory policy: Data cache writeback [4.540014 0.004868] [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 8128 [4.546372 0.006358] [ 0.000000] Kernel command line: panic=5 rootwait root=/dev/mtdblock3 rw rootfstype=squashfs init=/sbin/mnt_overlay [4.557096 0.010724] [ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) [4.563426 0.006330] [ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) [4.570290 0.006864] [ 0.000000] Memory: 25868K/32768K available (4096K kernel code, 159K rwdata, 532K rodata, 1024K init, 205K bss, 6900K reserved, 0K cma-reserved) [4.583270 0.012980] [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 [4.589105 0.005835] [ 0.000000] random: get_random_bytes called from 0xc0600a84 with crng_init=0 [4.596064 0.006959] [ 0.000046] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns [4.604088 0.008024] [ 0.000101] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns [4.613078 0.008990] [ 0.000568] Console: colour dummy device 80x30 [4.617318 0.004241] [ 0.001027] printk: console [tty0] enabled [4.621344 0.004025] [ 0.001138] Calibrating delay loop... 334.23 BogoMIPS (lpj=1671168) [4.628018 0.006675] [ 0.050263] pid_max: default: 32768 minimum: 301 [4.632339 0.004321] [ 0.050425] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) [4.639180 0.006841] [ 0.050484] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) [4.646232 0.007052] [ 0.051856] CPU: Testing write buffer coherency: ok [4.651090 0.004858] [ 0.054029] Setting up static identity map for 0x80100000 - 0x8010003c [4.657220 0.006130] [ 0.056102] devtmpfs: initialized [4.661073 0.003853] [ 0.070968] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns [4.670980 0.009907] [ 0.071114] futex hash table entries: 256 (order: -1, 3072 bytes) [4.677037 0.006058] [ 0.071270] pinctrl core: initialized pinctrl subsystem [4.682108 0.005070] [ 0.074046] NET: Registered protocol family 16 [4.686270 0.004162] [ 0.075338] DMA: preallocated 256 KiB pool for atomic coherent allocations [4.693215 0.006946] [ 0.080370] cpuidle: using governor menu [4.697250 0.004035] [ 0.126249] clocksource: Switched to clocksource timer [4.702239 0.004989] [ 0.180323] NET: Registered protocol family 2 [4.707061 0.004822] [ 0.183919] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes) [4.714263 0.007203] [ 0.184071] TCP established hash table entries: 1024 (order: 0, 4096 bytes) [4.721272 0.007009] [ 0.184151] TCP bind hash table entries: 1024 (order: 0, 4096 bytes) [4.728051 0.006779] [ 0.184219] TCP: Hash tables configured (established 1024 bind 1024) [4.734209 0.006158] [ 0.184535] UDP hash table entries: 256 (order: 0, 4096 bytes) [4.740157 0.005948] [ 0.184639] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) [4.746239 0.006082] [ 0.186047] NET: Registered protocol family 1 [4.751062 0.004823] [ 0.190645] workingset: timestamp_bits=30 max_order=13 bucket_order=0 [4.757162 0.006100] [ 0.192058] squashfs: version 4.0 (2009/01/31) Phillip Lougher [4.763079 0.005917] [ 0.192167] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc. [4.769082 0.006003] [ 0.198473] sun4i-usb-phy 1c13400.phy: Couldn't request ID GPIO [4.775056 0.005974] [ 0.250694] suniv-f1c100s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver [4.782225 0.007169] [ 0.252818] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator [4.793005 0.010780] [ 0.257108] pwm-backlight backlight: backlight supply power not found, using dummy regulator [4.801214 0.008209] [ 0.344204] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled [4.807384 0.006171] [ 0.382288] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 23, base_baud = 6250000) is a 16550A [4.816277 0.008893] [ 0.695683] printk: console [ttyS0] enabled [4.828065 0.011788] [ 0.707818] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator [4.850157 0.022091] [ 0.729106] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator [4.872073 0.021917] [ 0.750949] m25p80 spi0.0: found s25fl064k, expected w25q64 [4.877286 0.005213] [ 0.756747] m25p80 spi0.0: s25fl064k (8192 Kbytes) [4.882336 0.005050] [ 0.761652] 5 fixed-partitions partitions found on MTD device spi0.0 [4.889007 0.006670] [ 0.768112] Creating 5 MTD partitions on "spi0.0": [4.893381 0.004374] [ 0.772955] 0x000000000000-0x00000003c000 : "u-boot" [4.907049 0.013668] [ 0.786887] 0x00000003c000-0x000000040000 : "dtb" [4.921066 0.014017] [ 0.800637] 0x000000040000-0x000000280000 : "kernel" [4.934068 0.013002] [ 0.813192] 0x000000280000-0x000000780000 : "rootfs" [4.948041 0.013973] [ 0.827617] 0x000000780000-0x000000800000 : "overlay" [4.968011 0.019970] [ 0.847169] udc-core: couldn't find an available UDC - added [g_ether] to list of pending drivers [4.980047 0.012037] [ 0.859628] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0) [4.990011 0.009964] [ 0.869284] Initializing XFRM netlink socket [4.994210 0.004199] [ 0.873754] NET: Registered protocol family 17 [5.001047 0.006837] [ 0.880207] NET: Registered protocol family 15 [5.016096 0.015049] [ 0.894942] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator [5.031058 0.014961] [ 0.910067] sun4i-backend 1e60000.display-backend: Couldn't find matching frontend, frontend features disabled [5.040995 0.009937] [ 0.920745] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc05308a0) [5.052203 0.011209] [ 0.931292] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc052f508) [5.060031 0.007827] [ 0.939156] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013). [5.066326 0.006295] [ 0.945803] [drm] No driver support for vblank timestamp query. [5.075135 0.008809] [ 0.954805] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0 [5.092130 0.016994] [ 0.970946] sun4i-drm display-engine: fb0: sun4i-drmdrmfb frame buffer device [5.100040 0.007910] [ 0.979521] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator [5.116049 0.016008] [ 0.995243] using random self ethernet address [5.120280 0.004231] [ 0.999893] using random host ethernet address [5.132252 0.011971] [ 1.011061] usb0: HOST MAC 6e:38:35:96:dc:b3 [5.136162 0.003910] [ 1.015513] usb0: MAC 3a:97:0e:a2:12:d4 [5.140116 0.003954] [ 1.019570] using random self ethernet address [5.145041 0.004925] [ 1.024066] using random host ethernet address [5.149205 0.004164] [ 1.028785] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008 [5.156180 0.006975] [ 1.035453] g_ether gadget: g_ether ready [5.163033 0.006853] [ 1.042700] vcc3v3: disabling [5.176095 0.013062] [ 1.054986] random: fast init done [5.181042 0.004947] [ 1.060490] VFS: Mounted root (squashfs filesystem) readonly on device 31:3. [5.194026 0.012984] [ 1.073359] devtmpfs: mounted [5.201013 0.006987] [ 1.080565] Freeing unused kernel memory: 1024K [5.206109 0.005095] [ 1.085259] Run /sbin/mnt_overlay as init process [5.381470 0.175361] [ 1.260258] random: crng init done [5.779200 0.397730] [ 1.658367] g_ether gadget: high-speed config #1: CDC Ethernet (ECM) [5.883472 0.104272] [ 1.762622] overlayfs: upper fs does not support tmpfile. [5.888996 0.005524] [ 1.768214] overlayfs: upper fs does not support xattr, falling back to index=off and metacopy=off. [6.116461 0.227465] Starting syslogd: OK [6.150147 0.033685] Starting klogd: OK [6.186171 0.036024] Running sysctl: OK [6.339748 0.153577] Saving random seed: OK [6.400528 0.060780] Starting network: OK [6.590488 0.189960] Starting udhcpd: OK [6.631476 0.040988] Starting dropbear sshd: OK [6.852184 0.220708] [6.852304 0.000120] Welcome to Buildroot [6.854232 0.001928] buildroot login:
你是怎么让Uboot和kernel统一时间打印的?
请教下怎么sunxi-fel看版本啊?我直接就是git clone https://github.com/linux-sunxi/sunxi-tools 然后make的
我好像也是这个
我是直接用buildroot编译的,选择了mali-driver,选的5.5.5的内核,全自动完成,烧录后运行就直接死掉,串口都不响应了,只能硬重启
你是这样的吗?你是怎么编译的?
我是用的 https://github.com/mripard/sunxi-mali
这里面的驱动编的mali.ko
赞
bananapro login: root
Password:
# [ 32.484107] vcc3v0: disabling
[ 32.487196] vcc3v3: disabling
[ 32.490567] dc1sw: disabling登录经来不久,突然出现这个,然后屏幕就关闭了,不知道是背光关闭了还是屏幕整个都断电了
估计是设备树中的设定跟实际板子不一致
你的问题我都遇到过,我也试了好久,终于看到另外一个厂家dts是有定义dc1sw,于是我参考定义了一下
®_dc1sw {
regulator-always-on;
regulator-name = "vcc-lcd";
};
然后就正常了
我这边运行 test 程序直接出现 Error: eglCreateWindowSurface failed: 0x00003003
查询错误码 是 EGL_BAD_ALLOC, 用的r8p1 fbdev ,你又遇到这个问题吗?
我也是遇到这个问题
2. set drm_leak_fbdev_smem on compile time (for some reason, passing in command line did not help) in drm_fb_helper.c
这个改了吗?我改了这个就好
另外记得把drm的Framebuffer设成200既2倍大小
还有如果有其它程序用fb比如xserver,要先关掉
不一定在启动参数,可以在设备树中保留, 可以修改ioremap保留,方法各式各样
有可能,我查一下。
另外,在uboot中需要保留这个1MB吗?我看有人说需要设置CONFIG_SYS_MEM_TOP_HIDE
Continuity with Linux Boot Logo
If you want Linux to keep your U-Boot Logo during boot process, then some tweaks are needed:
define CONFIG_SYS_MEM_TOP_HIDE in U-Boot configuration file, here we reserve 2MBytes:
#define CONFIG_SYS_MEM_TOP_HIDE (2 << 20)
主线uboot和内核的配置可以参见另一个帖子
全志A33 主线u-boot/Linux入坑记录 https://whycan.cn/t_3643.html
A33的GPU有两个方向,开源的Lima和非开源的全志OpenGL库
Lima+Mesa3D
LIMA只需要在内核选上LIMA和SUN4I的DRM驱动即可
Mesa3D可以在buildroot选上
不过最后我运行mesa的demo直接出错也找不到问题就放弃了,不知道是哪里的问题,网上教程太少不会玩。
这时候我切到第二个方案:
其实教程就是 https://github.com/mripard/sunxi-mali
但是这里有个坑(我选的fbdev的库),导致一运行malitest就出错(malitest可以自己编一个 https://github.com/linux-sunxi/sunxi-mali/tree/master/test )
查资料得到了信息
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
3. use latest r8p1
这回终于跑起来了
malitest和QT的OpenGL例子都运行正常
对了,最好在buildroot里选上sunxi-mali-mainline,这样它会自动给你生成一个启动时加载mali.ko的脚本。
当然,自己modprobe也是可以的
[ 2.290176] mali: loading out-of-tree module taints kernel.
[ 2.303401] using random self ethernet address
[ 2.310432] Allwinner sunXi mali glue initialized
[ 2.310892] using random host ethernet address
[ 2.319040] Mali:
[ 2.319045] Found Mali GPU Mali-400 MP r1p1
[ 2.325812] using random self ethernet address
[ 2.344761] using random host ethernet address
[ 2.352326] usb0: HOST MAC 3a:7e:4f:95:4b:5d
[ 2.359199] usb0: MAC f6:29:20:a6:b8:86
[ 2.365680] g_ffs gadget: g_ffs ready
[ 2.386332] Mali:
[ 2.386337] 2+0 PP cores initialized
[ 2.396969] Mali:
[ 2.396971] Mali device driver loaded
运行malitest的结果,可以验证是否正确
EGL Version: "1.4 Linux-r8p1-00rel0"
EGL Vendor: "ARM"
EGL Extensions: "EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_reusable_sync EGL_KHR_fence_sync EGL_KHR_lock_surface EGL_KHR_lock_surface2 EGL_EXT_create_context_robustness EGL_ANDROID_blob_cache EGL_KHR_create_context EGL_KHR_partial_update EGL_KHR_create_context_no_error "
Surface size: 1024x600
GL Vendor: "ARM"
GL Renderer: "Mali-400 MP"
GL Version: "OpenGL ES 2.0 "mali450-r5p1-01rel0-lollipop-233-g52c929d""
GL Extensions: "GL_OES_texture_npot GL_OES_vertex_array_object GL_OES_compressed_ETC1_RGB8_texture GL_EXT_compressed_ETC1_RGB8_sub_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_depth24 GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 GL_OES_vertex_half_float GL_EXT_blend_minmax GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_rgb8_rgba8 GL_EXT_multisampled_render_to_texture GL_EXT_discard_framebuffer GL_OES_get_program_binary GL_ARM_mali_program_binary GL_EXT_shader_texture_lod GL_EXT_robustness GL_OES_depth_texture_cube_map GL_KHR_debug GL_ARM_shader_framebuffer_fetch GL_ARM_shader_framebuffer_fetch_depth_stencil GL_OES_mapbuffer GL_KHR_no_error"
这里有点比较老的介绍,虽然过时了,但是比较系统
https://linux-sunxi.org/Mali_binary_driver
lima + Mesa3D 据说能跑了,但是我试了下跑不起来mesa带的demo
然后我试了全志的库,就差一点点,最后一步出错
[ 2.290176] mali: loading out-of-tree module taints kernel.
[ 2.303401] using random self ethernet address
[ 2.310432] Allwinner sunXi mali glue initialized
[ 2.310892] using random host ethernet address
[ 2.319040] Mali:
[ 2.319045] Found Mali GPU Mali-400 MP r1p1
[ 2.325812] using random self ethernet address
[ 2.344761] using random host ethernet address
[ 2.352326] usb0: HOST MAC 3a:7e:4f:95:4b:5d
[ 2.359199] usb0: MAC f6:29:20:a6:b8:86
[ 2.365680] g_ffs gadget: g_ffs ready
[ 2.386332] Mali:
[ 2.386337] 2+0 PP cores initialized
[ 2.396969] Mali:
[ 2.396971] Mali device driver loaded
run malitest:
EGL Version: "1.4 Linux-r6p2-01rel0"
EGL Vendor: "ARM"
EGL Extensions: "EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_r
这里出错死机
谢谢晕哥以及楼上几位,我终于搞明白了。原来emmc有芯片级的boot,RPMB,GPP,UDA等分区,是正常情况下不可见的(或者选择其中一个)。我们平常访问和创建文件系统的是UDA分区。我板子上默认使能的是boot0分区启动,所以我无论怎么烧写uboot,其实都是烧到UDA分区,下次上电还是从boot0分区启动老的uboot。
参考:
https://www.cnblogs.com/helloworldtoyou/p/6053460.html?utm_source=itdadao&utm_medium=referral
https://www.cnblogs.com/arnoldlu/p/10762009.html
解决方法:
打开uboot的CONFIG_SUPPORT_EMMC_BOOT
在uboot设置从UDA(7)启动
mmc partconf 1 0 7 0
现在终于可以正常从emmc启动uboot了
U-Boot SPL 2020.01-dirty (Feb 03 2020 - 00:42:31 +0800)
DRAM: 512 MiB
Trying to boot from MMC2
U-Boot 2020.01-dirty (Feb 03 2020 - 00:42:31 +0800) Allwinner Technology
CPU: Allwinner A33 (SUN8I 1667)
Model: Sinlinx SinA33
DRAM: 512 MiB
MMC: mmc@1c0f000: 0, mmc@1c11000: 1
Loading Environment from FAT... OK
Setting up a 1024x600 lcd console (overscan 0x0)
In: serial
Out: vga
Err: vga
Allwinner mUSB OTG (Peripheral)
Net: eth0: usb_ether
Hit any key to stop autoboot: 0
查了一下,boot0似乎就是8KB位置,我的u-boot-sunxi-with-spl也是写的这个位置,难道不会覆盖吗?
https://blog.csdn.net/weixin_43094346/article/details/82563873
一. Boot0 固件更新:(通常boot0 不需要更新)
命令:dd if=boot0_sdcard.fex of=/dev/block/mmcblk0 bs=512 count=S1 seek=S2
备注1: boot0_sdcard.fex 是boot0_sdcard_sun8iw5p1.bin 在pack 命令之后产生
备注2: S1=32K/512 S2= BOOT0_SDMMC_START_ADDR
SPL用的串口和uboot用得不一样。
uboot的dts可以看到:
uart0_pins_b: uart0@1 {
pins = "PB0", "PB1";
function = "uart0";
};
所以你要查查这个串口
而且uboot里有个选项,可以选TF卡上的那个uart0,你可以试一下
A33开发板买的这一家: https://item.taobao.com/item.htm?spm=a1z09.2.0.0.16a02e8dC4lcxZ&id=589094110822&_u=uc9cub3400
是4GB eMMC, 512MB内存的配置。
uboot直接用的主线最新2020.1版本,defconfig用的是Sinlinx_SinA33_defconfig
生成的u-boot-sunxi-with-spl.bin用sunxi-fel的uboot命令可以跑起来:
sunxi-fel uboot u-boot-sunxi-with-spl.bin
主线uboot驱动很完善,LCD console直接跑起来,而且支持USB Mass Storage 和Gadget等
->mmc list
mmc@01c0f000: 0 (SD)
mmc@01c11000: 1 (eMMC)
然后敲入ums命令【需在menuconfig中选上UMS命令】
ums 2 mmc 1
即可把 eMMC 设置成 USB Mass Storage设备(PC上识别为/dev/sdb)
但是接下来把uboot烧到8k地址不起作用,不能启动。我的命令是:
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8
没有串口打印,但屏幕也无显示,不过背光能亮起来,感觉还是有什么程序跑起来的样子,只是中断了
参考文档:
https://www.olimex.com/wiki/ArmbianHowTo#Update_SD.2FeMMC_card
交叉编译了一下linux fb的测试程序:
env = Environment(CC='/opt/arm-2014.05/bin/arm-none-linux-gnueabi-gcc')
LIBS = []
LIBPATH=[]
CCFLAGS = '--sysroot /home/parallels/Documents/pyscreen/buidroot/buildroot/output/host/arm-buildroot-linux-gnueabi/sysroot'
LINKFLAGS = '--sysroot /home/parallels/Documents/pyscreen/buidroot/buildroot/output/host/arm-buildroot-linux-gnueabi/sysroot'
env.Program('fb_test', ['fb_test.c'],
LIBS = LIBS,
LIBPATH = LIBPATH,
LINKFLAGS = LINKFLAGS,
CCFLAGS = CCFLAGS)
我手里有一个 ILI9481 SPI + RGB 的 320x480 屏, 本来想用SPI初始化成 480x320,
但是死活没搞定, 不是这里不对, 就是那里不对,操碎了心。
请问你用的是哪个屏呢?旋转可以参考一下吗?
参见 https://whycan.cn/t_3222.html
看我那个转90度的宏
其实就是设置mv比特,再设置data mover的行列范围
https://github.com/Lichee-Pi/u-boot/blob/nano-lcd800480/arch/arm/mach-sunxi/dram_suniv.c
改成这样对吧? ====>
犀利, 请问你是怎么发现的 ^_^
感觉这下跑Linux速度可以更快了.
试了几把发现改了没用,然后搜关键字才搜到。。
提高dram频率对有内存吞吐的APP作用很明显,几乎是50%的提高
CPU频率提高对不牵扯到大量数据的运算有用。我最高试到888mhz, bogoMIPS从300多提高到400多
1. 从Uboot设置的CPU频率决定了Linux启动后的频率
CONFIG_SYS_CLK_FREQ
用devmem确认Linux跑起来之后还是这个频率
2. 根据另一个帖子 https://whycan.cn/t_1949.html ,通过uboot把DRAM设置成240MHz(480M)成功跑起来
arch/arm/mach-sunxi/dram_suniv.c:
struct dram_para suniv_dram_para = {
.size = 32,
.clk = 156,//改这里,或者替换成CONFIG_DRAM_CLK
实测240M性能比156M有较大提高
https://whycan.cn/files/members/2532/2019-12-11_094247.png
你说的是这个 Qt Designer 吧? 这个设计出来的 UI 可以用在别的 app 吗?
awtk好像早期用这个。
反正开源的,应该能自己改造
谢谢晕哥,那个帖子没看完,原来有人和我一样问题。
另外问下,为什么我的kernel选项没有这几个
参照 https://whycan.cn/t_2794.html 编译了带adb的buildroot,然后执行以下命令:
modprobe g_ffs idVendor=0x18d1 idProduct=0x4e42 iSerialNumber="buildroot"
但是报错:
modprobe: can't change directory to '/lib/modules': No such file or directory
请问怎么回事?
下载:
https://whycan.cn/t_3206.html
或
https://whycan.cn/t_2689.html里面的 TF 卡固件,烧录到 TF卡.
windows用win32diskimager, linux用dd命令,
然后把楼主的文件解压到第二个分区.
怎么解压到第二分区,说我没有权限,我不是owner