xuos-web/docs/doc/constructenv/goujian.md

94 lines
3.8 KiB
Markdown
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 编译步骤
## 前言
<el-divider></el-divider>
<p style="text-indent:2em">本文档将介绍<B>XiUOS</B>分别在基于ARM和RISC-V架构的开发板上的编译、烧录和运行的过程。包括开发板选择及配置初始化、编译命令等信息。
</p>
## 开发板的选择及配置初始化
<el-divider></el-divider>
<p style="text-indent:2em">在执行编译之前,我们需要先确定<B>XiUOS</B>系统要运行在哪个开发板上,然后针对具体的开发板设置相关的配置信息。</p>
+ 开发板的选择
为了查看<B>XiUOS</B>支持的开发板种类,可以执行以下命令,也可以[查看支持的开发板](/hardwaresupport/arm32/stm32f407-st-discovery.html)。
$ make BOARD=list
+ 配置初始化
+ 以stm32f407-st-discovery为例进行开始系统参数。
$ make BOARD=stm32f407-st-discovery menuconfig
<img src="https://raw.githubusercontent.com/yanyannew/images/branch/stm32_menuconfig.png" />
对应的配置信息将存放在board/stm32f407-st-discovery/xsconfig.h头文件中文件中的选项均以<B>XS_</B>为前缀开头。
+ 以kd233为例进行开始系统参数。
$ make BOARD=KD233 menuconfig
<img src="https://raw.githubusercontent.com/yanyannew/images/branch/kd233_menuconfig.png" />
对应的配置信息将存放在board/kd233/xsconfig.h头文件中文件中的选项均以<B>XS_</B>为前缀开头。
## 编译命令
通用编译命令, 默认为BOARD=KD233
$ make [BOARD=<所选开发板>]
+ 当 make 命令被执行时它会扫描当前目录下Makefile或makefile文件找到目标以及其依赖。如果这些依赖自身也是目标继续为这些依赖扫描Makefile 建立其依赖关系,然后编译它们。
+ 创建build目录目录下包含了各种目标文件、.bin、.elf等文件
+ 目标文件,以.o结尾的文件
+ .bin 二进制文件
+ .elf 可执行文件
## 烧录命令
+ 基于ARM开发板的烧录命令
$ sudo st-flash write <生成的.elf文件> 0x8000000
+ 基于RISC-V开发板的烧录命令
$ sudo kflash <生成的.elf文件> -t
## 运行界面
+ <B>XiUOS</B>运行在ARM开发板
<img src="https://raw.githubusercontent.com/yanyannew/images/branch/stm32_run_gui.png" />
+ <B>XiUOS</B>运行在RISC-V开发板
<img src="https://raw.githubusercontent.com/yanyannew/images/branch/riscv_run_gui.png" />
## FAQ
<el-collapse v-model="activeName" accordion>
<el-collapse-item title="Question 1: XiUOS源码下载起来特别慢怎么办" name="1">
> 尝试借助gitee下载源码
</el-collapse-item>
<el-collapse-item title="Question 2: 编程过程是xxx错误" name="2">
> * Operation feedback: enable the users to clearly perceive their operations by style updates and interactive effects;
> * Visual feedback: reflect current state by updating or rearranging elements of the page.
</el-collapse-item>
<el-collapse-item title="Question 3" name="3">
> * Simplify the process: keep operating process simple and intuitive;
> * Definite and clear: enunciate your intentions clearly so that the users can quickly understand and make decisions;
> * Easy to identify: the interface should be straightforward, which helps the users to identify and frees them from memorizing and recalling.
</el-collapse-item>
<el-collapse-item title="Question 4" name="4">
> * Decision making: giving advices about operations is acceptable, but do not make decisions for the users;
> * Controlled consequences: users should be granted the freedom to operate, including canceling, aborting or terminating current operation.
</el-collapse-item>
</el-collapse>
<script>
export default {
data() {
return {
activeName: '1'
};
}
}
</script>