fix Ubiquitous/XiZi/board/ README.md description
|
@ -30,23 +30,25 @@ sudo apt-get install gcc-arm-none-eabi
|
|||
>2.在代码根目录下执行以下命令,生成配置文件
|
||||
|
||||
```
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=aiit-arm32-board distclean
|
||||
make BOARD=aiit-arm32-board menuconfig
|
||||
```
|
||||
>3.在menuconfig界面配置需要关闭和开启的功能,按回车键进入下级菜单,按Y键选中需要开启的功能,按N键选中需要关闭的功能,配置结束后保存并退出
|
||||
|
||||

|
||||

|
||||
|
||||
>4.继续执行以下命令,进行编译
|
||||
```
|
||||
make BOARD=aiit-arm32-board
|
||||
```
|
||||
>5.如果编译正确无误,会产生XiUOS_aiit-arm32-board.elf、XiUOS_aiit-arm32-board.bin文件。其中XiUOS_aiit-arm32-board.bin需要烧写到设备中进行运行。
|
||||
>5.如果编译正确无误,会产生XiZi_aiit-arm32-board.elf、XiZi_aiit-arm32-board.bin文件。其中XiZi_aiit-arm32-board.bin需要烧写到设备中进行运行。
|
||||
```
|
||||
sudo write build/XiUOS_aiit-arm32-board.bin 0x8000000
|
||||
sudo write build/XiZi_aiit-arm32-board.bin 0x8000000
|
||||
```
|
||||
>6.最后可以执行以下命令,清除配置文件和编译生成的文件
|
||||
```
|
||||
make BOARD=aiit-arm32-board distclean
|
||||
make BOARD=aiit-arm32-board distclean
|
||||
```
|
||||
|
||||
## 3. 烧写及执行
|
||||
|
@ -56,7 +58,7 @@ make BOARD=aiit-arm32-board distclean
|
|||
st-link 图片如下:
|
||||
|
||||
<div align= "center">
|
||||
<img src = st-link.png>
|
||||
<img src = ./img/st-link.png>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -66,15 +68,15 @@ git clone https://github.com/texane/stlink.git
|
|||
```
|
||||
aiit-arm32-board下载连接示意图如下:
|
||||
<div align= "center">
|
||||
<img src = aiit.jpg>
|
||||
<img src = ./img/aiit.jpg>
|
||||
</div>
|
||||
|
||||
代码根目录下执行st-flash工具烧录
|
||||
```
|
||||
sudo st-flash write build/XiUOS_aiit-arm32-board.bin 0x8000000
|
||||
sudo st-flash write build/XiZi_aiit-arm32-board.bin 0x8000000
|
||||
```
|
||||
### 3.1 运行结果
|
||||
|
||||
如果编译 & 烧写无误,将会在串口终端上看到信息打印输出,(终端串口引脚为PA9、PA10)。
|
||||
|
||||

|
||||

|
||||
|
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
|
@ -27,6 +27,8 @@ export CROSS_COMPILE ?=/opt/gnu-mcu-eclipse/riscv-none-gcc/8.2.0-2.1-20190425-10
|
|||
```
|
||||
>2.在代码根目录下执行以下命令,生成配置文件
|
||||
```
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=aiit-riscv64-board distclean
|
||||
make BOARD=aiit-riscv64-board menuconfig
|
||||
```
|
||||
>3.在menuconfig界面配置需要关闭和开启的功能,按回车键进入下级菜单,按Y键选中需要开启的功能,按N键选中需要关闭的功能,配置结束后选择Exit保存并退出
|
||||
|
@ -34,7 +36,7 @@ make BOARD=aiit-riscv64-board menuconfig
|
|||
```
|
||||
make BOARD=aiit-riscv64-board
|
||||
```
|
||||
>5.如果编译正确无误,会产生XiUOS_aiit-riscv64-board.elf、XiUOS_aiit-riscv64-board.bin文件。其中XiUOS_aiit-riscv64-board.bin需要烧写到设备中进行运行。
|
||||
>5.如果编译正确无误,会产生XiZi_aiit-riscv64-board.elf、XiZi_aiit-riscv64-board.bin文件。其中XiZi_aiit-riscv64-board.bin需要烧写到设备中进行运行。
|
||||
>注:最后可以执行以下命令,清除配置文件和编译生成的文件
|
||||
```
|
||||
make BOARD=aiit-riscv64-board distclean
|
||||
|
@ -62,7 +64,7 @@ sudo pip2 install kflash
|
|||
```
|
||||
代码根目录下执行K-Flash工具烧录,-p为USB端口号,视实际情况而定
|
||||
```
|
||||
kflash -t build/XiUOS_aiit-riscv64-board.bin -p /dev/ttyUSB0
|
||||
kflash -t build/XiZi_aiit-riscv64-board.bin -p /dev/ttyUSB0
|
||||
```
|
||||
### 3.1 运行结果
|
||||
|
||||
|
|
|
@ -63,25 +63,28 @@ $ sudo apt install build-essential pkg-config git
|
|||
$ sudo apt install gcc make libncurses5-dev openssl libssl-dev bison flex libelf-dev autoconf libtool gperf libc6-dev
|
||||
```
|
||||
|
||||
**XiUOS操作系统源码下载:** XiUOS [https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos)
|
||||
**XiUOS操作系统源码下载:** XiUOS [https://www.gitlink.org.cn/xuos/xiuos](https://www.gitlink.org.cn/xuos/xiuos)
|
||||
|
||||
新建一个空文件夹并进入文件夹中,并下载源码,具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir test && cd test
|
||||
git clone https://git.trustie.net/xuos/xiuos.git
|
||||
git clone https://gitlink.org.cn/xuos/xiuos.git
|
||||
```
|
||||
|
||||
打开源码文件包可以看到以下目录:
|
||||
| 名称 | 说明 |
|
||||
| -- | -- |
|
||||
| application | 应用代码 |
|
||||
| board | 板级支持包 |
|
||||
| framework | 应用框架 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
1、打开XiUOS源码文件包可以看到以下目录:
|
||||
| ------------- | ------- |
|
||||
| APP_Framework | 应用代码 |
|
||||
| Ubiquitous | 板级支持包,支持NuttX、RT-Thread和XiZi内核 |
|
||||
2、打开XiZi内核源码文件包可以看到以下目录:
|
||||
| ------------- | --------|
|
||||
| arch | 架构代码 |
|
||||
| board | 板级支持包 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| lib | 第三方库源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
|
||||
使用VScode打开代码,具体操作步骤为:在源码文件夹下打开系统终端,输入`code .`即可打开VScode开发环境,如下图所示:
|
||||
|
||||
|
@ -93,18 +96,18 @@ git clone https://git.trustie.net/xuos/xiuos.git
|
|||
|
||||
裁减配置工具:
|
||||
|
||||
**工具地址:** kconfig-frontends [https://forgeplus.trustie.net/projects/xuos/kconfig-frontends](https://forgeplus.trustie.net/projects/xuos/kconfig-frontends),下载与安装的具体命令如下:
|
||||
**工具地址:** kconfig-frontends [https://www.gitlink.org.cn/xuos/kconfig-frontends](https://www.gitlink.org.cn/xuos/kconfig-frontends),下载与安装的具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir kfrontends && cd kfrontends
|
||||
git clone https://git.trustie.net/xuos/kconfig-frontends.git
|
||||
git clone https://gitlink.org.cn/xuos/kconfig-frontends.git
|
||||
```
|
||||
|
||||
下载源码后按以下步骤执行软件安装:
|
||||
|
||||
```c
|
||||
cd kconfig-frontends
|
||||
./xs_build.sh
|
||||
./xs_build.sh
|
||||
```
|
||||
|
||||
### 编译工具链:
|
||||
|
@ -128,7 +131,9 @@ $ sudo apt install gcc-arm-none-eabi
|
|||
1.在VScode命令终端中执行以下命令,生成配置文件
|
||||
|
||||
```c
|
||||
make BOARD=cortex-m0-emulator menuconfig
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=cortex-m0-emulator distclean
|
||||
make BOARD=cortex-m0-emulator menuconfig
|
||||
```
|
||||
|
||||
2.在menuconfig界面配置需要关闭和开启的功能,按回车键进入下级菜单,按Y键选中需要开启的功能,按N键选中需要关闭的功能,配置结束后保存并退出(本例旨在演示简单的输出例程,所以没有需要配置的选项,双击快捷键ESC退出配置)
|
||||
|
@ -145,7 +150,7 @@ $ sudo apt install gcc-arm-none-eabi
|
|||
make BOARD=cortex-m0-emulator
|
||||
```
|
||||
|
||||
4.如果编译正确无误,会产生XiUOS_cortex-m0-emulator.elf、XiUOS_cortex-m0-emulator.bin文件。
|
||||
4.如果编译正确无误,会产生XiZi_cortex-m0-emulator.elf、XiZi_cortex-m0-emulator.bin文件。
|
||||
|
||||
## 3. 运行
|
||||
|
||||
|
@ -160,7 +165,7 @@ sudo apt install qemu-system-arm
|
|||
通过以下命令启动QEMU并加载XiUOS ELF文件
|
||||
|
||||
```
|
||||
qemu-system-arm -machine microbit -nographic -kernel build/XiUOS_cortex-m0-emulator.elf
|
||||
qemu-system-arm -machine microbit -nographic -kernel build/XiZi_cortex-m0-emulator.elf
|
||||
```
|
||||
|
||||
QEMU运行起来后将会在终端上看到信息打印输出
|
||||
|
@ -177,11 +182,11 @@ sudo apt install gdb-multiarch
|
|||
并通过以下命令启动QEMU
|
||||
|
||||
```
|
||||
qemu-system-arm -machine microbit -nographic -kernel build/XiUOS_cortex-m0-emulator.elf -s -S
|
||||
qemu-system-arm -machine microbit -nographic -kernel build/XiZi_cortex-m0-emulator.elf -s -S
|
||||
```
|
||||
|
||||
然后要重新开启另一个linux系统终端一个终端,执行命令
|
||||
|
||||
```
|
||||
gdb-multiarch build/XiUOS_cortex-m0-emulator.elf -ex "target remote localhost:1234"
|
||||
gdb-multiarch build/XiZi_cortex-m0-emulator.elf -ex "target remote localhost:1234"
|
||||
```
|
||||
|
|
|
@ -63,25 +63,28 @@ $ sudo apt install build-essential pkg-config git
|
|||
$ sudo apt install gcc make libncurses5-dev openssl libssl-dev bison flex libelf-dev autoconf libtool gperf libc6-dev
|
||||
```
|
||||
|
||||
**XiUOS操作系统源码下载:** XiUOS [https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos)
|
||||
**XiUOS操作系统源码下载:** XiUOS [https://www.gitlink.org.cn/xuos/xiuos](https://www.gitlink.org.cn/xuos/xiuos)
|
||||
|
||||
新建一个空文件夹并进入文件夹中,并下载源码,具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir test && cd test
|
||||
git clone https://git.trustie.net/xuos/xiuos.git
|
||||
git clone https://gitlink.org.cn/xuos/xiuos.git
|
||||
```
|
||||
|
||||
打开源码文件包可以看到以下目录:
|
||||
| 名称 | 说明 |
|
||||
| -- | -- |
|
||||
| application | 应用代码 |
|
||||
| board | 板级支持包 |
|
||||
| framework | 应用框架 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
1、打开XiUOS源码文件包可以看到以下目录:
|
||||
| ------------- | ------- |
|
||||
| APP_Framework | 应用代码 |
|
||||
| Ubiquitous | 板级支持包,支持NuttX、RT-Thread和XiZi内核 |
|
||||
2、打开XiZi内核源码文件包可以看到以下目录:
|
||||
| ------------- | --------|
|
||||
| arch | 架构代码 |
|
||||
| board | 板级支持包 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| lib | 第三方库源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
|
||||
使用VScode打开代码,具体操作步骤为:在源码文件夹下打开系统终端,输入`code .`即可打开VScode开发环境,如下图所示:
|
||||
|
||||
|
@ -93,18 +96,18 @@ git clone https://git.trustie.net/xuos/xiuos.git
|
|||
|
||||
裁减配置工具:
|
||||
|
||||
**工具地址:** kconfig-frontends [https://forgeplus.trustie.net/projects/xuos/kconfig-frontends](https://forgeplus.trustie.net/projects/xuos/kconfig-frontends),下载与安装的具体命令如下:
|
||||
**工具地址:** kconfig-frontends [https://www.gitlink.org.cn/xuos/kconfig-frontends](https://www.gitlink.org.cn/xuos/kconfig-frontends),下载与安装的具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir kfrontends && cd kfrontends
|
||||
git clone https://git.trustie.net/xuos/kconfig-frontends.git
|
||||
git clone https://gitlink.org.cn/xuos/kconfig-frontends.git
|
||||
```
|
||||
|
||||
下载源码后按以下步骤执行软件安装:
|
||||
|
||||
```c
|
||||
cd kconfig-frontends
|
||||
./xs_build.sh
|
||||
./xs_build.sh
|
||||
```
|
||||
|
||||
### 编译工具链:
|
||||
|
@ -128,7 +131,9 @@ $ sudo apt install gcc-arm-none-eabi
|
|||
1.在VScode命令终端中执行以下命令,生成配置文件
|
||||
|
||||
```c
|
||||
make BOARD=cortex-m3-emulator menuconfig
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=cortex-m3-emulator distclean
|
||||
make BOARD=cortex-m3-emulator menuconfig
|
||||
```
|
||||
|
||||
2.在menuconfig界面配置需要关闭和开启的功能,按回车键进入下级菜单,按Y键选中需要开启的功能,按N键选中需要关闭的功能,配置结束后保存并退出(本例旨在演示简单的输出例程,所以没有需要配置的选项,双击快捷键ESC退出配置)
|
||||
|
@ -145,7 +150,7 @@ $ sudo apt install gcc-arm-none-eabi
|
|||
make BOARD=cortex-m3-emulator
|
||||
```
|
||||
|
||||
4.如果编译正确无误,会产生XiUOS_cortex-m3-emulator.elf、XiUOS_cortex-m3-emulator.bin文件。
|
||||
4.如果编译正确无误,会产生XiZi_cortex-m3-emulator.elf、XiZi_cortex-m3-emulator.bin文件。
|
||||
|
||||
## 3. 运行
|
||||
|
||||
|
@ -160,7 +165,7 @@ sudo apt install qemu-system-arm
|
|||
通过以下命令启动QEMU并加载XiUOS ELF文件
|
||||
|
||||
```
|
||||
qemu-system-arm -machine lm3s6965evb -nographic -kernel build/XiUOS_cortex-m3-emulator.elf
|
||||
qemu-system-arm -machine lm3s6965evb -nographic -kernel build/XiZi_cortex-m3-emulator.elf
|
||||
```
|
||||
|
||||
QEMU运行起来后将会在终端上看到信息打印输出
|
||||
|
@ -177,11 +182,11 @@ sudo apt install gdb-multiarch
|
|||
并通过以下命令启动QEMU
|
||||
|
||||
```
|
||||
qemu-system-arm -machine lm3s6965evb -nographic -kernel build/XiUOS_cortex-m3-emulator.elf -s -S
|
||||
qemu-system-arm -machine lm3s6965evb -nographic -kernel build/XiZi_cortex-m3-emulator.elf -s -S
|
||||
```
|
||||
|
||||
然后要重新开启另一个linux系统终端一个终端,执行`riscv-none-embed-gdb`命令
|
||||
|
||||
```
|
||||
gdb-multiarch build/XiUOS_cortex-m3-emulator.elf -ex "target remote localhost:1234"
|
||||
gdb-multiarch build/XiZi_cortex-m3-emulator.elf -ex "target remote localhost:1234"
|
||||
```
|
||||
|
|
|
@ -63,26 +63,30 @@ $ sudo apt install build-essential pkg-config git
|
|||
$ sudo apt install gcc make libncurses5-dev openssl libssl-dev bison flex libelf-dev autoconf libtool gperf libc6-dev
|
||||
```
|
||||
|
||||
**XiUOS操作系统源码下载:** XiUOS [https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos)
|
||||
**XiUOS操作系统源码下载:** XiUOS [https://www.gitlink.org.cn/xuos/xiuos](https://www.gitlink.org.cn/xuos/xiuos)
|
||||
|
||||
新建一个空文件夹并进入文件夹中,并下载源码,具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir test && cd test
|
||||
git clone https://git.trustie.net/xuos/xiuos.git
|
||||
git clone https://gitlink.org.cn/xuos/xiuos.git
|
||||
```
|
||||
|
||||
打开源码文件包可以看到以下目录:
|
||||
|
||||
| 名称 | 说明 |
|
||||
| ----------- | ---------- |
|
||||
| application | 应用代码 |
|
||||
| board | 板级支持包 |
|
||||
| framework | 应用框架 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
1、打开XiUOS源码文件包可以看到以下目录:
|
||||
| ------------- | ------- |
|
||||
| APP_Framework | 应用代码 |
|
||||
| Ubiquitous | 板级支持包,支持NuttX、RT-Thread和XiZi内核 |
|
||||
2、打开XiZi内核源码文件包可以看到以下目录:
|
||||
| ------------- | --------|
|
||||
| arch | 架构代码 |
|
||||
| board | 板级支持包 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| lib | 第三方库源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
|
||||
使用VScode打开代码,具体操作步骤为:在源码文件夹下打开系统终端,输入`code .`即可打开VScode开发环境,如下图所示:
|
||||
|
||||
|
@ -95,18 +99,18 @@ git clone https://git.trustie.net/xuos/xiuos.git
|
|||
|
||||
裁减配置工具:
|
||||
|
||||
**工具地址:** kconfig-frontends [https://forgeplus.trustie.net/projects/xuos/kconfig-frontends](https://forgeplus.trustie.net/projects/xuos/kconfig-frontends),下载与安装的具体命令如下:
|
||||
**工具地址:** kconfig-frontends [https://www.gitlink.org.cn/xuos/kconfig-frontends](https://www.gitlink.org.cn/xuos/kconfig-frontends),下载与安装的具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir kfrontends && cd kfrontends
|
||||
git clone https://git.trustie.net/xuos/kconfig-frontends.git
|
||||
git clone https://gitlink.org.cn/xuos/kconfig-frontends.git
|
||||
```
|
||||
|
||||
下载源码后按以下步骤执行软件安装:
|
||||
|
||||
```c
|
||||
cd kconfig-frontends
|
||||
./xs_build.sh
|
||||
./xs_build.sh
|
||||
```
|
||||
|
||||
### 编译工具链:
|
||||
|
@ -133,7 +137,9 @@ $ sudo apt install gcc-arm-none-eabi
|
|||
1.在VScode命令终端中执行以下命令,生成配置文件
|
||||
|
||||
```c
|
||||
make BOARD=cortex-m4-emulator menuconfig
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=cortex-m4-emulator distclean
|
||||
make BOARD=cortex-m4-emulator menuconfig
|
||||
```
|
||||
|
||||
2.在menuconfig界面配置需要关闭和开启的功能,按回车键进入下级菜单,按Y键选中需要开启的功能,按N键选中需要关闭的功能,配置结束后保存并退出(本例旨在演示简单的输出例程,所以没有需要配置的选项,双击快捷键ESC退出配置)
|
||||
|
@ -154,7 +160,7 @@ $ sudo apt install gcc-arm-none-eabi
|
|||
make BOARD=cortex-m4-emulator
|
||||
```
|
||||
|
||||
4.如果编译正确无误,会产生XiUOS_cortex-m4-emulator.elf、XiUOS_cortex-m4-emulator.bin文件。
|
||||
4.如果编译正确无误,会产生XiZi_cortex-m4-emulator.elf、XiZi_cortex-m4-emulator.bin文件。
|
||||
|
||||
|
||||
|
||||
|
@ -171,7 +177,7 @@ sudo apt install qemu-system-arm
|
|||
通过以下命令启动QEMU并加载XiUOS ELF文件
|
||||
|
||||
```
|
||||
qemu-system-arm -machine netduinoplus2 -nographic -kernel build/XiUOS_cortex-m4-emulator.elf
|
||||
qemu-system-arm -machine netduinoplus2 -nographic -kernel build/XiZi_cortex-m4-emulator.elf
|
||||
```
|
||||
|
||||
QEMU运行起来后将会在终端上看到信息打印输出
|
||||
|
@ -191,11 +197,11 @@ sudo apt install gdb-multiarch
|
|||
并通过以下命令启动QEMU
|
||||
|
||||
```
|
||||
qemu-system-arm -machine netduinoplus2 -nographic -kernel build/XiUOS_cortex-m4-emulator.elf -s -S
|
||||
qemu-system-arm -machine netduinoplus2 -nographic -kernel build/XiZi_cortex-m4-emulator.elf -s -S
|
||||
```
|
||||
|
||||
然后要重新开启另一个linux系统终端一个终端,执行`riscv-none-embed-gdb`命令
|
||||
|
||||
```
|
||||
gdb-multiarch build/XiUOS_cortex-m4-emulator.elf -ex "target remote localhost:1234"
|
||||
gdb-multiarch build/XiZi_cortex-m4-emulator.elf -ex "target remote localhost:1234"
|
||||
```
|
|
@ -71,26 +71,28 @@ $ sudo apt install build-essential pkg-config git
|
|||
$ sudo apt install gcc make libncurses5-dev openssl libssl-dev bison flex libelf-dev autoconf libtool gperf libc6-dev
|
||||
```
|
||||
|
||||
**XiUOS操作系统源码下载:** XiZi [https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos)
|
||||
**XiUOS操作系统源码下载:** XiZi [https://www.gitlink.org.cn/xuos/xiuos](https://www.gitlink.org.cn/xuos/xiuos)
|
||||
|
||||
新建一个空文件夹并进入文件夹中,并下载源码,具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir test && cd test
|
||||
git clone https://git.trustie.net/xuos/xiuos.git
|
||||
git clone https://gitlink.org.cn/xuos/xiuos.git
|
||||
```
|
||||
|
||||
打开源码文件包可以看到以下目录:
|
||||
|
||||
| 名称 | 说明 |
|
||||
| ----------- | ---------- |
|
||||
| application | 应用代码 |
|
||||
| board | 板级支持包 |
|
||||
| framework | 应用框架 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
1、打开XiUOS源码文件包可以看到以下目录:
|
||||
| ------------- | ------- |
|
||||
| APP_Framework | 应用代码 |
|
||||
| Ubiquitous | 板级支持包,支持NuttX、RT-Thread和XiZi内核 |
|
||||
2、打开XiZi内核源码文件包可以看到以下目录:
|
||||
| ------------- | --------|
|
||||
| arch | 架构代码 |
|
||||
| board | 板级支持包 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| lib | 第三方库源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
|
||||
使用VScode打开代码,具体操作步骤为:在源码文件夹下打开系统终端,输入`code .`即可打开VScode开发环境,如下图所示:
|
||||
|
||||
|
@ -102,18 +104,18 @@ git clone https://git.trustie.net/xuos/xiuos.git
|
|||
|
||||
裁减配置工具:
|
||||
|
||||
**工具地址:** kconfig-frontends [https://forgeplus.trustie.net/projects/xuos/kconfig-frontends](https://forgeplus.trustie.net/projects/xuos/kconfig-frontends),下载与安装的具体命令如下:
|
||||
**工具地址:** kconfig-frontends [https://www.gitlink.org.cn/xuos/kconfig-frontends](https://www.gitlink.org.cn/xuos/kconfig-frontends),下载与安装的具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir kfrontends && cd kfrontends
|
||||
git clone https://git.trustie.net/xuos/kconfig-frontends.git
|
||||
git clone https://gitlink.org.cn/xuos/kconfig-frontends.git
|
||||
```
|
||||
|
||||
下载源码后按以下步骤执行软件安装:
|
||||
|
||||
```c
|
||||
cd kconfig-frontends
|
||||
./xs_build.sh
|
||||
./xs_build.sh
|
||||
```
|
||||
|
||||
#### 编译工具链:
|
||||
|
@ -140,7 +142,9 @@ $ sudo apt install gcc-arm-none-eabi
|
|||
1.在VScode命令终端中执行以下命令,生成配置文件
|
||||
|
||||
```c
|
||||
make BOARD=cortex-m4-emulator menuconfig
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=cortex-m4-emulator distclean
|
||||
make BOARD=cortex-m4-emulator menuconfig
|
||||
```
|
||||
|
||||
2.在menuconfig界面配置需要关闭和开启的功能,按回车键进入下级菜单,按Y键选中需要开启的功能,按N键选中需要关闭的功能,配置结束后保存并退出(本例旨在演示简单的输出例程,所以没有需要配置的选项,双击快捷键ESC退出配置)
|
||||
|
@ -163,7 +167,7 @@ $ sudo apt install gcc-arm-none-eabi
|
|||
make BOARD=cortex-m4-emulator
|
||||
```
|
||||
|
||||
4.如果编译正确无误,会产生XiUOS_cortex-m4-emulator.elf、XiUOS_cortex-m4-emulator.bin文件。
|
||||
4.如果编译正确无误,会产生XiZi_cortex-m4-emulator.elf、XiZi_cortex-m4-emulator.bin文件。
|
||||
|
||||
|
||||
|
||||
|
@ -196,7 +200,7 @@ sudo apt install qemu-system-arm
|
|||
通过以下命令启动QEMU并加载XiUOS ELF文件
|
||||
|
||||
```
|
||||
qemu-system-arm -machine netduinoplus2 -nographic -kernel build/XiUOS_cortex-m4-emulator.elf
|
||||
qemu-system-arm -machine netduinoplus2 -nographic -kernel build/XiZi_cortex-m4-emulator.elf
|
||||
```
|
||||
|
||||
QEMU运行起来后将会在终端上看到信息打印输出
|
||||
|
@ -217,13 +221,13 @@ sudo apt install gdb-multiarch
|
|||
并通过以下命令启动QEMU
|
||||
|
||||
```
|
||||
qemu-system-arm -machine netduinoplus2 -nographic -kernel build/XiUOS_cortex-m4-emulator.elf -s -S
|
||||
qemu-system-arm -machine netduinoplus2 -nographic -kernel build/XiZi_cortex-m4-emulator.elf -s -S
|
||||
```
|
||||
|
||||
然后要重新开启另一个linux系统终端一个终端,执行`riscv-none-embed-gdb`命令
|
||||
|
||||
```
|
||||
gdb-multiarch build/XiUOS_cortex-m4-emulator.elf -ex "target remote localhost:1234"
|
||||
gdb-multiarch build/XiZi_cortex-m4-emulator.elf -ex "target remote localhost:1234"
|
||||
```
|
||||
|
||||
|
||||
|
|
|
@ -18,25 +18,28 @@ $ sudo apt install build-essential pkg-config
|
|||
$ sudo apt install gcc make libncurses5-dev openssl libssl-dev bison flex libelf-dev autoconf libtool gperf libc6-dev git
|
||||
```
|
||||
|
||||
**源码下载:** XiUOS [https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos)
|
||||
**源码下载:** XiUOS [https://www.gitlink.org.cn/xuos/xiuos](https://www.gitlink.org.cn/xuos/xiuos)
|
||||
|
||||
新建一个空文件夹并进入文件夹中,并下载源码,具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir test && cd test
|
||||
git clone https://git.trustie.net/xuos/xiuos.git
|
||||
git clone https://gitlink.org.cn/xuos/xiuos.git
|
||||
```
|
||||
|
||||
打开源码文件包可以看到以下目录:
|
||||
| 名称 | 说明 |
|
||||
| -- | -- |
|
||||
| application | 应用代码 |
|
||||
| board | 板级支持包 |
|
||||
| framework | 应用框架 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
1、打开XiUOS源码文件包可以看到以下目录:
|
||||
| ------------- | ------- |
|
||||
| APP_Framework | 应用代码 |
|
||||
| Ubiquitous | 板级支持包,支持NuttX、RT-Thread和XiZi内核 |
|
||||
2、打开XiZi内核源码文件包可以看到以下目录:
|
||||
| ------------- | --------|
|
||||
| arch | 架构代码 |
|
||||
| board | 板级支持包 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| lib | 第三方库源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
|
||||
使用VScode打开代码,具体操作步骤为:在源码文件夹下打开系统终端,输入`code .`即可打开VScode开发环境,如下图所示:
|
||||
|
||||
|
@ -46,18 +49,18 @@ git clone https://git.trustie.net/xuos/xiuos.git
|
|||
|
||||
裁减配置工具:
|
||||
|
||||
**工具地址:** kconfig-frontends [https://forgeplus.trustie.net/projects/xuos/kconfig-frontends](https://forgeplus.trustie.net/projects/xuos/kconfig-frontends)
|
||||
**工具地址:** kconfig-frontends [https://www.gitlink.org.cn/xuos/kconfig-frontends](https://www.gitlink.org.cn/xuos/kconfig-frontends)
|
||||
|
||||
```c
|
||||
mkdir kfrontends && cd kfrontends
|
||||
git clone https://git.trustie.net/xuos/kconfig-frontends.git
|
||||
git clone https://gitlink.org.cn/xuos/kconfig-frontends.git
|
||||
```
|
||||
|
||||
下载源码后按以下步骤执行软件安装:
|
||||
|
||||
```c
|
||||
cd kconfig-frontends
|
||||
./xs_build.sh
|
||||
./xs_build.sh
|
||||
```
|
||||
|
||||
### 编译工具链:
|
||||
|
@ -98,7 +101,7 @@ XiUOS板级当前支持使用UART。
|
|||
|
||||
使用`VScode`打开工程的方法有多种,本文介绍一种快捷键,在项目目录下将`code .`输入终端即可打开目标项目
|
||||
|
||||
修改`applications`文件夹下`main.c`
|
||||
修改`APP_Framework/Applications`文件夹下`main.c`
|
||||
|
||||
在输出函数中写入 Hello, world! \n 完成代码编辑。
|
||||
|
||||
|
@ -108,6 +111,8 @@ XiUOS板级当前支持使用UART。
|
|||
1.在VScode终端下执行以下命令,生成配置文件
|
||||
|
||||
```
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=gapuino distclean
|
||||
make BOARD=gapuino menuconfig
|
||||
```
|
||||
|
||||
|
@ -121,7 +126,7 @@ make BOARD=gapuino menuconfig
|
|||
make BOARD=gapuino
|
||||
```
|
||||
|
||||
4.如果编译正确无误,build文件夹下会产生XiUOS_gapuino.elf、XiUOS_gapuino.bin文件。
|
||||
4.如果编译正确无误,build文件夹下会产生XiZi_gapuino.elf、XiZi_gapuino.bin文件。
|
||||
|
||||
>注:最后可以执行以下命令,清除配置文件和编译生成的文件
|
||||
|
||||
|
@ -164,7 +169,7 @@ screen /dev/ttyUSB0 115200
|
|||
|
||||
5、打开一个新的终端,进入编译生成的elf路径,输入例如:
|
||||
```
|
||||
riscv32-unknown-elf-gdb build/XiUOS_gapuino.elf -ex "target remote localhost:3333"
|
||||
riscv32-unknown-elf-gdb build/XiZi_gapuino.elf -ex "target remote localhost:3333"
|
||||
```
|
||||
结果如下图所示:
|
||||

|
||||
|
|
|
@ -18,25 +18,28 @@ $ sudo apt install build-essential pkg-config
|
|||
$ sudo apt install gcc make libncurses5-dev openssl libssl-dev bison flex libelf-dev autoconf libtool gperf libc6-dev git
|
||||
```
|
||||
|
||||
**源码下载:** XiUOS [https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos)
|
||||
**源码下载:** XiUOS [https://www.gitlink.org.cn/xuos/xiuos](https://www.gitlink.org.cn/xuos/xiuos)
|
||||
|
||||
新建一个空文件夹并进入文件夹中,并下载源码,具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir test && cd test
|
||||
git clone https://git.trustie.net/xuos/xiuos.git
|
||||
git clone https://gitlink.org.cn/xuos/xiuos.git
|
||||
```
|
||||
|
||||
打开源码文件包可以看到以下目录:
|
||||
| 名称 | 说明 |
|
||||
| -- | -- |
|
||||
| application | 应用代码 |
|
||||
| board | 板级支持包 |
|
||||
| framework | 应用框架 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
1、打开XiUOS源码文件包可以看到以下目录:
|
||||
| ------------- | ------- |
|
||||
| APP_Framework | 应用代码 |
|
||||
| Ubiquitous | 板级支持包,支持NuttX、RT-Thread和XiZi内核 |
|
||||
2、打开XiZi内核源码文件包可以看到以下目录:
|
||||
| ------------- | --------|
|
||||
| arch | 架构代码 |
|
||||
| board | 板级支持包 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| lib | 第三方库源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
|
||||
使用VScode打开代码,具体操作步骤为:在源码文件夹下打开系统终端,输入`code .`即可打开VScode开发环境,如下图所示:
|
||||
|
||||
|
@ -46,18 +49,18 @@ git clone https://git.trustie.net/xuos/xiuos.git
|
|||
|
||||
裁减配置工具:
|
||||
|
||||
**工具地址:** kconfig-frontends [https://forgeplus.trustie.net/projects/xuos/kconfig-frontends](https://forgeplus.trustie.net/projects/xuos/kconfig-frontends)
|
||||
**工具地址:** kconfig-frontends [https://www.gitlink.org.cn/xuos/kconfig-frontends](https://www.gitlink.org.cn/xuos/kconfig-frontends)
|
||||
|
||||
```c
|
||||
mkdir kfrontends && cd kfrontends
|
||||
git clone https://git.trustie.net/xuos/kconfig-frontends.git
|
||||
git clone https://gitlink.org.cn/xuos/kconfig-frontends.git
|
||||
```
|
||||
|
||||
下载源码后按以下步骤执行软件安装:
|
||||
|
||||
```c
|
||||
cd kconfig-frontends
|
||||
./xs_build.sh
|
||||
./xs_build.sh
|
||||
```
|
||||
|
||||
### 编译工具链:
|
||||
|
@ -99,7 +102,7 @@ XiUOS板级当前支持使用UART。
|
|||
|
||||
使用`VScode`打开工程的方法有多种,本文介绍一种快捷键,在项目目录下将`code .`输入终端即可打开目标项目
|
||||
|
||||
修改`applications`文件夹下`main.c`
|
||||
修改`APP_Framework/Applications`文件夹下`main.c`
|
||||
|
||||
在输出函数中写入 Hello, world! \n 完成代码编辑。
|
||||
|
||||
|
@ -109,6 +112,8 @@ XiUOS板级当前支持使用UART。
|
|||
1.在VScode终端下执行以下命令,生成配置文件
|
||||
|
||||
```
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=gd32vf103_rvstar distclean
|
||||
make BOARD=gd32vf103_rvstar menuconfig
|
||||
```
|
||||
|
||||
|
@ -122,7 +127,7 @@ make BOARD=gd32vf103_rvstar menuconfig
|
|||
make BOARD=gd32vf103_rvstar
|
||||
```
|
||||
|
||||
4.如果编译正确无误,build文件夹下会产生XiUOS_gd32vf103_rvstar.elf、XiUOS_gd32vf103_rvstar.bin文件。
|
||||
4.如果编译正确无误,build文件夹下会产生XiZi_gd32vf103_rvstar.elf、XiZi_gd32vf103_rvstar.bin文件。
|
||||
|
||||
>注:最后可以执行以下命令,清除配置文件和编译生成的文件
|
||||
|
||||
|
@ -146,7 +151,7 @@ openocd安装完成以后,按照如下步骤进行调试:
|
|||
|
||||
1、进入xiuos目录路径下
|
||||
```
|
||||
cd ~/xiuos/Ubiquitous/XiUOS
|
||||
cd ~/xiuos/Ubiquitous/XiZi
|
||||
```
|
||||
|
||||
2、编译生成elf文件
|
||||
|
@ -169,7 +174,7 @@ screen /dev/ttyUSB0 115200
|
|||
|
||||
5、打开一个新的终端,进入编译生成的elf路径,输入例如:
|
||||
```
|
||||
riscv-nuclei-elf-gdb build/XiUOS_gd32vf103_rvstar.elf -ex "target remote localhost:3333"
|
||||
riscv-nuclei-elf-gdb build/XiZi_gd32vf103_rvstar.elf -ex "target remote localhost:3333"
|
||||
```
|
||||
结果如下图所示:
|
||||

|
||||
|
|
|
@ -33,25 +33,28 @@ $ sudo apt install build-essential pkg-config
|
|||
$ sudo apt install gcc make libncurses5-dev openssl libssl-dev bison flex libelf-dev autoconf libtool gperf libc6-dev git
|
||||
```
|
||||
|
||||
**XiUOS操作系统源码下载:** XiUOS [https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos)
|
||||
**XiUOS操作系统源码下载:** XiUOS [https://www.gitlink.org.cn/xuos/xiuos](https://www.gitlink.org.cn/xuos/xiuos)
|
||||
|
||||
新建一个空文件夹并进入文件夹中,并下载源码,具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir test && cd test
|
||||
git clone https://git.trustie.net/xuos/xiuos.git
|
||||
git clone https://gitlink.org.cn/xuos/xiuos.git
|
||||
```
|
||||
|
||||
打开源码文件包可以看到以下目录:
|
||||
| 名称 | 说明 |
|
||||
| -- | -- |
|
||||
| application | 应用代码 |
|
||||
| board | 板级支持包 |
|
||||
| framework | 应用框架 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
1、打开XiUOS源码文件包可以看到以下目录:
|
||||
| ------------- | ------- |
|
||||
| APP_Framework | 应用代码 |
|
||||
| Ubiquitous | 板级支持包,支持NuttX、RT-Thread和XiZi内核 |
|
||||
2、打开XiZi内核源码文件包可以看到以下目录:
|
||||
| ------------- | --------|
|
||||
| arch | 架构代码 |
|
||||
| board | 板级支持包 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| lib | 第三方库源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
|
||||
使用VScode打开代码,具体操作步骤为:在源码文件夹下打开系统终端,输入`code .`即可打开VScode开发环境,如下图所示:
|
||||
|
||||
|
@ -61,19 +64,19 @@ git clone https://git.trustie.net/xuos/xiuos.git
|
|||
|
||||
### 裁减配置工具的下载
|
||||
|
||||
**裁减配置工具:** kconfig-frontends [https://forgeplus.trustie.net/projects/xuos/kconfig-frontends](https://forgeplus.trustie.net/projects/xuos/kconfig-frontends)
|
||||
**裁减配置工具:** kconfig-frontends [https://www.gitlink.org.cn/xuos/kconfig-frontends](https://www.gitlink.org.cn/xuos/kconfig-frontends)
|
||||
执行以下命令下载配置工具:
|
||||
|
||||
```c
|
||||
mkdir kfrontends && cd kfrontends
|
||||
git clone https://git.trustie.net/xuos/kconfig-frontends.git
|
||||
git clone https://gitlink.org.cn/xuos/kconfig-frontends.git
|
||||
```
|
||||
|
||||
下载源码后按以下步骤执行软件安装:
|
||||
|
||||
```c
|
||||
cd kconfig-frontends
|
||||
./xs_build.sh
|
||||
./xs_build.sh
|
||||
```
|
||||
|
||||
### 编译工具链:
|
||||
|
@ -81,7 +84,7 @@ cd kconfig-frontends
|
|||
RISC-V: riscv-none-embed-,默认安装到Ubuntu的/opt/,下载源码并解压。[下载网址 http://101.36.126.201:8011/gnu-mcu-eclipse.tar.bz2](http://101.36.126.201:8011/gnu-mcu-eclipse.tar.bz2),下载完成后,执行以下命令:
|
||||
|
||||
```c
|
||||
sudo tar -xvjf gnu-mcu-eclipse.tar.bz2 -C /opt/
|
||||
sudo tar -xvjf gnu-mcu-eclipse.tar.bz2 -C /opt/
|
||||
```
|
||||
|
||||
在VScode中将上述解压的编译工具链的路径添加到board/hifive1-emulator/config.mk文件当中,操作如下:
|
||||
|
@ -97,6 +100,8 @@ export CROSS_COMPILE ?=/opt/gnu-mcu-eclipse/riscv-none-gcc/8.2.0-2.1-20190425-10
|
|||
1.在`VScode`的“命令终端”中执行以下命令,生成配置文件
|
||||
|
||||
```
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=hifive1-emulator distclean
|
||||
make BOARD=hifive1-emulator menuconfig
|
||||
```
|
||||
|
||||
|
@ -122,7 +127,7 @@ make BOARD=hifive1-emulator menuconfig
|
|||
make BOARD=hifive1-emulator
|
||||
```
|
||||
|
||||
4.如果编译正确无误,会在build目录下产生XiUOS_hifive1-emulator.elf、XiUOS_hifive1-emulator.bin文件。
|
||||
4.如果编译正确无误,会在build目录下产生XiZi_hifive1-emulator.elf、XiZi_hifive1-emulator.bin文件。
|
||||
|
||||
## 3. 运行
|
||||
|
||||
|
@ -145,7 +150,7 @@ sudo make install
|
|||
通过以下命令启动QEMU并加载XiUOS ELF文件
|
||||
|
||||
```
|
||||
qemu-system-riscv32 -nographic -machine sifive_e -kernel build/XiUOS_hifive1-emulator.elf
|
||||
qemu-system-riscv32 -nographic -machine sifive_e -kernel build/XiZi_hifive1-emulator.elf
|
||||
```
|
||||
|
||||
QEMU运行起来后将会在终端上看到信息打印输出
|
||||
|
@ -157,11 +162,11 @@ QEMU运行起来后将会在终端上看到信息打印输出
|
|||
利用QEMU可以方便的对XiUOS进行调试,首先通过以下命令启动QEMU
|
||||
|
||||
```
|
||||
qemu-system-riscv32 -nographic -machine sifive_e -kernel build/XiUOS_hifive1-emulator.elf -s -S
|
||||
qemu-system-riscv32 -nographic -machine sifive_e -kernel build/XiZi_hifive1-emulator.elf -s -S
|
||||
```
|
||||
|
||||
然后要重新开启另一个linux系统终端一个终端,执行`riscv-none-embed-gdb`命令
|
||||
|
||||
```
|
||||
riscv-none-embed-gdb build/XiUOS_hifive1-emulator.elf -ex "target remote localhost:1234"
|
||||
riscv-none-embed-gdb build/XiZi_hifive1-emulator.elf -ex "target remote localhost:1234"
|
||||
```
|
||||
|
|
|
@ -19,25 +19,28 @@ $ sudo apt install build-essential pkg-config
|
|||
$ sudo apt install gcc make libncurses5-dev openssl libssl-dev bison flex libelf-dev autoconf libtool gperf libc6-dev git
|
||||
```
|
||||
|
||||
**源码下载:** XiUOS [https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos)
|
||||
**源码下载:** XiUOS [https://www.gitlink.org.cn/xuos/xiuos](https://www.gitlink.org.cn/xuos/xiuos)
|
||||
|
||||
新建一个空文件夹并进入文件夹中,并下载源码,具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir test && cd test
|
||||
git clone https://git.trustie.net/xuos/xiuos.git
|
||||
git clone https://gitlink.org.cn/xuos/xiuos.git
|
||||
```
|
||||
|
||||
打开源码文件包可以看到以下目录:
|
||||
| 名称 | 说明 |
|
||||
| -- | -- |
|
||||
| application | 应用代码 |
|
||||
| board | 板级支持包 |
|
||||
| framework | 应用框架 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
1、打开XiUOS源码文件包可以看到以下目录:
|
||||
| ------------- | ------- |
|
||||
| APP_Framework | 应用代码 |
|
||||
| Ubiquitous | 板级支持包,支持NuttX、RT-Thread和XiZi内核 |
|
||||
2、打开XiZi内核源码文件包可以看到以下目录:
|
||||
| ------------- | --------|
|
||||
| arch | 架构代码 |
|
||||
| board | 板级支持包 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| lib | 第三方库源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
|
||||
使用VScode打开代码,具体操作步骤为:在源码文件夹下打开系统终端,输入`code .`即可打开VScode开发环境,如下图所示:
|
||||
|
||||
|
@ -49,11 +52,11 @@ git clone https://git.trustie.net/xuos/xiuos.git
|
|||
|
||||
裁减配置工具:
|
||||
|
||||
**工具地址:** kconfig-frontends [https://forgeplus.trustie.net/projects/xuos/kconfig-frontends](https://forgeplus.trustie.net/projects/xuos/kconfig-frontends)
|
||||
**工具地址:** kconfig-frontends [https://www.gitlink.org.cn/xuos/kconfig-frontends](https://www.gitlink.org.cn/xuos/kconfig-frontends)
|
||||
|
||||
```c
|
||||
mkdir kfrontends && cd kfrontends
|
||||
git clone https://git.trustie.net/xuos/kconfig-frontends.git
|
||||
git clone https://gitlink.org.cn/xuos/kconfig-frontends.git
|
||||
```
|
||||
|
||||
下载源码后按以下步骤执行软件安装:
|
||||
|
@ -101,7 +104,7 @@ XiUOS板级当前支持使用UART。
|
|||
|
||||
使用`VScode`打开工程的方法有多种,本文介绍一种快捷键,在项目目录下将`code .`输入终端即可打开目标项目
|
||||
|
||||
修改`applications`文件夹下`main.c`
|
||||
修改`APP_Framework/Applications`文件夹下`main.c`
|
||||
|
||||
在输出函数中写入 Hello, world! \n running on Hifive1 Rev B board完成代码编辑。
|
||||
|
||||
|
@ -112,6 +115,8 @@ XiUOS板级当前支持使用UART。
|
|||
1.在VScode终端下执行以下命令,生成配置文件
|
||||
|
||||
```
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=hifive1-rev-B distclean
|
||||
make BOARD=hifive1-rev-B menuconfig
|
||||
```
|
||||
|
||||
|
@ -125,7 +130,7 @@ make BOARD=hifive1-rev-B menuconfig
|
|||
make BOARD=hifive1-rev-B
|
||||
```
|
||||
|
||||
4.如果编译正确无误,build文件夹下会产生XiUOS_hifive1-rev-B.elf、XiUOS_hifive1-rev-B.bin文件。其中XiUOS_hifive1-rev-B.bin需要烧写到设备中进行运行。
|
||||
4.如果编译正确无误,build文件夹下会产生XiZi_hifive1-rev-B.elf、XiZi_hifive1-rev-B.bin文件。其中XiZi_hifive1-rev-B.bin需要烧写到设备中进行运行。
|
||||
|
||||
>注:最后可以执行以下命令,清除配置文件和编译生成的文件
|
||||
|
||||
|
|
|
@ -33,25 +33,28 @@ $ sudo apt install build-essential pkg-config
|
|||
$ sudo apt install gcc make libncurses5-dev openssl libssl-dev bison flex libelf-dev autoconf libtool gperf libc6-dev git
|
||||
```
|
||||
|
||||
**XiUOS操作系统源码下载:** XiUOS [https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos)
|
||||
**XiUOS操作系统源码下载:** XiUOS [https://www.gitlink.org.cn/xuos/xiuos](https://www.gitlink.org.cn/xuos/xiuos)
|
||||
|
||||
新建一个空文件夹并进入文件夹中,并下载源码,具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir test && cd test
|
||||
git clone https://git.trustie.net/xuos/xiuos.git
|
||||
git clone https://gitlink.org.cn/xuos/xiuos.git
|
||||
```
|
||||
|
||||
打开源码文件包可以看到以下目录:
|
||||
| 名称 | 说明 |
|
||||
| -- | -- |
|
||||
| application | 应用代码 |
|
||||
| board | 板级支持包 |
|
||||
| framework | 应用框架 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
1、打开XiUOS源码文件包可以看到以下目录:
|
||||
| ------------- | ------- |
|
||||
| APP_Framework | 应用代码 |
|
||||
| Ubiquitous | 板级支持包,支持NuttX、RT-Thread和XiZi内核 |
|
||||
2、打开XiZi内核源码文件包可以看到以下目录:
|
||||
| ------------- | --------|
|
||||
| arch | 架构代码 |
|
||||
| board | 板级支持包 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| lib | 第三方库源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
|
||||
使用VScode打开代码,具体操作步骤为:在源码文件夹下打开系统终端,输入`code .`即可打开VScode开发环境,如下图所示:
|
||||
|
||||
|
@ -59,12 +62,12 @@ git clone https://git.trustie.net/xuos/xiuos.git
|
|||
|
||||
### 裁减配置工具的下载
|
||||
|
||||
**裁减配置工具:** kconfig-frontends [https://forgeplus.trustie.net/projects/xuos/kconfig-frontends](https://forgeplus.trustie.net/projects/xuos/kconfig-frontends)
|
||||
**裁减配置工具:** kconfig-frontends [https://www.gitlink.org.cn/xuos/kconfig-frontends](https://www.gitlink.org.cn/xuos/kconfig-frontends)
|
||||
执行以下命令下载配置工具:
|
||||
|
||||
```c
|
||||
mkdir kfrontends && cd kfrontends
|
||||
git clone https://git.trustie.net/xuos/kconfig-frontends.git
|
||||
git clone https://gitlink.org.cn/xuos/kconfig-frontends.git
|
||||
```
|
||||
|
||||
下载源码后按以下步骤执行软件安装:
|
||||
|
@ -95,6 +98,8 @@ export CROSS_COMPILE ?=/opt/gnu-mcu-eclipse/riscv-none-gcc/8.2.0-2.1-20190425-10
|
|||
1.在`VScode`的“命令终端”中执行以下命令,生成配置文件
|
||||
|
||||
```
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=k210-emulator distclean
|
||||
make BOARD=k210-emulator menuconfig
|
||||
```
|
||||
|
||||
|
@ -120,7 +125,7 @@ make BOARD=k210-emulator menuconfig
|
|||
make BOARD=k210-emulator
|
||||
```
|
||||
|
||||
4.如果编译正确无误,会在build目录下产生XiUOS_k210-emulator.elf、XiUOS_k210-emulator.bin文件。
|
||||
4.如果编译正确无误,会在build目录下产生XiZi_k210-emulator.elf、XiZi_k210-emulator.bin文件。
|
||||
|
||||
## 3. 运行
|
||||
|
||||
|
@ -142,7 +147,7 @@ sudo make install
|
|||
通过以下命令启动QEMU并加载XiUOS ELF文件
|
||||
|
||||
```
|
||||
qemu-system-riscv64 -nographic -machine sifive_u -bios build/XiUOS_k210-emulator.elf
|
||||
qemu-system-riscv64 -nographic -machine sifive_u -bios build/XiZi_k210-emulator.elf
|
||||
```
|
||||
|
||||
QEMU运行起来后将会在终端上看到信息打印输出
|
||||
|
@ -154,11 +159,11 @@ QEMU运行起来后将会在终端上看到信息打印输出
|
|||
利用QEMU可以方便的对XiUOS进行调试,首先通过以下命令启动QEMU
|
||||
|
||||
```
|
||||
qemu-system-riscv64 -nographic -machine sifive_u -bios build/XiUOS_k210-emulator.elf -s -S
|
||||
qemu-system-riscv64 -nographic -machine sifive_u -bios build/XiZi_k210-emulator.elf -s -S
|
||||
```
|
||||
|
||||
然后要重新开启另一个linux系统终端一个终端,执行`riscv-none-embed-gdb`命令
|
||||
|
||||
```
|
||||
riscv-none-embed-gdb build/XiUOS_k210-emulator.elf -ex "target remote localhost:1234"
|
||||
riscv-none-embed-gdb build/XiZi_k210-emulator.elf -ex "target remote localhost:1234"
|
||||
```
|
||||
|
|
|
@ -18,24 +18,27 @@ $ sudo apt install build-essential pkg-config
|
|||
$ sudo apt install gcc make libncurses5-dev openssl libssl-dev bison flex libelf-dev autoconf libtool gperf libc6-dev git
|
||||
```
|
||||
|
||||
**源码下载:** XiUOS [https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos)
|
||||
**源码下载:** XiUOS [https://www.gitlink.org.cn/xuos/xiuos](https://www.gitlink.org.cn/xuos/xiuos)
|
||||
新建一个空文件夹并进入文件夹中,并下载源码,具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir test && cd test
|
||||
git clone https://git.trustie.net/xuos/xiuos.git
|
||||
git clone https://gitlink.org.cn/xuos/xiuos.git
|
||||
```
|
||||
|
||||
打开源码文件包可以看到以下目录:
|
||||
| 名称 | 说明 |
|
||||
| -- | -- |
|
||||
| application | 应用代码 |
|
||||
| board | 板级支持包 |
|
||||
| framework | 应用框架 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
1、打开XiUOS源码文件包可以看到以下目录:
|
||||
| ------------- | ------- |
|
||||
| APP_Framework | 应用代码 |
|
||||
| Ubiquitous | 板级支持包,支持NuttX、RT-Thread和XiZi内核 |
|
||||
2、打开XiZi内核源码文件包可以看到以下目录:
|
||||
| ------------- | --------|
|
||||
| arch | 架构代码 |
|
||||
| board | 板级支持包 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| lib | 第三方库源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
|
||||
使用VScode打开代码,具体操作步骤为:在源码文件夹下打开系统终端,输入`code .`即可打开VScode开发环境,如下图所示:
|
||||
|
||||
|
@ -44,19 +47,19 @@ git clone https://git.trustie.net/xuos/xiuos.git
|
|||
</div>
|
||||
|
||||
### 裁减配置工具的下载
|
||||
**裁减配置工具:** kconfig-frontends [https://forgeplus.trustie.net/projects/xuos/kconfig-frontends](https://forgeplus.trustie.net/projects/xuos/kconfig-frontends)
|
||||
**裁减配置工具:** kconfig-frontends [https://www.gitlink.org.cn/xuos/kconfig-frontends](https://www.gitlink.org.cn/xuos/kconfig-frontends)
|
||||
执行以下命令下载配置工具:
|
||||
|
||||
```c
|
||||
mkdir kfrontends && cd kfrontends
|
||||
git clone https://git.trustie.net/xuos/kconfig-frontends.git
|
||||
git clone https://gitlink.org.cn/xuos/kconfig-frontends.git
|
||||
```
|
||||
|
||||
下载源码后按以下步骤执行软件安装:
|
||||
|
||||
```c
|
||||
cd kconfig-frontends
|
||||
./xs_build.sh
|
||||
./xs_build.sh
|
||||
```
|
||||
|
||||
### 编译工具链:
|
||||
|
@ -98,7 +101,7 @@ XiUOS板级当前支持使用GPIO、I2C、LCD、RTC、SPI、Timer、UART、watch
|
|||
编译工具链:`riscv-none-embed-gcc`
|
||||
使用`VScode`打开工程的方法有多种,本文介绍一种快捷键,在项目目录下将`code .`输入终端即可打开目标项目
|
||||
|
||||
修改`applications`文件夹下`main.c`
|
||||
修改`APP_Framework/Applications`文件夹下`main.c`
|
||||
在输出函数中写入 Hello, world!!! \n Running on KD233完成代码编辑。
|
||||
|
||||

|
||||
|
@ -108,7 +111,9 @@ XiUOS板级当前支持使用GPIO、I2C、LCD、RTC、SPI、Timer、UART、watch
|
|||
1.在`VScode`的“命令终端”下执行以下命令,生成配置文件
|
||||
|
||||
```c
|
||||
make BOARD=kd233 menuconfig
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=kd233 distclean
|
||||
make BOARD=kd233 menuconfig
|
||||
```
|
||||
|
||||
2.在`menuconfig`界面配置需要关闭和开启的功能,按回车键进入下级菜单,按Y键选中需要开启的功能,按N键选中需要关闭的功能,配置结束后选择Exit保存并退出(本实验无需选择任何选项,所以双击ESC结束选择,继续操作即可)。
|
||||
|
@ -132,15 +137,15 @@ XiUOS板级当前支持使用GPIO、I2C、LCD、RTC、SPI、Timer、UART、watch
|
|||
3.继续在`VScode`的“命令终端”中执行以下命令,进行编译
|
||||
|
||||
```c
|
||||
make BOARD=kd233
|
||||
make BOARD=kd233
|
||||
```
|
||||
|
||||
4.如果编译正确无误,会在build文件夹下生成XiUOS_kd233.elf、XiUOS_kd233.bin文件。其中XiUOS_kd233.bin需要烧写到设备中进行运行。
|
||||
4.如果编译正确无误,会在build文件夹下生成XiZi_kd233.elf、XiZi_kd233.bin文件。其中XiZi_kd233.bin需要烧写到设备中进行运行。
|
||||
|
||||
>注:最后可以执行以下命令,清除配置文件和编译生成的文件
|
||||
|
||||
```c
|
||||
make BOARD=kd233 distclean
|
||||
make BOARD=kd233 distclean
|
||||
```
|
||||
|
||||
## 3. 烧写及执行
|
||||
|
@ -170,7 +175,7 @@ sudo pip2 install kflash
|
|||
代码根目录下执行K-Flash工具烧录,-p为USB端口号,视实际情况而定
|
||||
|
||||
```
|
||||
sudo kflash -t build/XiUOS_kd233.bin -p /dev/ttyUSB0
|
||||
sudo kflash -t build/XiZi_kd233.bin -p /dev/ttyUSB0
|
||||
```
|
||||
|
||||
### 3.1 运行结果
|
||||
|
|
|
@ -27,6 +27,8 @@ export CROSS_COMPILE ?=/opt/gnu-mcu-eclipse/riscv-none-gcc/8.2.0-2.1-20190425-10
|
|||
```
|
||||
>2.在代码根目录下执行以下命令,生成配置文件
|
||||
```
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=maix-go distclean
|
||||
make BOARD=maix-go menuconfig
|
||||
```
|
||||
>3.在menuconfig界面配置需要关闭和开启的功能,按回车键进入下级菜单,按Y键选中需要开启的功能,按N键选中需要关闭的功能,配置结束后选择Exit保存并退出
|
||||
|
@ -34,7 +36,7 @@ make BOARD=maix-go menuconfig
|
|||
```
|
||||
make BOARD=maix-go
|
||||
```
|
||||
>5.如果编译正确无误,会产生XiUOS_maix-go.elf、XiUOS_maix-go.bin文件。其中XiUOS_maix-go.bin需要烧写到设备中进行运行。
|
||||
>5.如果编译正确无误,会产生XiZi_maix-go.elf、XiZi_maix-go.bin文件。其中XiZi_maix-go.bin需要烧写到设备中进行运行。
|
||||
>注:最后可以执行以下命令,清除配置文件和编译生成的文件
|
||||
```
|
||||
make BOARD=maix-go distclean
|
||||
|
@ -62,7 +64,7 @@ sudo pip2 install kflash
|
|||
```
|
||||
代码根目录下执行K-Flash工具烧录,此时ls /dev/ttyUSB*会发现新增2个USB端口,烧录时选择后一个,例如此时新增的是/dev/ttyUSB0和/dev/ttyUSB1,选择/dev/ttyUSB1
|
||||
```
|
||||
kflash -t build/XiUOS_kd233.bin -p /dev/ttyUSB1
|
||||
kflash -t build/XiZi_kd233.bin -p /dev/ttyUSB1
|
||||
```
|
||||
### 3.1 运行结果
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# 从零开始构建矽璓工业物联操作系统:使用ARM架构的nuvoton-m2354
|
||||
|
||||
# ok1052-c
|
||||
# nuvoton-m2354
|
||||
|
||||
[XiUOS](http://xuos.io/) (X Industrial Ubiquitous Operating System) 矽璓XiUOS是一款面向智慧车间的工业物联网操作系统,主要由一个极简的微型实时操作系统内核和其上的工业物联框架构成,通过高效管理工业物联网设备、支撑工业物联应用,在生产车间内实现智能化的“感知环境、联网传输、知悉识别、控制调整”,促进以工业设备和工业控制系统为核心的人、机、物深度互联,帮助提升生产线的数字化和智能化水平。
|
||||
|
||||
|
@ -71,11 +71,19 @@ mkdir test && cd test
|
|||
git clone https://gitlink.org.cn/xuos/xiuos.git
|
||||
```
|
||||
|
||||
打开源码文件包可以看到以下目录:
|
||||
| 名称 | 说明 |
|
||||
| -- | -- |
|
||||
1、打开XiUOS源码文件包可以看到以下目录:
|
||||
| ------------- | ------- |
|
||||
| APP_Framework | 应用代码 |
|
||||
| Ubiquitous | 板级支持包,支持NuttX、RT-Thread和XiZi内核 |
|
||||
| Ubiquitous | 板级支持包,支持NuttX、RT-Thread和XiZi内核 |
|
||||
2、打开XiZi内核源码文件包可以看到以下目录:
|
||||
| ------------- | --------|
|
||||
| arch | 架构代码 |
|
||||
| board | 板级支持包 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| lib | 第三方库源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
|
||||
使用VScode打开代码,具体操作步骤为:在源码文件夹下打开系统终端,输入`code .`即可打开VScode开发环境,如下图所示:
|
||||
|
||||
|
@ -87,7 +95,7 @@ git clone https://gitlink.org.cn/xuos/xiuos.git
|
|||
|
||||
裁减配置工具:
|
||||
|
||||
**工具地址:** kconfig-frontends [https://forgeplus.trustie.net/projects/xuos/kconfig-frontends](https://forgeplus.trustie.net/projects/xuos/kconfig-frontends),下载与安装的具体命令如下:
|
||||
**工具地址:** kconfig-frontends [https://www.gitlink.org.cn/xuos/kconfig-frontends](https://www.gitlink.org.cn/xuos/kconfig-frontends),下载与安装的具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir kfrontends && cd kfrontends
|
||||
|
@ -122,9 +130,9 @@ ARM: gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi(`gcc 6.3.1 20170215
|
|||
1.在VScode命令终端中执行以下命令,生成配置文件
|
||||
|
||||
```c
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=nuvoton-m2354 distclean
|
||||
make BOARD=nuvoton-m2354 menuconfig
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=nuvoton-m2354 distclean
|
||||
make BOARD=nuvoton-m2354 menuconfig
|
||||
```
|
||||
|
||||
2.在menuconfig界面配置需要关闭和开启的功能,按回车键进入下级菜单,按Y键选中需要开启的功能,按N键选中需要关闭的功能,配置结束后保存并退出(本例旨在演示简单的输出例程,所以没有需要配置的选项,双击快捷键ESC退出配置)
|
||||
|
|
|
@ -61,25 +61,28 @@ $ sudo apt install build-essential pkg-config git
|
|||
$ sudo apt install gcc make libncurses5-dev openssl libssl-dev bison flex libelf-dev autoconf libtool gperf libc6-dev
|
||||
```
|
||||
|
||||
**XiUOS操作系统源码下载:** XiUOS [https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos)
|
||||
**XiUOS操作系统源码下载:** XiUOS [https://www.gitlink.org.cn/xuos/xiuos](https://www.gitlink.org.cn/xuos/xiuos)
|
||||
|
||||
新建一个空文件夹并进入文件夹中,并下载源码,具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir test && cd test
|
||||
git clone https://git.trustie.net/xuos/xiuos.git
|
||||
git clone https://gitlink.org.cn/xuos/xiuos.git
|
||||
```
|
||||
|
||||
打开源码文件包可以看到以下目录:
|
||||
| 名称 | 说明 |
|
||||
| -- | -- |
|
||||
| application | 应用代码 |
|
||||
| board | 板级支持包 |
|
||||
| framework | 应用框架 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
1、打开XiUOS源码文件包可以看到以下目录:
|
||||
| ------------- | ------- |
|
||||
| APP_Framework | 应用代码 |
|
||||
| Ubiquitous | 板级支持包,支持NuttX、RT-Thread和XiZi内核 |
|
||||
2、打开XiZi内核源码文件包可以看到以下目录:
|
||||
| ------------- | --------|
|
||||
| arch | 架构代码 |
|
||||
| board | 板级支持包 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| lib | 第三方库源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
|
||||
使用VScode打开代码,具体操作步骤为:在源码文件夹下打开系统终端,输入`code .`即可打开VScode开发环境,如下图所示:
|
||||
|
||||
|
@ -91,18 +94,18 @@ git clone https://git.trustie.net/xuos/xiuos.git
|
|||
|
||||
裁减配置工具:
|
||||
|
||||
**工具地址:** kconfig-frontends [https://forgeplus.trustie.net/projects/xuos/kconfig-frontends](https://forgeplus.trustie.net/projects/xuos/kconfig-frontends),下载与安装的具体命令如下:
|
||||
**工具地址:** kconfig-frontends [https://www.gitlink.org.cn/xuos/kconfig-frontends](https://www.gitlink.org.cn/xuos/kconfig-frontends),下载与安装的具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir kfrontends && cd kfrontends
|
||||
git clone https://git.trustie.net/xuos/kconfig-frontends.git
|
||||
git clone https://gitlink.org.cn/xuos/kconfig-frontends.git
|
||||
```
|
||||
|
||||
下载源码后按以下步骤执行软件安装:
|
||||
|
||||
```c
|
||||
cd kconfig-frontends
|
||||
./xs_build.sh
|
||||
./xs_build.sh
|
||||
```
|
||||
|
||||
### 编译工具链:
|
||||
|
@ -126,7 +129,9 @@ $ sudo apt install gcc-arm-none-eabi
|
|||
1.在VScode命令终端中执行以下命令,生成配置文件
|
||||
|
||||
```c
|
||||
make BOARD=ok1052-c menuconfig
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=ok1052-c distclean
|
||||
make BOARD=ok1052-c menuconfig
|
||||
```
|
||||
|
||||
2.在menuconfig界面配置需要关闭和开启的功能,按回车键进入下级菜单,按Y键选中需要开启的功能,按N键选中需要关闭的功能,配置结束后保存并退出(本例旨在演示简单的输出例程,所以没有需要配置的选项,双击快捷键ESC退出配置)
|
||||
|
@ -143,7 +148,7 @@ $ sudo apt install gcc-arm-none-eabi
|
|||
make BOARD=ok1052-c
|
||||
```
|
||||
|
||||
4.如果编译正确无误,会产生XiUOS_ok1052-c.elf、XiUOS_ok1052-c.bin文件。
|
||||
4.如果编译正确无误,会产生XiZi_ok1052-c.elf、XiZi_ok1052-c.bin文件。
|
||||
|
||||
## 3. 烧写及运行
|
||||
|
||||
|
@ -153,7 +158,7 @@ make BOARD=ok1052-c
|
|||
2、ok1052-c开发板支持micro usb口烧写程序,打开NXP MCU Boot Utility后,选择好芯片类型为i.MXRT105x,开发板上电,使用usb线将开发板和PC连接,拨码开关设置为1 on 2 on 3 off 4 off,按下复位键K1后,若连接成功,可见Vendor ID和Product ID均有数字显示,点击reconnect,等待NXP MCU Boot Utility中红色显示变成蓝色显示,则表示已正确识别并连接到了开发板。如下图所示:
|
||||

|
||||
|
||||
3、选择编译生成的XiUOS_ok1052-c.elf文件路径,并选择.out(elf) from GCC ARM烧写选项,最后点击ALL-In-One Action即可烧写程序,若烧写无误,则下列绿色进度条会执行到底。如下图所示:
|
||||
3、选择编译生成的XiZi_ok1052-c.elf文件路径,并选择.out(elf) from GCC ARM烧写选项,最后点击ALL-In-One Action即可烧写程序,若烧写无误,则下列绿色进度条会执行到底。如下图所示:
|
||||

|
||||
|
||||
### 3.2 运行结果
|
||||
|
|
|
@ -18,25 +18,28 @@ $ sudo apt install build-essential pkg-config
|
|||
$ sudo apt install gcc make libncurses5-dev openssl libssl-dev bison flex libelf-dev autoconf libtool gperf libc6-dev git
|
||||
```
|
||||
|
||||
**源码下载:** XiUOS [https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos)
|
||||
**源码下载:** XiUOS [https://www.gitlink.org.cn/xuos/xiuos](https://www.gitlink.org.cn/xuos/xiuos)
|
||||
|
||||
新建一个空文件夹并进入文件夹中,并下载源码,具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir test && cd test
|
||||
git clone https://git.trustie.net/xuos/xiuos.git
|
||||
git clone https://gitlink.org.cn/xuos/xiuos.git
|
||||
```
|
||||
|
||||
打开源码文件包可以看到以下目录:
|
||||
| 名称 | 说明 |
|
||||
| -- | -- |
|
||||
| application | 应用代码 |
|
||||
| board | 板级支持包 |
|
||||
| framework | 应用框架 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
1、打开XiUOS源码文件包可以看到以下目录:
|
||||
| ------------- | ------- |
|
||||
| APP_Framework | 应用代码 |
|
||||
| Ubiquitous | 板级支持包,支持NuttX、RT-Thread和XiZi内核 |
|
||||
2、打开XiZi内核源码文件包可以看到以下目录:
|
||||
| ------------- | --------|
|
||||
| arch | 架构代码 |
|
||||
| board | 板级支持包 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| lib | 第三方库源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
|
||||
使用VScode打开代码,具体操作步骤为:在源码文件夹下打开系统终端,输入`code .`即可打开VScode开发环境,如下图所示:
|
||||
|
||||
|
@ -46,18 +49,18 @@ git clone https://git.trustie.net/xuos/xiuos.git
|
|||
|
||||
裁减配置工具:
|
||||
|
||||
**工具地址:** kconfig-frontends [https://forgeplus.trustie.net/projects/xuos/kconfig-frontends](https://forgeplus.trustie.net/projects/xuos/kconfig-frontends)
|
||||
**工具地址:** kconfig-frontends [https://www.gitlink.org.cn/xuos/kconfig-frontends](https://www.gitlink.org.cn/xuos/kconfig-frontends)
|
||||
|
||||
```c
|
||||
mkdir kfrontends && cd kfrontends
|
||||
git clone https://git.trustie.net/xuos/kconfig-frontends.git
|
||||
git clone https://gitlink.org.cn/xuos/kconfig-frontends.git
|
||||
```
|
||||
|
||||
下载源码后按以下步骤执行软件安装:
|
||||
|
||||
```c
|
||||
cd kconfig-frontends
|
||||
./xs_build.sh
|
||||
./xs_build.sh
|
||||
```
|
||||
|
||||
### 编译工具链:
|
||||
|
@ -97,7 +100,7 @@ XiUOS板级当前支持使用UART。
|
|||
|
||||
使用`VScode`打开工程的方法有多种,本文介绍一种快捷键,在项目目录下将`code .`输入终端即可打开目标项目
|
||||
|
||||
修改`applications`文件夹下`main.c`
|
||||
修改`APP_Framework/Applications`文件夹下`main.c`
|
||||
|
||||
在输出函数中写入 Hello, world! \n 完成代码编辑。
|
||||
|
||||
|
@ -107,6 +110,8 @@ XiUOS板级当前支持使用UART。
|
|||
1.在VScode终端下执行以下命令,生成配置文件
|
||||
|
||||
```
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=rm32v1_vega distclean
|
||||
make BOARD=rm32v1_vega menuconfig
|
||||
```
|
||||
|
||||
|
@ -120,7 +125,7 @@ make BOARD=rm32v1_vega menuconfig
|
|||
make BOARD=rv32m1_vega
|
||||
```
|
||||
|
||||
4.如果编译正确无误,build文件夹下会产生XiUOS_rv32m1_vega.elf、XiUOS_rv32m1_vega.bin文件。
|
||||
4.如果编译正确无误,build文件夹下会产生XiZi_rv32m1_vega.elf、XiZi_rv32m1_vega.bin文件。
|
||||
|
||||
>注:最后可以执行以下命令,清除配置文件和编译生成的文件
|
||||
|
||||
|
@ -168,7 +173,7 @@ screen /dev/ttyUSB0 115200
|
|||
|
||||
5、打开一个新的终端,进入编译生成的elf路径,输入例如:
|
||||
```
|
||||
riscv-none-embed-gdb build/XiUOS_rv32m1_vega.elf -ex "target remote localhost:3333"
|
||||
riscv-none-embed-gdb build/XiZi_rv32m1_vega.elf -ex "target remote localhost:3333"
|
||||
```
|
||||
结果如下图所示:
|
||||

|
||||
|
|
|
@ -47,25 +47,28 @@ $ sudo apt install build-essential pkg-config git
|
|||
$ sudo apt install gcc make libncurses5-dev openssl libssl-dev bison flex libelf-dev autoconf libtool gperf libc6-dev
|
||||
```
|
||||
|
||||
**XiUOS操作系统源码下载:** XiUOS [https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos)
|
||||
**XiUOS操作系统源码下载:** XiUOS [https://www.gitlink.org.cn/xuos/xiuos](https://www.gitlink.org.cn/xuos/xiuos)
|
||||
|
||||
新建一个空文件夹并进入文件夹中,并下载源码,具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir test && cd test
|
||||
git clone https://git.trustie.net/xuos/xiuos.git
|
||||
git clone https://gitlink.org.cn/xuos/xiuos.git
|
||||
```
|
||||
|
||||
打开源码文件包可以看到以下目录:
|
||||
| 名称 | 说明 |
|
||||
| -- | -- |
|
||||
| application | 应用代码 |
|
||||
| board | 板级支持包 |
|
||||
| framework | 应用框架 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
1、打开XiUOS源码文件包可以看到以下目录:
|
||||
| ------------- | ------- |
|
||||
| APP_Framework | 应用代码 |
|
||||
| Ubiquitous | 板级支持包,支持NuttX、RT-Thread和XiZi内核 |
|
||||
2、打开XiZi内核源码文件包可以看到以下目录:
|
||||
| ------------- | --------|
|
||||
| arch | 架构代码 |
|
||||
| board | 板级支持包 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| lib | 第三方库源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
|
||||
使用VScode打开代码,具体操作步骤为:在源码文件夹下打开系统终端,输入`code .`即可打开VScode开发环境,如下图所示:
|
||||
|
||||
|
@ -77,18 +80,18 @@ git clone https://git.trustie.net/xuos/xiuos.git
|
|||
|
||||
裁减配置工具:
|
||||
|
||||
**工具地址:** kconfig-frontends [https://forgeplus.trustie.net/projects/xuos/kconfig-frontends](https://forgeplus.trustie.net/projects/xuos/kconfig-frontends),下载与安装的具体命令如下:
|
||||
**工具地址:** kconfig-frontends [https://www.gitlink.org.cn/xuos/kconfig-frontends](https://www.gitlink.org.cn/xuos/kconfig-frontends),下载与安装的具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir kfrontends && cd kfrontends
|
||||
git clone https://git.trustie.net/xuos/kconfig-frontends.git
|
||||
git clone https://gitlink.org.cn/xuos/kconfig-frontends.git
|
||||
```
|
||||
|
||||
下载源码后按以下步骤执行软件安装:
|
||||
|
||||
```c
|
||||
cd kconfig-frontends
|
||||
./xs_build.sh
|
||||
./xs_build.sh
|
||||
```
|
||||
|
||||
### 编译工具链:
|
||||
|
@ -132,8 +135,9 @@ XiUOS板级驱动当前支持使用GPIO、UART。
|
|||
1.在VScode命令终端中执行以下命令,生成配置文件。
|
||||
|
||||
```c
|
||||
make BOARD=stm32f103-nano distclean
|
||||
make BOARD=stm32f103-nano menuconfig
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=stm32f103-nano distclean
|
||||
make BOARD=stm32f103-nano menuconfig
|
||||
```
|
||||
|
||||
2.在menuconfig界面配置需要关闭和开启的功能,按回车键进入下级菜单,按Y键选中需要开启的功能,按N键选中需要关闭的功能,配置结束后保存并退出(本例旨在演示简单的输出例程,所以没有需要配置的选项,双击快捷键ESC退出配置)。
|
||||
|
@ -184,7 +188,7 @@ XiUOS板级驱动当前支持使用GPIO、UART。
|
|||
make BOARD=stm32f103-nano
|
||||
```
|
||||
|
||||
5.如果编译正确无误,会产生XiUOS_stm32f103-nano.elf、XiUOS_stm32f103-nano.bin文件。其中XiUOS_stm32f103-nano.bin需要烧写到设备中进行运行。
|
||||
5.如果编译正确无误,会产生XiZi_stm32f103-nano.elf、XiZi_stm32f103-nano.bin文件。其中XiZi_stm32f103-nano.bin需要烧写到设备中进行运行。
|
||||
|
||||
## 3. 烧写及执行
|
||||
|
||||
|
@ -212,7 +216,7 @@ cd build/Release && make install DESTDIR=_install
|
|||
代码根目录下执行st-flash工具烧录
|
||||
|
||||
```
|
||||
sudo st-flash write build/XiUOS_stm32f103-nano.bin 0x8000000
|
||||
sudo st-flash write build/XiZi_stm32f103-nano.bin 0x8000000
|
||||
```
|
||||
|
||||
### 3.1 运行结果
|
||||
|
|
|
@ -49,25 +49,28 @@ $ sudo apt install build-essential pkg-config git
|
|||
$ sudo apt install gcc make libncurses5-dev openssl libssl-dev bison flex libelf-dev autoconf libtool gperf libc6-dev
|
||||
```
|
||||
|
||||
**XiUOS操作系统源码下载:** XiUOS [https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos)
|
||||
**XiUOS操作系统源码下载:** XiUOS [https://www.gitlink.org.cn/xuos/xiuos](https://www.gitlink.org.cn/xuos/xiuos)
|
||||
|
||||
新建一个空文件夹并进入文件夹中,并下载源码,具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir test && cd test
|
||||
git clone https://git.trustie.net/xuos/xiuos.git
|
||||
git clone https://gitlink.org.cn/xuos/xiuos.git
|
||||
```
|
||||
|
||||
打开源码文件包可以看到以下目录:
|
||||
| 名称 | 说明 |
|
||||
| -- | -- |
|
||||
| application | 应用代码 |
|
||||
| board | 板级支持包 |
|
||||
| framework | 应用框架 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
1、打开XiUOS源码文件包可以看到以下目录:
|
||||
| ------------- | ------- |
|
||||
| APP_Framework | 应用代码 |
|
||||
| Ubiquitous | 板级支持包,支持NuttX、RT-Thread和XiZi内核 |
|
||||
2、打开XiZi内核源码文件包可以看到以下目录:
|
||||
| ------------- | --------|
|
||||
| arch | 架构代码 |
|
||||
| board | 板级支持包 |
|
||||
| fs | 文件系统 |
|
||||
| kernel | 内核源码 |
|
||||
| lib | 第三方库源码 |
|
||||
| resources | 驱动文件 |
|
||||
| tool | 系统工具 |
|
||||
|
||||
使用VScode打开代码,具体操作步骤为:在源码文件夹下打开系统终端,输入`code .`即可打开VScode开发环境,如下图所示:
|
||||
|
||||
|
@ -79,18 +82,18 @@ git clone https://git.trustie.net/xuos/xiuos.git
|
|||
|
||||
裁减配置工具:
|
||||
|
||||
**工具地址:** kconfig-frontends [https://forgeplus.trustie.net/projects/xuos/kconfig-frontends](https://forgeplus.trustie.net/projects/xuos/kconfig-frontends),下载与安装的具体命令如下:
|
||||
**工具地址:** kconfig-frontends [https://www.gitlink.org.cn/xuos/kconfig-frontends](https://www.gitlink.org.cn/xuos/kconfig-frontends),下载与安装的具体命令如下:
|
||||
|
||||
```c
|
||||
mkdir kfrontends && cd kfrontends
|
||||
git clone https://git.trustie.net/xuos/kconfig-frontends.git
|
||||
git clone https://gitlink.org.cn/xuos/kconfig-frontends.git
|
||||
```
|
||||
|
||||
下载源码后按以下步骤执行软件安装:
|
||||
|
||||
```c
|
||||
cd kconfig-frontends
|
||||
./xs_build.sh
|
||||
./xs_build.sh
|
||||
```
|
||||
|
||||
### 编译工具链:
|
||||
|
@ -124,7 +127,7 @@ XiUOS板级驱动当前支持使用GPIO、I2C、LCD、USB、RTC、SPI、Timer、
|
|||
### 编译工具链:`arm-none-eabi-gcc`
|
||||
使用`VScode`打开工程的方法有多种,本文介绍一种快捷键,在项目目录下将`code .`输入linux系统命令终端即可打开目标项目
|
||||
|
||||
修改`applications`文件夹下`main.c`
|
||||
修改`APP_Framework/Applications`文件夹下`main.c`
|
||||
在输出函数中写入 `Hello, world!!! \n Running on stm32f407-st-discovery`完成代码编辑。
|
||||
|
||||

|
||||
|
@ -134,7 +137,9 @@ XiUOS板级驱动当前支持使用GPIO、I2C、LCD、USB、RTC、SPI、Timer、
|
|||
1.在VScode命令终端中执行以下命令,生成配置文件
|
||||
|
||||
```c
|
||||
make BOARD=stm32f407-st-discovery menuconfig
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=stm32f407-st-discovery distclean
|
||||
make BOARD=stm32f407-st-discovery menuconfig
|
||||
```
|
||||
|
||||
2.在menuconfig界面配置需要关闭和开启的功能,按回车键进入下级菜单,按Y键选中需要开启的功能,按N键选中需要关闭的功能,配置结束后保存并退出(本例旨在演示简单的输出例程,所以没有需要配置的选项,双击快捷键ESC退出配置)
|
||||
|
@ -151,7 +156,7 @@ XiUOS板级驱动当前支持使用GPIO、I2C、LCD、USB、RTC、SPI、Timer、
|
|||
make BOARD=stm32f407-st-discovery
|
||||
```
|
||||
|
||||
4.如果编译正确无误,会产生XiUOS_stm32f407-st-discovery.elf、XiUOS_stm32f407-st-discovery.bin文件。其中XiUOS_stm32f407-st-discovery.bin需要烧写到设备中进行运行。
|
||||
4.如果编译正确无误,会产生XiZi_stm32f407-st-discovery.elf、XiZi_stm32f407-st-discovery.bin文件。其中XiZi_stm32f407-st-discovery.bin需要烧写到设备中进行运行。
|
||||
|
||||
## 3. 烧写及执行
|
||||
|
||||
|
@ -170,7 +175,7 @@ ARM:ST-LINK(ST-LINK V2实物如图,可在购物网站搜索关键字购买
|
|||
```
|
||||
sudo apt install libusb-dev
|
||||
sudo apt install libusb-1.0-0-dev
|
||||
sudo apt install cmake
|
||||
sudo apt install cmake
|
||||
cd stlink
|
||||
make
|
||||
cd build/Release && make install DESTDIR=_install
|
||||
|
@ -181,13 +186,13 @@ cd build/Release && make install DESTDIR=_install
|
|||
代码根目录下执行st-flash工具烧录
|
||||
|
||||
```
|
||||
sudo st-flash write build/XiUOS_stm32f407-st-discovery.bin 0x8000000
|
||||
sudo st-flash write build/XiZi_stm32f407-st-discovery.bin 0x8000000
|
||||
```
|
||||
|
||||
此外,推荐用户使用putty作为终端工具,安装命令如下:
|
||||
|
||||
```c
|
||||
sudo apt install putty
|
||||
sudo apt install putty
|
||||
```
|
||||
|
||||
打开putty配置串口信息
|
||||
|
@ -203,7 +208,7 @@ sudo puty
|
|||
注意:选择正确的终端端口号,最后可以执行以下命令,清除配置文件和编译生成的文件
|
||||
|
||||
```c
|
||||
make BOARD=stm32f407-st-discovery distclean
|
||||
make BOARD=stm32f407-st-discovery distclean
|
||||
```
|
||||
|
||||
### 3.1 运行结果
|
||||
|
|
|
@ -29,23 +29,25 @@ sudo apt-get install gcc-arm-none-eabi
|
|||
>2.在代码根目录下执行以下命令,生成配置文件
|
||||
|
||||
```
|
||||
cd ./Ubiquitous/XiZi
|
||||
make BOARD=stm32f407zgt6 distclean
|
||||
make BOARD=stm32f407zgt6 menuconfig
|
||||
```
|
||||
>3.在menuconfig界面配置需要关闭和开启的功能,按回车键进入下级菜单,按Y键选中需要开启的功能,按N键选中需要关闭的功能,配置结束后保存并退出
|
||||
|
||||

|
||||

|
||||
|
||||
>4.继续执行以下命令,进行编译
|
||||
```
|
||||
make BOARD=stm32f407zgt6
|
||||
```
|
||||
>5.如果编译正确无误,会产生XiUOS_stm32f407zgt6.elf、XiUOS_stm32f407zgt6.bin文件。其中XiUOS_stm32f407zgt6.bin需要烧写到设备中进行运行。
|
||||
>5.如果编译正确无误,会产生XiZi_stm32f407zgt6.elf、XiZi_stm32f407zgt6.bin文件。其中XiZi_stm32f407zgt6.bin需要烧写到设备中进行运行。
|
||||
```
|
||||
sudo write build/XiUOS_stm32f407zgt6.bin 0x8000000
|
||||
sudo write build/XiZi_stm32f407zgt6.bin 0x8000000
|
||||
```
|
||||
>6.最后可以执行以下命令,清除配置文件和编译生成的文件
|
||||
```
|
||||
make BOARD=stm32f407zgt6 distclean
|
||||
make BOARD=stm32f407zgt6 distclean
|
||||
```
|
||||
|
||||
## 3. 烧写及执行
|
||||
|
@ -59,21 +61,21 @@ git clone https://github.com/texane/stlink.git
|
|||
|
||||
开发板接口如下:
|
||||
<div align= "center">
|
||||
<img src = interface.jpg width =50%>
|
||||
<img src = ./img/interface.jpg width =50%>
|
||||
</div>
|
||||
|
||||
实际连接图为:
|
||||
<div align= "center">
|
||||
<img src = total.jpg width =50%>
|
||||
<img src = ./img/total.jpg width =50%>
|
||||
</div>
|
||||
|
||||
在代码根目录下执行st-flash工具烧录
|
||||
```
|
||||
sudo st-flash write build/XiUOS_stm32f407zgt6.bin 0x8000000
|
||||
sudo st-flash write build/XiZi_stm32f407zgt6.bin 0x8000000
|
||||
```
|
||||
### 3.1 运行结果
|
||||
|
||||
如果编译 & 烧写无误,将会在串口终端上看到信息打印输出,(终端串口引脚为PB6、PB7)。
|
||||
<div align= "center">
|
||||
<img src = shell.png >
|
||||
<img src = ./img/shell.png >
|
||||
</div>
|
||||
|
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 122 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 104 KiB |