OpenHarmony开发者论坛

标题: OpenHarmony常用编译烧录命令汇集 [打印本页]

作者: 润开鸿_闻飞    时间: 2024-9-11 15:21
标题: OpenHarmony常用编译烧录命令汇集
[md]## 一、开发板配置

### 1.1 L2的hispark\_taurus启动uboot设置

* **2021/10/20以前**
  ```
  setenv bootargs 'mem=640M console=ttyAMA0,115200 mmz=anonymous,0,0xA8000000,384M clk_ignore_unused androidboot.selinux=permissive skip_initramfs rootdelay=5 init=/init root=/dev/mmcblk0p5 rootfstype=ext4 rw blkdevparts=mmcblk0:1M(boot),15M(kernel),20M(updater),1M(misc),3307M(system),256M(vendor),-(userdata)'
  saveenv
  reset
  ```
* **2021/10/20之后**
  ```
  setenv bootargs 'mem=640M console=ttyAMA0,115200 mmz=anonymous,0,0xA8000000,384M clk_ignore_unused androidboot.selinux=permissive rootdelay=10 hardware=Hi3516DV300 init=/init root=/dev/ram0 rw blkdevparts=mmcblk0:1M(boot),15M(kernel),20M(updater),2M(misc),3307M(system),256M(vendor),-(userdata)';setenv bootcmd 'mmc read 0x0 0x82000000 0x800 0x4800;bootm 0x82000000'
  saveenv
  reset
  ```

### 1.2 L1 hispark\_taurus的linux启动uboot设置

```
setenv bootargs "mem=128M console=ttyAMA0,115200 root=/dev/mmcblk0p3 rw rootfstype=ext4 rootwait selinux=0 rootdelay=5 blkdevparts=mmcblk0:1M(boot),9M(kernel),50M(rootfs),50M(userfs)"
setenv bootcmd "mmc read 0x0 0x82000000 0x800 0x4800;bootm 0x82000000"
saveenv
reset
```

### 1.3 L1 hispark\_taurus的liteos启动uboot设置

```
setenv bootcmd "mmc read 0x0 0x80000000 0x800 0x4800";
setenv bootargs "console=ttyAMA0,115200n8 root=emmc fstype=vfat rootaddr=10M rootsize=30M rw";
saveenv
reset
go 0x80000000
```

### 1.4 L1 其他的启动功能设置

```
setenv serverip 192.168.1.23
setenv gatewayip 192.168.1.1
set netmask 255.255.255.0
setenv ipaddr 192.168.1.100
setenv bootargs "mem=128M console=ttyAMA0,115200 ip=192.168.1.100 root=/dev/mmcblk0p3 rw rootfstype=ext4 rootwait selinux=0 rootdelay=5 blkdevparts=mmcblk0:1M(boot),6M(kernel),50M(rootfs),50M(userfs),1024M(userdata)"
setenv bootcmd "mmc read 0x0 0x82000000 0x800 0x4800;bootm 0x82000000"

setenv bootargs root=/dev/nfs nfsroot=192.168.3.5:/home/wenfei/source/rootfs,proto=tcp,nfsvers=3 rw console=ttySAC2,115200 init=/linuxrc ip=192.168.3.100

mount -t nfs 192.168.1.23:nfs  ./test
mount 192.168.1.23:/nfs test -o proto=tcp -o nolock
mount -o nolock,addr=10.20.24.83 -t nfs 10.20.24.83:/nfs /nfs
mount -o nolock,addr=10.20.24.145 -t nfs 10.20.24.145:/nfs /nfs

ifconfig eth0 10.20.24.200 netmask 255.255.255.0 gateway 10.20.24.1
```

### 1.5 L0 恒玄BES2600编译和烧写介绍

* **编译和烧写介绍**
  [恒玄BES2600编译和烧写介绍](https://gitee.com/openharmony/device_soc_bestechnic)
* **恒玄开发板stack栈空间大小设置**
  ```
  # 修改 vendor/bestechnic/display_demo/tests/example.c
  attr.stack_size 16384
  ```
* **恒玄开发板flash空间大小设置**
  ```
  # 修改/openharmony_bestechnic/device/board/fnlink/v200zr/liteos_m/config.gni
  flash_size=32
  ```

### 1.6 w800(neptune)资料

* **官网资料**
  [w800官网资料](https://www.winnermicro.com/html/1/156/158/558.html)
* **w800移植OpenHarmony说明**
  [w800芯片移植案例](https://gitee.com/openharmony/do ... -w800-combo-demo.md)

## 二、L2编译命令

### 2.1 rk3568开发板编译

#### 2.1.1 全量编译

```
# arm32编译
./build.sh --product-name=rk3568 --ccache

# arm64编译
./build.sh --product-name=rk3568 --target-cpu=arm64 --ccache
```

#### 2.1.2 单模块编译

```
./build.sh --product-name rk3568 --build-target module
```

#### 2.1.3 内核编译

```
./build.sh --product-name rk3568 --build-target kernel
```

#### 2.1.4 测试编译

```
./build.sh --product-name rk3568 --build-target make_test
```

### 2.2 Hi3516开发板编译

#### 2.2.1 linux5.10内核全量编译

```
./build.sh --product-name hispark_taurus_standard --ccache
```

#### 2.2.2 linux4.19内核全量编译

```
./build.sh --product-name hispark_taurus_standard --gn-args linux_kernel_version=\"linux-4.19\"
```

#### 2.2.3 单模块编译

```
./build.sh --product-name hispark_taurus_standard --build-target module
```

#### 2.2.4 内核编译

```
./build.sh --product-name hispark_taurus_standard --build-target build_kernel
```

### 2.3 QEMU内核编译

```
export ROSS_COMPILE=../../../prebuilts/gcc/linux-x86/aarch64/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
export ARCH=arm64
make defconfig
make oldconfig
make clean
make -j64
```

## 三、L1编译命令

### 3.1 全量编译

```
hb set
hb build / hb build -f # 加 -f 表示强制全部重新编译
```

### 3.2 单模块编译

```
hb build -T path:module_name # path表示模块的路径, module_name表示要编译的模块
```

## 四、L0编译命令

### 4.1 恒玄BES2600编译

```
hb build -f --gn-args build_xts=true
```

### 4.2 w800的neptune 100编译

```
python3 build.py -p neptune_iotlink_demo@hihope --gn-args build_xts=true
python3 build.py -p neptune_iotlink_demo@hihope -b debug --gn-args build_xts=true
```

## 五、hdc命令

## 六、其他命令

### 4.1 格式化BUILD.gn命令

```
cat xxx/BUILD.gn | prebuilts/build-tools/linux-x86/bin/gn format --stdin > FORMAT_RESULT.gn;cp -f FORMAT_RESULT.gn xxx/BUILD.gn;rm FORMAT_RESULT.gn
```
[/md]




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5