Skip to main content

X1600en_LZMA压缩

一 概述

为了减小kernel大小, 采取lzma压缩, 通过spl 加载 rtos, 然后 rtos 去解压kernel.

二 配置及编译

2.1 linux配置

使用x1600en_nor_5.10_quickstart_defconfig配置编译

bhu@bhu-PC:~/ad100/build$ make x1600en_nor_5.10_quickstart_defconfig 
bhu@bhu-PC:~/ad100/build$ make

编译后生成固件如下:

bhu@bhu-PC:~/work/build/output$ ls -l
总用量 7244
-rw-r--r-- 1 bhu bhu 4808704 41 11:48 rootfs.squashfs
-rw-r--r-- 1 bhu bhu 26624 41 11:48 u-boot-spl-pad.bin
-rw-r--r-- 1 bhu bhu 2577635 41 11:48 uImage_split

2.2 rtos配置

使用x1600en_nor_quick_start_defconfig配置编译

在/rtos工程目录/freertos/vendor/vendor.c内, 修改代码如下:

#include <stdio.h>
#include "../example/driver/quick_boot_logo_and_load_split_uimage_example.c"
void vendor_init(void *arg)
{
printf("vendor init...\n");
quick_boot_logo_and_load_kernel(arg);
}

修改quick_boot_logo_and_load_split_uimage_example.c

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <common.h>
#include <os.h>
#include <driver/cache.h>
#include <driver/gpio.h>
// #undef CONFIG_XBURST2

#define NOT_DISPLAY /* 不显示logo时开启 */ //打开这个宏

编译rtos系统:

bhu@bhu-PC:~/rtos/freertos$ source build/envsetup.sh
bhu@bhu-PC:~/rtos/freertos$ make x1600en_nor_quick_start_defconfig
bhu@bhu-PC:~/rtos/freertos$ make

编译后需要固件如下:

bhu@bhu-PC:~/rtos/freertos$ ls -l zero.bin 
-rwxr-xr-x 1 bhu bhu 203804 41 13:56 zero.bin

三 烧录

1

2

3