Hi3536开机画面设置

来源:互联网 发布:js前端开发群月报 编辑:程序博客网 时间:2024/04/29 12:20

我是用的海思SDK2.0.6版本,海思有专门的开发文档供参考,需要的可以留言

首先,hisi3536开机按任意键进入命令行模式,可以烧写系统,执行一些命令。

sf read用来读取flash数据到内存

sf write写内存数据到flash

sf erase 擦除指定位置,指定长度的flash内容, 擦除后内容全1


具体用法

sf probe [[bus:]cs] [hz] [mode] - init flash device on given SPI bus and chip select

sf read addr offset len              - read `len' bytes starting at`offset' to memory at `addr'

sf write addr offset len             - write `len' bytes from memor at `addr' to flash at `offset'

sf erase offset [+]len                - erase `len' bytes from `offset' `+len' round up `len' to block size

sf update addr offset len         - erase and write `len' bytes from memory at `addr' to flash at `offset'


1.先要把图片保存到flash

烧写图片到Flash的步骤如下

mw.b 82000000 ff 30000            按回车

tftp 0x82000000 hisi.jpg             按回车

sf probe 0                                      按回车

sf erase c0000 30000

sf write 82000000 c0000 30000     按回车

还可以使用HiTool来烧写,选择按地址烧写,输入地址c0000 长度30000。


2.输入

sf probe 0
sf read 81000000 c0000 30000
setenv jpeg_addr 0x81000000
setenv jpeg_size 0x156c7
setenv vobuf 0x84000000
decjpg
startvo 0 32 12
startvl 0 0x84000000 1920 0 0 1920 1080

便可以在显示器上看到你想要设置的开机logo,具体的参数参考hisi的文档,选择合适自己的。

在命令行下可以实现,下一步就是要转到boot代码了


3.修改boot代码

修改Uboot arch/arm/lib/board.c 文件,直接将上面的命令包装放到boot里面

3.1添加函数LogintImage如下代码:

 /****************************************************************************/

void LogintImage(void)

{

run_command("sf probe 0",1);
run_command("sf read 81000000 c0000 30000",1);
run_command("setenv jpeg_addr 0x81000000",1);
run_command("setenv jpeg_size 0x156c7",1);
run_command("setenv vobuf 0x84000000",1);
run_command("decjpg",1);
run_command("startvo 0 32 12",1);
run_command("startvl 0 0x84000000 1920 0 0 1920 1080",1);

}

 

3.2、在start_armboot函数中加入 调用函数LogintImage语句

void start_armboot (void)

{

   .......

   LogintImage();

 

/* main_loop() can return to retry autoboot, if so just run it again. */

for (;;) {

main_loop ();

}

 ......

}


4.编译boot

具体的过程海思的开发文档写的很详细 就不多说了。

5.烧写boot,并烧写logo图片进入flash

大功告成,这里有一个问题,hisi的这个开机画面的API还是强制hdmi输出,这导致一些不支持hdmi的设备无法显示,后续再修改代码吧。