MD1
# 一、拉取代码
注:拉取代码前,需先打开git的密码存储功能,`git config --global credential.helper store`,可以先git clone一下`https://gitee.com/holdiot/index.git`保存账号和密码。
第一步:
`repo init -u https://gitee.com/holdiot/index.git -b master --no-repo-verify`
第二步:
`repo sync -c`
第三步:
`repo forall -c 'git lfs pull'`
# 二、修改代码
### 1、可修改代码
* 1、/kernel/liteos_a
* 2、/vendor/bearpi
* 3、/device/st
### 2、提交仓库
* 1、cd 到可修改仓库中的任一目录
* 2、`git add .`
* 3、`git commit -m "update"`
* 4、`git push`
# 三、编译
### 1、通过hb编译
* 1、进入程序根目录
* 2、输入:`hb set`回车
* 3、输入:`.`回车
* 4、选择:`bearpi-hm micor`回车

* 5、输入:`hb build --tee -f`回车
# 四、下载
### 1、准备工作:
1. 下载工具(`STM32CubeProgrammer`)
2. 固件及配置文件:

+ tfa-uboot:文件夹中存放`TF-A`和`U-Boot`
+ kernel-file:文件夹中存放OHOS生成的`Kernel`和`systemfile`
+ BearPi-HM_Micro.tsv:配置文件,由下载工具`STM32CubeProgrammer`调用
```
#Opt Id Name Type IP Offset Binary
- 0x01 fsbl1-boot Binary none 0x0 tfa-uboot/tf-a-stm32mp157a-bearpi-hm_micro-mx-trusted.stm32
- 0x03 ssbl-boot Binary none 0x0 tfa-uboot/u-boot.stm32
P 0x04 fsbl1 Binary mmc1 boot1 tfa-uboot/tf-a-stm32mp157a-bearpi-hm_micro-mx-trusted.stm32
P 0x05 fsbl2 Binary mmc1 boot2 tfa-uboot/tf-a-stm32mp157a-bearpi-hm_micro-mx-trusted.stm32
PD 0x06 ssbl Binary mmc1 0x00080000 tfa-uboot/u-boot.stm32
P 0x21 boot Binary mmc1 0x00280000 kernel-file/liteos_kernel.bin
P 0x22 rootfs FileSystem mmc1 0x04280000 kernel-file/rootfs.jffs2.bin
```
### 2、下载

+ 1、打开配置文件
+ 2、选择配置文件中所需的固件目录地址
+ 3、选择对应开发板(如找不到开发板,将开发板BOOT设置为`000`,并按下`RESET`后再次刷新)
+ 4、下载
# 五、运行
### 1、串口命令调试串口
波特率为115200
### 2、设置启动方式
设置开发板启动方式为eMMC启动:010
### 3、配置uboot启动参数
```
mmc read 0xC1000000 1400 16D0
mmc read 0xD0000000 0x00021400 7600
bootm 0xC1000000
```
### 4、运行Kernel
