|
@ -2,10 +2,4 @@
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
* [开发板](/doc/appdev/board)
|
* [从零开始构建矽璓工业物联操作系统](/doc/appdev/start_from_scratch)
|
||||||
|
|
||||||
* [开发环境](/doc/appdev/env.md)
|
|
||||||
|
|
||||||
* [调试工具](/doc/appdev/debug.md)
|
|
||||||
|
|
||||||
* [开发过程](/doc/appdev/dev.md)
|
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
# 开发板
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## ARM
|
|
||||||
|
|
||||||
* [STM32F407-ST-DISCOVERY](/doc/appdev/board/stm32f407-st-discovery.md)
|
|
||||||
|
|
||||||
* [STM32F407ZGT6](/doc/appdev/board/stm32f407zgt6.md)
|
|
||||||
|
|
||||||
## RISC-V
|
|
||||||
|
|
||||||
* [HIFIVE1-REV-B](/doc/appdev/board/hifive1-rev.md)
|
|
||||||
|
|
||||||
* [MAXGO](/doc/appdev/board/maxgo.md)
|
|
||||||
|
|
||||||
* [KD233](/doc/appdev/board/kd233.md)
|
|
||||||
|
|
||||||
* [Nexys_A7-100T](/doc/appdev/board/nexys.md)
|
|
|
@ -1,45 +0,0 @@
|
||||||
# RISC-V HIFIVE1-REV-B
|
|
||||||
|
|
||||||
## 综述
|
|
||||||
<div class ="tablebox_hifive">
|
|
||||||
<div class="hifive1-rev-b-box">
|
|
||||||
<img src="https://images.prismic.io/sifive/ddef5160-1769-4d8a-9332-99729088aff6_hifive-rev-b-home-page-new.jpg" alt="hifive1-rev-b"/>
|
|
||||||
</div>
|
|
||||||
<center>HIFIVE1-REV-B</center>
|
|
||||||
<span>XiUOS最新分支支持IFIVE1-REV-B开发板,该开发板作为一种标准的板子,支持各种上层组件和应用程序。</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
## 硬件特点
|
|
||||||
+ Microcontroller: FE310-G002
|
|
||||||
+ Operating Voltage: 3.3 V and 1.8 V
|
|
||||||
+ Input Voltage: 5 V USB or 7-12 VDC Jack
|
|
||||||
+ IO Voltage: 3.3 V
|
|
||||||
+ Digital I/O Pins: 19
|
|
||||||
+ PWM Pins: 9
|
|
||||||
+ SPI Controllers/HW CS Pins: 1/3
|
|
||||||
+ UART: 2
|
|
||||||
+ I<sup>2</sup>C: 1
|
|
||||||
+ Networking: WiFi/BT (off-chip)
|
|
||||||
+ External Interrupt Pins: 19
|
|
||||||
+ External Wakeup Pins: 1
|
|
||||||
+ Flash Memory: 32 Mbit Off-Chip (ISSI SPI Flash)
|
|
||||||
+ Host Interface (microUSB): Program, Debug, and Serial Communication
|
|
||||||
+ Debug: Segger J-Link, drag/drop code download
|
|
||||||
+ Weight: 22 g
|
|
||||||
|
|
||||||
### 更多信息[查看网址](https://www.sifive.com/boards/hifive1-rev-b)
|
|
||||||
|
|
||||||
## 支持的功能
|
|
||||||
|
|
||||||
## 编程与调试
|
|
||||||
针对<u>**HIFIVE1-REV-B**</u>开发板的配置和刷新信息,详见[开发环境构建](/environment/debug.html)
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.hifive1-rev-b-box{
|
|
||||||
width: 1500px;
|
|
||||||
height: 400px;
|
|
||||||
vertical-align: middle;
|
|
||||||
display: table-cell;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
Before Width: | Height: | Size: 2.0 MiB |
Before Width: | Height: | Size: 131 KiB |
Before Width: | Height: | Size: 693 KiB |
|
@ -1,53 +0,0 @@
|
||||||
# RISC-V KD233
|
|
||||||
## 综述
|
|
||||||
|
|
||||||
<img src="./imagesrc/kd233.png" />
|
|
||||||
|
|
||||||
<center>
|
|
||||||
<span>XiUOS最新分支支持KD233开发板,该开发板作为一种标准的板子,支持各种上层组件和应用程序。</span>
|
|
||||||
</center>
|
|
||||||
|
|
||||||
## 硬件特点
|
|
||||||
+ 性能
|
|
||||||
+ 中央处理器:RISC-V Dual Core 64bit, with FPU
|
|
||||||
+ 图像识别:QVGA@60fps/VG@30fps
|
|
||||||
+ 语音识别:麦克风阵列(8 mics)
|
|
||||||
+ 安全
|
|
||||||
+ 高级加密硬件加速器(AES)
|
|
||||||
+ 一次性只读存储器(OTP)SHA256
|
|
||||||
+ 功耗
|
|
||||||
+ 典型应用场景功耗 < 1W
|
|
||||||
+ 芯片功耗 < 300mW
|
|
||||||
+ 扩展性
|
|
||||||
+ 操作系统:FreeRTOS
|
|
||||||
+ 网络模型:TinyYOLOv2(after pruned)
|
|
||||||
+ 深度学习框架:TensorFlow/Keras/Darknet
|
|
||||||
+ 外设:FPIOA、UART、GPIO、SPI、I<sup>2</sup>C、I<sup>2</sup>S、WDT、TIMER、RTC等等
|
|
||||||
### 更多信息
|
|
||||||
+ [KD233](https://canaan-creative.com/product/kendryteai)
|
|
||||||
|
|
||||||
## 支持的功能
|
|
||||||
| 名称 | 控制器 | 驱动描述 |
|
|
||||||
| ---- | ---- | ---- |
|
|
||||||
| <center>AUDIO</center> | on-chip | audio音频控制 |
|
|
||||||
| <center>CAMERA</center> | on-chip | camera驱动控制 |
|
|
||||||
| <center>DMA</center> | on-chip | dma驱动控制 |
|
|
||||||
| <center>FFT</center> | on-chip | 快速傅里叶变换 |
|
|
||||||
| <center>GPIO</center> | on-chip | gpio 输入输出控制 |
|
|
||||||
| <center>I<sup>2</sup>C</center> | on-chip | i<sup>2</sup>c总线 |
|
|
||||||
| <center>I<sup>2</sup>S</center> | on-chip | i<sup>2</sup>s总线 |
|
|
||||||
| <center>KPU</center> | on-chip | kpu计算架构 |
|
|
||||||
| <center>LCD</center> | on-chip | lcd 液晶显示器控制 |
|
|
||||||
| <center>PLIC</center> | on-chip | 中断控制 |
|
|
||||||
| <center>PWM</center> | on-chip | pwm驱动控制 |
|
|
||||||
| <center>RTC</center> | on-chip | rtc实时时钟驱动控制 |
|
|
||||||
| <center>SECURITY</center> | on-chip | 安全 |
|
|
||||||
| <center>SPI</center> | on-chip | spi总线驱动控制 |
|
|
||||||
| <center>SYS_CLOCK</center> | on-chip | 系统时钟控制 |
|
|
||||||
| <center>TIMER</center> | on-chip | timer重置和计时控制 |
|
|
||||||
| <center>UART</center> | on-chip | uart串口驱动控制 |
|
|
||||||
| <center>VIDEO</center> | on-chip | video视频控制器驱动 |
|
|
||||||
| <center>WATCHDOG</center> | on-chip | watchdog看门狗控制 |
|
|
||||||
|
|
||||||
## 编程与调试
|
|
||||||
针对<u>**KD233**</u>开发板的配置和刷新信息,详见[开发环境构建](/environment/bianyi.html)
|
|
|
@ -1,46 +0,0 @@
|
||||||
# RISC-V MAXGO
|
|
||||||
## 综述
|
|
||||||
|
|
||||||
<center>
|
|
||||||
<img src="./imagesrc/maxgo1.png" alt="maxgo"/>
|
|
||||||
<p>MAXGO</p>
|
|
||||||
</center>
|
|
||||||
|
|
||||||
<span>XiUOS最新分支支持MAXGO开发板,该开发板作为一种标准的板子,支持各种上层组件和应用程序。</span>
|
|
||||||
|
|
||||||
|
|
||||||
## 硬件特点
|
|
||||||
+ 性能
|
|
||||||
+ 中央处理器:RISC-V Dual Core 64bit, with FPU
|
|
||||||
+ 图像识别:QVGA@60fps/VG@30fps
|
|
||||||
+ 语音识别:麦克风阵列(8 mics)
|
|
||||||
+ 安全
|
|
||||||
+ 高级加密硬件加速器(AES)
|
|
||||||
+ 一次性只读存储器(OTP)SHA256
|
|
||||||
+ 功耗
|
|
||||||
+ 典型应用场景功耗 < 1W
|
|
||||||
+ 芯片功耗 < 300mW
|
|
||||||
+ 扩展性
|
|
||||||
+ 操作系统:FreeRTOS
|
|
||||||
+ 网络模型:TinyYOLOv2(after pruned)
|
|
||||||
+ 深度学习框架:TensorFlow/Keras/Darknet
|
|
||||||
+ 外设:FPIOA、UART、GPIO、SPI、I<sup>2</sup>C、I<sup>2</sup>S、WDT、TIMER、RTC等等
|
|
||||||
### 更多信息
|
|
||||||
+ [KD233](https://canaan-creative.com/product/kendryteai)
|
|
||||||
|
|
||||||
## 支持的功能
|
|
||||||
| 名称 | 控制器 | 驱动描述 |
|
|
||||||
| ---- | ---- | ---- |
|
|
||||||
| <center>CAMERA</center> | on-chip | camera驱动控制 |
|
|
||||||
| <center>DMA</center> | on-chip | dma驱动控制 |
|
|
||||||
| <center>GPIO</center> | on-chip | gpio 输入输出控制 |
|
|
||||||
| <center>I<sup>2</sup>C</center> | on-chip | i<sup>2</sup>c总线 |
|
|
||||||
| <center>I<sup>2</sup>S</center> | on-chip | i<sup>2</sup>s总线 |
|
|
||||||
| <center>LCD</center> | on-chip | lcd 液晶显示器控制 |
|
|
||||||
| <center>PLIC</center> | on-chip | 中断控制 |
|
|
||||||
| <center>SPI</center> | on-chip | spi总线驱动控制 |
|
|
||||||
| <center>SYS_CLOCK</center> | on-chip | 系统时钟控制 |
|
|
||||||
| <center>UART</center> | on-chip | uart串口驱动控制 |
|
|
||||||
|
|
||||||
## 编程与调试
|
|
||||||
针对<u>**MAXGO**</u>开发板的配置和刷新信息,详见[开发环境构建](/environment/bianyi.html)
|
|
|
@ -1,76 +0,0 @@
|
||||||
# Nexys A7-100T
|
|
||||||
|
|
||||||
## 综述
|
|
||||||
|
|
||||||
<center>
|
|
||||||
<img src="https://reference.digilentinc.com/_media/reference/programmable-logic/nexys-a7/nexys-a7-obl-600.png">
|
|
||||||
<br>
|
|
||||||
<div style="color:orange; border-bottom: 1px solid #d9d9d9;
|
|
||||||
display: inline-block;
|
|
||||||
color: #999;
|
|
||||||
padding: 2px;">Nexys A7</div>
|
|
||||||
</center>
|
|
||||||
|
|
||||||
Nexys A7-100T 是 Digilent 多孔 RAM-based Nexys 开发板的简易替代品。搭载Xilinx®Artix™-7 FPGA芯片,Nexys 4 DDR 是一个打开即用型的数字电路开发平台,帮助使用者能够在课堂环境下实现诸多工业领域的应用,配有高容量的大型FPGA芯片(Xilinx产品编号XC7A100T-1CSG324C)并集成了USB,以太网和其它端口。Nexys 4 DDR开发板能实现从理论型组合电路到强大的嵌入式处理器的多种设计。
|
|
||||||
## 硬件特点
|
|
||||||
|
|
||||||
<img src="https://s3.ax1x.com/2020/11/19/DuzSVf.jpg">
|
|
||||||
|
|
||||||
| 序号 | 描述 | 序号 | 描述 |
|
|
||||||
| ---- | ---- | ---- | ---- |
|
|
||||||
| 1 | 选择供电跳线 |13|CPU复位按键(用于软核)|
|
|
||||||
| 2 | UART/JTAG共用USB接口 |14|FPGA 配置复位按键|
|
|
||||||
| 3 | 外部配置跳线柱(SD/USB) |15|模拟信号Pmod端口(XADC)|
|
|
||||||
| 4 | Pmod端口 |16|编程模式跳线柱|
|
|
||||||
| 5 | 扩音器 |17|音频连接口|
|
|
||||||
| 6 | 电源测试点 |18|VGA连接口|
|
|
||||||
| 7 | 16个LED |19|FPGA编程完成LED|
|
|
||||||
| 8 | 16个按键开关 |20|以太网连接口|
|
|
||||||
| 9 | 8位7段数码管 |21|USB连接口|
|
|
||||||
| 10 | 可选用与外部接线的JTAG端口 |22|(工业用)PIC24编程端口|
|
|
||||||
| 11 | 5个按键开关 |23|电源开关|
|
|
||||||
| 12 | 板载温度传感器 |24|电源接口|
|
|
||||||
|
|
||||||
|
|
||||||
## 验证FPGA 移植linux
|
|
||||||
|
|
||||||
通过 lowRISC 开源项目,基于 rocket 修改的软核上运行完整的 linux。支持键盘、显示器、网卡等常见通用设备,验证了riscv软核运行linux操作系统的可行性,为XiUOS进一步支持riscv软核提供了试验基础。
|
|
||||||
* 生成riscv软核比特流
|
|
||||||
* 裁剪编译 linux
|
|
||||||
* 生成伯克利 bootloader(bbl)
|
|
||||||
* 将软核写入 flash
|
|
||||||
* 将 bbl 和 linux 写入 microSD卡
|
|
||||||
* JP1 位于 USB / SD 位置,JP2 位于 USB 位置,电源选择 JP3位,usb底部的开关打开DIP-SW 1,引导linux从sd卡启动
|
|
||||||
|
|
||||||
<center>
|
|
||||||
<img src="https://s3.ax1x.com/2020/11/13/DSRnpj.png">
|
|
||||||
<br>
|
|
||||||
<div style="color:orange; border-bottom: 1px solid #d9d9d9;
|
|
||||||
display: inline-block;
|
|
||||||
color: #999;
|
|
||||||
padding: 2px;">在Nexys A7-100T上基于riscv软核运行Linux</div>
|
|
||||||
</center>
|
|
||||||
|
|
||||||
```bash
|
|
||||||
Debian GUN/Linux buster/sid lowrisc tty1
|
|
||||||
lowrisc login: xiuos
|
|
||||||
Password:
|
|
||||||
Last login:Thu Jan 1 01:09:48 BST 1970 on tty1
|
|
||||||
Linux lowrisc 4.18.0-gc81ff0d #48 Thu Oct 18 16:00:24 BST 2018 riscv64
|
|
||||||
|
|
||||||
The programs included with the Debian GUN/linux system are free software;
|
|
||||||
the exact distribution terms for each program are described in the
|
|
||||||
individual files in /usr/share/doc/*/copyright.
|
|
||||||
|
|
||||||
Debian GUN/linux comes with ABSOLUTELY NO WARRANT, to the extent
|
|
||||||
permitted by applicable law.
|
|
||||||
xiuos@lowrisc:~$ cat /proc/cpuinfo
|
|
||||||
hart : 0
|
|
||||||
isa : rv64imafdc
|
|
||||||
mmu : sv39
|
|
||||||
uarch : sifive,rocket0
|
|
||||||
|
|
||||||
xiuos@lowrisc:~$ uname -a
|
|
||||||
Linux lowrisc 4.18.0-gc81ff0d #48 Thu Oct 18 16:00:24 BST 2018 riscv64 GUN/linux
|
|
||||||
xiuos@lowrisc:~$
|
|
||||||
```
|
|
|
@ -1,62 +0,0 @@
|
||||||
# STM32F407-ST-DISCOVERY
|
|
||||||
## 综述
|
|
||||||
<div class ="tablebox">
|
|
||||||
<div class="imgbox">
|
|
||||||
<img src="https://www.st.com/bin/ecommerce/api/image.PF252419.en.feature-description-include-personalized-no-cpn-large.jpg" />
|
|
||||||
</div>
|
|
||||||
<p>STM32F4DISCOVERY</p>
|
|
||||||
<span>XiUOS最新分支支持stm32f407-st-discovery开发板,该开发板作为一种标准的板子,支持各种上层组件和应用程序。</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
## 硬件特点
|
|
||||||
|
|
||||||
+ STM32F407VGT6 microcontroller featuring 32-bit ARM®Cortex®-M4 with FPU core, 1-Mbyte Flash memory, 192-Kbyte RAM in an LQFP100 package
|
|
||||||
+ On-board ST-LINK/V2 on STM32F4DISCOVERY (old reference) or ST-LINK/V2-A on STM32F407G-DISC1 (new order code)
|
|
||||||
+ USB ST-LINK with re-enumeration capability and three different interfaces:
|
|
||||||
<p style="text-indent:2em">1. Debug port</p>
|
|
||||||
<p style="text-indent:2em">2. Virtual Com port (with new order code only) </p>
|
|
||||||
<p style="text-indent:2em">3. Mass storage (with new order code only) </p>
|
|
||||||
+ Board power supply: through USB bus or from an external 5 V supply voltage
|
|
||||||
+ External application power supply: 3 V and 5 V
|
|
||||||
+ LIS302DL or LIS3DSH ST MEMS 3-axis accelerometer
|
|
||||||
+ MP45DT02 ST-MEMS audio sensor omni-directional digital microcontroller
|
|
||||||
+ CS43L22 audio DAC with integrated class D speaker driver
|
|
||||||
+ Eight LEDs:
|
|
||||||
<p style="text-indent:2em">1. LD1 (red/green) for USB communication</p>
|
|
||||||
<p style="text-indent:2em">2. LD2 (red) for 3.3 V power on </p>
|
|
||||||
<p style="text-indent:2em">3. Four user LEDs, LD3 (orange), LD4 (green), LD5 (red) and LD6 (blue) </p>
|
|
||||||
<p style="text-indent:2em">4. USB OTG LEDs LD7 (green) VBUS and LD8 (red) over-current </p>
|
|
||||||
+ Two push-buttons (user and reset)
|
|
||||||
+ USB OTG FS with micro-AB connector
|
|
||||||
+ Extension header for all LQFP100 I/Os for quick connection to prototyping board and easy probing
|
|
||||||
+ Comprehensive free software including a variety of examples, part of STM32CubeF4 package or STSW-STM32068 to use legacy standard libraries.
|
|
||||||
|
|
||||||
### 更多信息
|
|
||||||
+ [STM32F4DISCOVERY](https://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-mpu-eval-tools/stm32-mcu-mpu-eval-tools/stm32-discovery-kits/stm32f4discovery.html#)
|
|
||||||
|
|
||||||
## 支持的功能
|
|
||||||
| 名称 | 控制器 | 驱动描述 |
|
|
||||||
| ---- | ---- | ---- |
|
|
||||||
| <center>DMA</center> | on-chip | DMA驱动控制 |
|
|
||||||
| <center>GPIO</center> | on-chip | gpio 输入输出控制 |
|
|
||||||
| <center>I2C</center> | on-chip | i2c 控制 |
|
|
||||||
| <center>LCD</center> | on-chip | lcd 液晶显示器控制 |
|
|
||||||
| <center>RTC</center> | on-chip | rtc 实时始终控制 |
|
|
||||||
| <center>SPI</center> | on-chip | spi 总线系统控制 |
|
|
||||||
| <center>TIMER</center> | on-chip | timer重置和计时控制 |
|
|
||||||
| <center>UART</center> | on-chip | uart串口驱动控制 |
|
|
||||||
| <center>USB</center> | on-chip | usb驱动控制 |
|
|
||||||
| <center>WATCHDOG</center> | on-chip | watchdog看门口控制 |
|
|
||||||
|
|
||||||
## 编程与调试
|
|
||||||
针对<u>**stm32f407-st-discovery**</u>开发板的配置和刷新信息,详见[开发环境构建](/environment/bianyi.html)
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.tablebox{
|
|
||||||
width: 1500px;
|
|
||||||
height: 400px;
|
|
||||||
vertical-align: middle;
|
|
||||||
display: table-cell;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,84 +0,0 @@
|
||||||
# STM32F407ZGT6
|
|
||||||
## 综述
|
|
||||||
<div class ="tablebox1">
|
|
||||||
<img src="./imagesrc/stm32f407zgt6.png"/>
|
|
||||||
<p>STM32F407ZET6</p>
|
|
||||||
<span>XiUOS最新分支支持stm32f407zgt6开发板,该开发板作为一种标准的板子,支持各种上层组件和应用程序。</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
## 硬件特点
|
|
||||||
|
|
||||||
+ Core: Arm® 32-bit Cortex®-M4 CPU with FPU, Adaptive real-time accelerator (ART Accelerator) allowing 0-wait state execution from Flash memory, frequency up to 168 MHz, memory protection unit, 210 DMIPS/1.25 DMIPS/MHz (Dhrystone 2.1), and DSP instructions
|
|
||||||
+ Memories
|
|
||||||
<p style="text-indent:2em">1. Up to 1 Mbyte of Flash memory</p>
|
|
||||||
<p style="text-indent:2em">2. Up to 192+4 Kbytes of SRAM including 64-Kbyte of CCM (core coupled memory) data RAM </p>
|
|
||||||
<p style="text-indent:2em">3. Up to 192+4 Kbytes of SRAM including 64-Kbyte of CCM (core coupled memory) data RAM</p>
|
|
||||||
<p style="text-indent:2em">4. 512 bytes of OTP memory</p>
|
|
||||||
<p style="text-indent:2em">5. Flexible static memory controller supporting Compact Flash, SRAM, PSRAM, NOR and NAND memories</p>
|
|
||||||
+ LCD parallel interface, 8080/6800 modes
|
|
||||||
+ Clock, reset and supply management
|
|
||||||
<p style="text-indent:2em">1. 1.8 V to 3.6 V application supply and I/Os</p>
|
|
||||||
<p style="text-indent:2em">2. POR, PDR, PVD and BOR</p>
|
|
||||||
<p style="text-indent:2em">3. 4-to-26 MHz crystal oscillator </p>
|
|
||||||
<p style="text-indent:2em">4. Internal 16 MHz factory-trimmed RC (1% accuracy)</p>
|
|
||||||
<p style="text-indent:2em">5. 32 kHz oscillator for RTC with calibration</p>
|
|
||||||
<p style="text-indent:2em">6. Internal 32 kHz RC with calibration </p>
|
|
||||||
+ Low-power operation
|
|
||||||
<p style="text-indent:2em">1. Sleep, Stop and Standby modes </p>
|
|
||||||
<p style="text-indent:2em">2. V<sub>BAT</sub> supply for RTC, 20×32 bit backup registers + optional 4 KB backup SRAM </p>
|
|
||||||
+ 3×12-bit, 2.4 MSPS A/D converters: up to 24 channels and 7.2 MSPS in triple interleaved mode
|
|
||||||
+ 2×12-bit D/A converters
|
|
||||||
+ General-purpose DMA: 16-stream DMA controller with FIFOs and burst support
|
|
||||||
+ Up to 17 timers: up to twelve 16-bit and two 32-bit timers up to 168 MHz, each with up to 4 IC/OC/PWM or pulse counter and quadrature (incremental) encoder input
|
|
||||||
+ Debug mode
|
|
||||||
<p style="text-indent:2em">1. Serial wire debug (SWD) & JTAG interfaces </p>
|
|
||||||
<p style="text-indent:2em">2. Cortex-M4 Embedded Trace Macrocell™ </p>
|
|
||||||
+ Up to 140 I/O ports with interrupt capability
|
|
||||||
<p style="text-indent:2em">1. Up to 136 fast I/Os up to 84 MHz </p>
|
|
||||||
<p style="text-indent:2em">2. Up to 138 5 V-tolerant I/Os </p>
|
|
||||||
+ Up to 15 communication interfaces
|
|
||||||
<p style="text-indent:2em">1. Up to 3 × I<sup>2</sup>C interfaces (SMBus/PMBus) </p>
|
|
||||||
<p style="text-indent:2em">2. Up to 4 USARTs/2 UARTs (10.5 Mbit/s, ISO 7816 interface, LIN, IrDA, modem control) </p>
|
|
||||||
<p style="text-indent:2em">3. Up to 3 SPIs (42 Mbits/s), 2 with muxed full-duplex I2S to achieve audio class accuracy via internal audio PLL or external clock </p>
|
|
||||||
<p style="text-indent:2em">4. 2 × CAN interfaces (2.0B Active) </p>
|
|
||||||
<p style="text-indent:2em">5. SDIO interface </p>
|
|
||||||
+ Advanced connectivity
|
|
||||||
<p style="text-indent:2em">1. USB 2.0 full-speed device/host/OTG controller with on-chip PHY </p>
|
|
||||||
<p style="text-indent:2em">2. USB 2.0 high-speed/full-speed device/host/OTG controller with dedicated DMA, on-chip full-speed PHY and ULPI</p>
|
|
||||||
<p style="text-indent:2em">3. 10/100 Ethernet MAC with dedicated DMA: supports IEEE 1588v2 hardware, MII/RMII </p>
|
|
||||||
+ 8- to 14-bit parallel camera interface up to 54 Mbytes/s
|
|
||||||
+ True random number generator
|
|
||||||
+ CRC calculation unit
|
|
||||||
+ 96-bit unique ID
|
|
||||||
+ RTC: subsecond accuracy, hardware calendar
|
|
||||||
|
|
||||||
|
|
||||||
### 更多信息
|
|
||||||
+ [STM32F407ZET6](https://www.st.com/content/st_com/en/products/microcontrollers-microprocessors/stm32-32-bit-arm-cortex-mcus/stm32-high-performance-mcus/stm32f4-series/stm32f407-417/stm32f407ze.html)
|
|
||||||
|
|
||||||
## 支持的功能
|
|
||||||
| 名称 | 控制器 | 驱动描述 |
|
|
||||||
| ---- | ---- | ---- |
|
|
||||||
| <center>DMA</center> | on-chip | DMA驱动控制 |
|
|
||||||
| <center>GPIO</center> | on-chip | gpio 输入输出控制 |
|
|
||||||
| <center>I2C</center> | on-chip | i2c 控制 |
|
|
||||||
| <center>LCD</center> | on-chip | lcd 液晶显示器控制 |
|
|
||||||
| <center>RTC</center> | on-chip | rtc 实时始终控制 |
|
|
||||||
| <center>SPI</center> | on-chip | spi 总线系统控制 |
|
|
||||||
| <center>TIMER</center> | on-chip | timer重置和计时控制 |
|
|
||||||
| <center>UART</center> | on-chip | uart串口驱动控制 |
|
|
||||||
| <center>USB</center> | on-chip | usb驱动控制 |
|
|
||||||
| <center>WATCHDOG</center> | on-chip | watchdog看门口控制 |
|
|
||||||
|
|
||||||
## 编程与调试
|
|
||||||
针对<u>**stm32f407zet6**</u>开发板的配置和刷新信息,详见[开发环境构建](/environment/bianyi.html)
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.tablebox1{
|
|
||||||
width: 1000px;
|
|
||||||
height: 300px;
|
|
||||||
vertical-align: middle;
|
|
||||||
display: table-cell;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,150 +0,0 @@
|
||||||
# 系统调试
|
|
||||||
|
|
||||||
* [前言](#intro)
|
|
||||||
* [Jlink调试](#jlink-debug)
|
|
||||||
* [Ozone调试](#ozone-debug)
|
|
||||||
* [FAQ](#faq)
|
|
||||||
|
|
||||||
<span id="intro"></span>
|
|
||||||
|
|
||||||
## 前言
|
|
||||||
|
|
||||||
本文档将介绍<B>XiUOS</B>使用jlink、Ozone调试软件的配置、调试过程。
|
|
||||||
|
|
||||||
<span id="jlink-debug"></span>
|
|
||||||
|
|
||||||
## Jlink调试
|
|
||||||
|
|
||||||
### 软件安装
|
|
||||||
|
|
||||||
+ jlink包安装
|
|
||||||
|
|
||||||
第一步,进入jlink官网[下载网址](https://www.segger.com/downloads/jlink)
|
|
||||||
|
|
||||||
<img src="./imagesrc/jlink_package_1.png" width="100%"/>
|
|
||||||
|
|
||||||
第二步,选择版本并下载安装包,此处下载的安装包版本为V6.72e,即JLink_Linux_V672e_x86_64.deb。
|
|
||||||
|
|
||||||
<img src="./imagesrc/jlink_package_2.png" width="100%"/>
|
|
||||||
|
|
||||||
第三步,安装JLink_Linux_V672e_x86_64.deb
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ dpkg -i JLink_Linux_V672e_x86_64.deb
|
|
||||||
```
|
|
||||||
|
|
||||||
+ openocd安装
|
|
||||||
|
|
||||||
第一步,进入[下载网址](https://github.com/kendryte/openocd-kendryte/releases),
|
|
||||||
下载Unbuntu版本的openocd。<B>XiUOS</B>中下载的kendryte-openocd-0.2.3-ubuntu64.tar.gz
|
|
||||||
|
|
||||||
第二步,安装openocd
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ sudo mv kendryte-openocd-0.2.2-ubuntu64.tar.gz /opt
|
|
||||||
$ cd /opt
|
|
||||||
$ sudo tar -zxvf kendryte-openocd-0.2.2-ubuntu64.tar.gz
|
|
||||||
$ sudo apt install libusb-dev libftdi-dev libhidapi-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
第三步,openocd文件配置
|
|
||||||
|
|
||||||
打开配置文件,修改第三行 jlink serial 504503073的504503073为具体JLINK设备的标签。
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ cd /opt/kendryte-openocd
|
|
||||||
$ vim ctl/openocd.cfg
|
|
||||||
```
|
|
||||||
|
|
||||||
<img src="./imagesrc/openocd_cfg.png" width="100%"/>
|
|
||||||
|
|
||||||
第四步,打开openocd软件
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ cd /opt/kendryte-openocd
|
|
||||||
$ ./bin/openocd -f ./ctl/openocd.cfg
|
|
||||||
```
|
|
||||||
|
|
||||||
成功运行则显示如下的界面。
|
|
||||||
|
|
||||||
<img src="./imagesrc/open_openocd.png"/>
|
|
||||||
|
|
||||||
|
|
||||||
### 调试程序
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ riscv-none-embed-gdb XiaoShan_kd233.elf --eval-command="target remote 127.0.0.1:3333"
|
|
||||||
```
|
|
||||||
|
|
||||||
运行上述命令,其中,
|
|
||||||
+ XiaoShan_kd233.elf是编译过程生成的elf文件;
|
|
||||||
+ 127.0.0.1表示本地IP地址,也可以制定远程地址;
|
|
||||||
+ 3333是openocd监听的端口号;
|
|
||||||
|
|
||||||
成功连接openocd之后,界面如下所示,之后就可以使用load\break\continue等gdb命令进行调试了。
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<img src="./imagesrc/openocd_gdb.png"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<span id="ozone-debug"></span>
|
|
||||||
|
|
||||||
## Ozone调试
|
|
||||||
|
|
||||||
第一步,从Segger官网下载Ozone,下载链接分别为[32位](https://www.segger.com/downloads/jlink/Ozone_Linux_i386.deb)、[64位](https://www.segger.com/downloads/jlink/Ozone_Linux_x86_64.deb).
|
|
||||||
|
|
||||||
第二步,安装deb安装包
|
|
||||||
|
|
||||||
|
|
||||||
![INSTALL PROCESS](./imagesrc/ozone_install.png)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
第三步,配置合适的参数
|
|
||||||
|
|
||||||
选择Device为STM32F407VG
|
|
||||||
|
|
||||||
<center>
|
|
||||||
|
|
||||||
![DEVICE CONFIG](./imagesrc/device_config.png)
|
|
||||||
|
|
||||||
</center>
|
|
||||||
|
|
||||||
:::tip
|
|
||||||
注意Target Interface需修改为SWD.
|
|
||||||
:::
|
|
||||||
|
|
||||||
<center>
|
|
||||||
|
|
||||||
![INTERFACE CONFIG](./imagesrc/interface_config.png)
|
|
||||||
|
|
||||||
</center>
|
|
||||||
|
|
||||||
选择编译后生成的elf文件
|
|
||||||
|
|
||||||
<img src="./imagesrc/elf_file.png" width = "100%"/>
|
|
||||||
|
|
||||||
提交到Ozone页面
|
|
||||||
|
|
||||||
![OZONE PAGE](./imagesrc/ozone_page.png)
|
|
||||||
|
|
||||||
点击调试后,若未设置断点,Ozone将自动在执行main函数前停止,Ozone支持设置代码和数据断点、单步调试、查看变量值等功能,是很方便的一个调试工具。
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<span id="faq"></span>
|
|
||||||
|
|
||||||
## FAQ
|
|
||||||
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.openocd_cfg{
|
|
||||||
width: 1500px;
|
|
||||||
height: 400px;
|
|
||||||
vertical-align: middle;
|
|
||||||
display: table-cell;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,56 +0,0 @@
|
||||||
# 开发步骤
|
|
||||||
|
|
||||||
## 前言
|
|
||||||
<p style="text-indent:2em">本文档将介绍<B>XiUOS</B>分别在基于ARM和RISC-V架构的开发板上的编译、烧录和运行的过程。包括开发板选择及配置初始化、编译命令等信息。
|
|
||||||
</p>
|
|
||||||
|
|
||||||
## 开发板的选择及配置初始化
|
|
||||||
<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
|
|
|
@ -1,80 +0,0 @@
|
||||||
# 开发环境
|
|
||||||
|
|
||||||
## 前言
|
|
||||||
本文档将介绍如何在个人pc设备上构建编译环境来编译 <B>XiUOS</B>
|
|
||||||
操作系统, 需要注意的是, 目前 <B>XiUOS</B> 暂时只支持在Linux系统上编译。</p>
|
|
||||||
|
|
||||||
## 硬件安装
|
|
||||||
* 硬件要求
|
|
||||||
64位系统,磁盘空间大于40G。
|
|
||||||
* linux内核下载
|
|
||||||
因为<B>XiUOS</B>是在Ubuntu 16.04上开发与测试的(Ubuntu 18.04、20.04版本也支持),因此我们推荐您使用Ubuntu 16.04版本的系统执行编译环境搭建。
|
|
||||||
* Ubuntu下载网址
|
|
||||||
[here](https://ubuntu.com/download/desktop)
|
|
||||||
|
|
||||||
|
|
||||||
## 依赖包安装
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ sudo apt-get install gcc
|
|
||||||
$ sudo apt-get install make
|
|
||||||
$ sudo apt-get install libncurses5-dev
|
|
||||||
$ sudo apt-get install openssl
|
|
||||||
$ sudo apt-get install libssl-dev
|
|
||||||
$ sudo apt-get install build-essential
|
|
||||||
$ sudo apt-get install pkg-config
|
|
||||||
$ sudo apt-get install libc6-dev
|
|
||||||
$ sudo apt-get install bison
|
|
||||||
$ sudo apt-get install flex
|
|
||||||
$ sudo apt-get install libelf-dev
|
|
||||||
$ sudo apt-get install autoconf
|
|
||||||
$ sudo apt-get install libtool
|
|
||||||
$ sudo apt-get install gpref
|
|
||||||
```
|
|
||||||
## 源码下载
|
|
||||||
<B>XiUOS</B>的源码和相关文档介绍使用git进行集成管理,建议开发者使用git工具进行版本控制和分支管理
|
|
||||||
|
|
||||||
git配置执行以下命令
|
|
||||||
```shell
|
|
||||||
$ git config --global user.name "your name"
|
|
||||||
$ git config --global user.email "your email"
|
|
||||||
```
|
|
||||||
其中,源码下载网址点击该链接[XiUOS源码网址](https://ubuntu.com/download/desktop)
|
|
||||||
|
|
||||||
## 工具链
|
|
||||||
* ARM下编译需要安装<B>arm-none-eabi</B>编译工具, 安装到Ubuntu的默认路径/usr/bin/arm-none-eabi-,使用如下命令行下载
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ sudo apt-get install gcc-arm-none-eabi
|
|
||||||
```
|
|
||||||
|
|
||||||
* 源码下载,下载网址
|
|
||||||
[ARM官网下载](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads)
|
|
||||||
RISC-V下编译需要安装<B>riscv-none-embed-</B>编译工具, 安装到Ubuntu的默认路径/opt/
|
|
||||||
[下载网址](https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/), 根据需求选择不同的版本
|
|
||||||
操作方法,以xpack-riscv-none-embed-gcc-linux-x64.tar.gz为例
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ tar -zxvf xpack-riscv-none-embed-gcc-linux-x64.tar.gz -C /opt/
|
|
||||||
```
|
|
||||||
## 烧写工具
|
|
||||||
* ARM下烧写软件(ST-LINK)
|
|
||||||
下载源码
|
|
||||||
|
|
||||||
```shell
|
|
||||||
git clone https://github.com/texane/stlink.git
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
* RISC-V下烧写软件(KFLASH)
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ sudo pip3 install kflash
|
|
||||||
// 如果在安装工具失败,则执行一下命令
|
|
||||||
$ sudo python -m pip install kflash
|
|
||||||
$ sudo python3 -m pip install kflash
|
|
||||||
$ sudo pip install kflash
|
|
||||||
$ sudo pip2 install kflash
|
|
||||||
```
|
|
||||||
|
|
||||||
## FAQ
|
|
Before Width: | Height: | Size: 243 KiB |
Before Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 329 KiB |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 89 KiB |
Before Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 125 KiB |
Before Width: | Height: | Size: 663 KiB |
Before Width: | Height: | Size: 932 KiB |
|
@ -0,0 +1,11 @@
|
||||||
|
# 从零开始构建矽璓工业物联操作系统
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 使用ARM架构的开发板
|
||||||
|
|
||||||
|
* [STM32F407-ST-DISCOVERY](/doc/appdev/start_from_scratch/stm32f407-st-discovery.md)
|
||||||
|
|
||||||
|
## 使用risc-v架构的开发板
|
||||||
|
|
||||||
|
* [KD233](/doc/appdev/start_from_scratch/kd233.md)
|
|
@ -0,0 +1,198 @@
|
||||||
|
# 从零开始构建矽璓工业物联操作系统:使用risc-v架构的kd233开发板
|
||||||
|
|
||||||
|
[XiUOS](http://xuos.io/) (X Industrial Ubiquitous Operating System) 矽璓工业物联操作系统是一款面向工业物联场景的泛在操作系统,来自泛在操作系统研究计划。所谓泛在操作系统(UOS: Ubiquitous Operating Systems),是支持互联网时代人机物融合泛在计算应用模式的新型操作系统,是传统操作系统概念的泛化与延伸。在泛在操作系统技术体系中,不同的泛在计算设备和泛在应用场景需要符合各自特性的不同UOS,XiUOS即是面向工业物联场景的一种UOS,主要由一个极简的微型实时操作系统(RTOS)内核和其上的智能工业物联框架构成,支持工业物联网(IIoT: Industrial Internet of Things)应用。
|
||||||
|
|
||||||
|
## 开发环境搭建
|
||||||
|
|
||||||
|
### 推荐使用
|
||||||
|
|
||||||
|
**操作系统:** ubuntu18.04[https://ubuntu.com/download/desktop](https://ubuntu.com/download/desktop)
|
||||||
|
更新`ubuntu 18.04`源的方法:(根据自身情况而定,可以不更改)
|
||||||
|
第一步:打开sources.list文件
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo vim /etc/apt/sources.list
|
||||||
|
```
|
||||||
|
|
||||||
|
第二步:将以下内容复制到sources.list文件
|
||||||
|
|
||||||
|
```
|
||||||
|
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
|
||||||
|
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
|
||||||
|
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
|
||||||
|
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
|
||||||
|
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
|
||||||
|
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
|
||||||
|
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
|
||||||
|
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
|
||||||
|
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
|
||||||
|
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
|
||||||
|
```
|
||||||
|
|
||||||
|
第三步:更新源和系统软件
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get upgrade
|
||||||
|
```
|
||||||
|
|
||||||
|
**开发工具推荐使用 VSCode,VScode下载地址为:** VSCode [https://code.visualstudio.com/](https://code.visualstudio.com/),推荐下载地址为 [http://vscode.cdn.azure.cn/stable/3c4e3df9e89829dce27b7b5c24508306b151f30d/code_1.55.2-1618307277_amd64.deb](http://vscode.cdn.azure.cn/stable/3c4e3df9e89829dce27b7b5c24508306b151f30d/code_1.55.2-1618307277_amd64.deb)
|
||||||
|
|
||||||
|
### 依赖包安装
|
||||||
|
|
||||||
|
```bash
|
||||||
|
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 [https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos)
|
||||||
|
新建一个空文件夹并进入文件夹中,并下载源码,具体命令如下:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir test && cd test
|
||||||
|
git clone https://git.trustie.net/xuos/xiuos.git
|
||||||
|
```
|
||||||
|
|
||||||
|
打开源码文件包可以看到以下目录:
|
||||||
|
| 名称 | 说明 |
|
||||||
|
| -- | -- |
|
||||||
|
| application | 应用代码 |
|
||||||
|
| board | 板级支持包 |
|
||||||
|
| framework | 应用框架 |
|
||||||
|
| fs | 文件系统 |
|
||||||
|
| kernel | 内核源码 |
|
||||||
|
| resources | 驱动文件 |
|
||||||
|
| tool | 系统工具 |
|
||||||
|
使用VScode打开代码,具体操作步骤为:在源码文件夹下打开系统终端,输入`code .`即可打开VScode开发环境,如下图所示:
|
||||||
|
<div align= "center">
|
||||||
|
<img src = https://img-blog.csdnimg.cn/20210429154839715.jpg width =1000>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
### 裁减配置工具的下载
|
||||||
|
|
||||||
|
裁减配置工具:
|
||||||
|
**工具地址:** kconfig-frontends [https://forgeplus.trustie.net/projects/xuos/kconfig-frontends](https://forgeplus.trustie.net/projects/xuos/kconfig-frontends)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir kfrontends && cd kfrontends
|
||||||
|
git clone https://git.trustie.net/xuos/kconfig-frontends.git
|
||||||
|
```
|
||||||
|
|
||||||
|
下载源码后按以下步骤执行软件安装:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd kconfig-frontends
|
||||||
|
./xs_build.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### 编译工具链
|
||||||
|
|
||||||
|
ARM: arm-none-eabi(`gcc version 6.3.1`),默认安装到Ubuntu的/usr/bin/arm-none-eabi-,使用如下命令行下载
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install gcc-arm-none-eabi
|
||||||
|
```
|
||||||
|
|
||||||
|
# 在STM32F407-DISCOVERY上创建第一个应用 --helloworld
|
||||||
|
|
||||||
|
## 1. 简介
|
||||||
|
|
||||||
|
| 硬件 | 描述 |
|
||||||
|
| -- | -- |
|
||||||
|
|芯片型号| Stm32F407VGT6|
|
||||||
|
|CPU|arm cortex-m|
|
||||||
|
|主频| 168MHz |
|
||||||
|
|片内SRAM| 192KB |
|
||||||
|
|片上FLASH| 1MB |
|
||||||
|
| 外设 | -- |
|
||||||
|
| | ADC、DAC、USB、GPIO、UART、SPI、SDIO、RTC、CAN、DMA、MAC、I²C、WDT、Timer等 |
|
||||||
|
|
||||||
|
XiUOS板级驱动当前支持使用GPIO、I2C、LCD、USB、RTC、SPI、Timer、UART和WDT等。
|
||||||
|
|
||||||
|
## 2. 编译说明
|
||||||
|
|
||||||
|
### 编辑环境:`Ubuntu18.04`
|
||||||
|
|
||||||
|
### 编译工具链:`arm-none-eabi-gcc`
|
||||||
|
|
||||||
|
使用`VScode`打开工程的方法有多种,本文介绍一种快捷键,在项目目录下将`code .`输入终端即可打开目标项目
|
||||||
|
|
||||||
|
修改`applications`文件夹下`main.c`
|
||||||
|
在输出函数中写入 `Hello, world!!! \n Running on stm32f407-st-discovery`完成代码编辑。
|
||||||
|
|
||||||
|
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210428145204668.png#pic_center)
|
||||||
|
|
||||||
|
编译步骤:
|
||||||
|
|
||||||
|
1.在代码根目录下执行以下命令,生成配置文件
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make BOARD=stm32f407-st-discovery menuconfig
|
||||||
|
```
|
||||||
|
|
||||||
|
2.在menuconfig界面配置需要关闭和开启的功能,按回车键进入下级菜单,按Y键选中需要开启的功能,按N键选中需要关闭的功能,配置结束后保存并退出
|
||||||
|
|
||||||
|
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210426212955727.png?x-oss-process=none,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1ViaXF1aXRvdXNUZWFt,size_16,color_FFFFFF,t_70#pic_center)
|
||||||
|
|
||||||
|
3.继续执行以下命令,进行编译
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make BOARD=stm32f407-st-discovery
|
||||||
|
```
|
||||||
|
|
||||||
|
4.如果编译正确无误,会产生XiUOS_stm32f407-st-discovery.elf、XiUOS_stm32f407-st-discovery.bin文件。其中XiUOS_stm32f407-st-discovery.bin需要烧写到设备中进行运行。
|
||||||
|
|
||||||
|
## 3. 烧写及执行
|
||||||
|
|
||||||
|
将 BOARD=stm32f407-st-discovery开发板SWD经 st-link 转接到USB接口,然后使用st-flash工具进行烧写bin文件。
|
||||||
|
![在这里插入图片描述](https://img-blog.csdnimg.cn/2021042716353240.png?x-oss-process=none,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0FJSVRfVWJpcXVpdG91cw==,size_16,color_FFFFFF,t_70#pic_center)
|
||||||
|
|
||||||
|
### 烧写工具
|
||||||
|
|
||||||
|
ARM:ST-LINK(ST-LINK V2实物如图,可在购物网站搜索关键字购买)
|
||||||
|
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210427144736126.png#pic_center)
|
||||||
|
|
||||||
|
下载并以下执行命令以下命令安装st-link工具(本文使用v1.5.1版本),下载地址为:[http://101.36.126.201:8011/stlink.zip](http://101.36.126.201:8011/stlink.zip)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install libusb-dev
|
||||||
|
sudo apt install libusb-1.0-0-dev
|
||||||
|
sudo apt install cmake
|
||||||
|
cd stlink
|
||||||
|
make
|
||||||
|
cd build/Release && make install DESTDIR=_install
|
||||||
|
```
|
||||||
|
|
||||||
|
将生成的st-flash(在stlink/build/Release/bin文件夹下)复制到/usr/bin下就可使用了
|
||||||
|
|
||||||
|
代码根目录下执行st-flash工具烧录
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo st-flash write build/XiUOS_stm32f407-st-discovery.bin 0x8000000
|
||||||
|
```
|
||||||
|
|
||||||
|
此外,推荐用户使用putty作为终端工具,安装命令如下:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install putty
|
||||||
|
```
|
||||||
|
|
||||||
|
打开putty配置串口信息
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo puty
|
||||||
|
```
|
||||||
|
|
||||||
|
选择ttyUSB0(这个端口号根据具体情况而定),配置波特率为115200。
|
||||||
|
![在这里插入图片描述](https://img-blog.csdnimg.cn/2021042815015872.png?x-oss-process=none,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0FJSVRfVWJpcXVpdG91cw==,size_16,color_FFFFFF,t_70#pic_center)
|
||||||
|
|
||||||
|
注意:选择正确的终端端口号,最后可以执行以下命令,清除配置文件和编译生成的文件
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make BOARD=stm32f407-st-discovery distclean
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3.1 运行结果
|
||||||
|
|
||||||
|
如果编译 & 烧写无误,将会在串口终端上看到信息打印输出,(终端串口引脚为PB6、PB7)。
|
||||||
|
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210426213212239.PNG?x-oss-process=none,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1ViaXF1aXRvdXNUZWFt,size_16,color_FFFFFF,t_70#pic_center)
|
|
@ -0,0 +1,198 @@
|
||||||
|
# 从零开始构建矽璓工业物联操作系统:使用ARM架构的STM32F407-discovery开发板
|
||||||
|
|
||||||
|
[XiUOS](http://xuos.io/) (X Industrial Ubiquitous Operating System) 矽璓工业物联操作系统是一款面向工业物联场景的泛在操作系统,来自泛在操作系统研究计划。所谓泛在操作系统(UOS: Ubiquitous Operating Systems),是支持互联网时代人机物融合泛在计算应用模式的新型操作系统,是传统操作系统概念的泛化与延伸。在泛在操作系统技术体系中,不同的泛在计算设备和泛在应用场景需要符合各自特性的不同UOS,XiUOS即是面向工业物联场景的一种UOS,主要由一个极简的微型实时操作系统(RTOS)内核和其上的智能工业物联框架构成,支持工业物联网(IIoT: Industrial Internet of Things)应用。
|
||||||
|
|
||||||
|
## 开发环境搭建
|
||||||
|
|
||||||
|
### 推荐使用
|
||||||
|
|
||||||
|
**操作系统:** ubuntu18.04 [https://ubuntu.com/download/desktop](https://ubuntu.com/download/desktop)
|
||||||
|
更新`ubuntu 18.04`源的方法:(根据自身情况而定,可以不更改)
|
||||||
|
第一步:打开sources.list文件
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo vim /etc/apt/sources.list
|
||||||
|
```
|
||||||
|
|
||||||
|
第二步:将以下内容复制到sources.list文件
|
||||||
|
|
||||||
|
```bash
|
||||||
|
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
|
||||||
|
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
|
||||||
|
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
|
||||||
|
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
|
||||||
|
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
|
||||||
|
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
|
||||||
|
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
|
||||||
|
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
|
||||||
|
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
|
||||||
|
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
|
||||||
|
```
|
||||||
|
|
||||||
|
第三步:更新源和系统软件
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get upgrade
|
||||||
|
```
|
||||||
|
|
||||||
|
**开发工具推荐使用 VSCode ,VScode下载地址为:** VSCode [https://code.visualstudio.com/](https://code.visualstudio.com/),推荐下载地址为 [http://vscode.cdn.azure.cn/stable/3c4e3df9e89829dce27b7b5c24508306b151f30d/code_1.55.2-1618307277_amd64.deb](http://vscode.cdn.azure.cn/stable/3c4e3df9e89829dce27b7b5c24508306b151f30d/code_1.55.2-1618307277_amd64.deb)
|
||||||
|
|
||||||
|
### 依赖包安装
|
||||||
|
|
||||||
|
```bash
|
||||||
|
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 [https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos)
|
||||||
|
新建一个空文件夹并进入文件夹中,并下载源码,具体命令如下:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir test && cd test
|
||||||
|
git clone https://git.trustie.net/xuos/xiuos.git
|
||||||
|
```
|
||||||
|
|
||||||
|
打开源码文件包可以看到以下目录:
|
||||||
|
| 名称 | 说明 |
|
||||||
|
| ----------- | ---------- |
|
||||||
|
| application | 应用代码 |
|
||||||
|
| board | 板级支持包 |
|
||||||
|
| framework | 应用框架 |
|
||||||
|
| fs | 文件系统 |
|
||||||
|
| kernel | 内核源码 |
|
||||||
|
| resources | 驱动文件 |
|
||||||
|
| tool | 系统工具 |
|
||||||
|
使用VScode打开代码,具体操作步骤为:在源码文件夹下打开系统终端,输入`code .`即可打开VScode开发环境,如下图所示:
|
||||||
|
<div align= "center">
|
||||||
|
<img src = https://img-blog.csdnimg.cn/20210429154839715.jpg width =1000>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
### 裁减配置工具的下载
|
||||||
|
|
||||||
|
裁减配置工具:
|
||||||
|
**工具地址:** kconfig-frontends [https://forgeplus.trustie.net/projects/xuos/kconfig-frontends](https://forgeplus.trustie.net/projects/xuos/kconfig-frontends)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir kfrontends && cd kfrontends
|
||||||
|
git clone https://git.trustie.net/xuos/kconfig-frontends.git
|
||||||
|
```
|
||||||
|
|
||||||
|
下载源码后按以下步骤执行软件安装:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd kconfig-frontends
|
||||||
|
./xs_build.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### 编译工具链
|
||||||
|
|
||||||
|
ARM: arm-none-eabi(`gcc version 6.3.1`),默认安装到Ubuntu的/usr/bin/arm-none-eabi-,使用如下命令行下载
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install gcc-arm-none-eabi
|
||||||
|
```
|
||||||
|
|
||||||
|
# 在STM32F407-DISCOVERY上创建第一个应用 --helloworld
|
||||||
|
|
||||||
|
## 1. 简介
|
||||||
|
|
||||||
|
| 硬件 | 描述 |
|
||||||
|
| --------- | --------------------------------------------------------------------------- |
|
||||||
|
| 芯片型号 | Stm32F407VGT6 |
|
||||||
|
| CPU | arm cortex-m |
|
||||||
|
| 主频 | 168MHz |
|
||||||
|
| 片内SRAM | 192KB |
|
||||||
|
| 片上FLASH | 1MB |
|
||||||
|
| 外设 | -- |
|
||||||
|
| | ADC、DAC、USB、GPIO、UART、SPI、SDIO、RTC、CAN、DMA、MAC、I²C、WDT、Timer等 |
|
||||||
|
|
||||||
|
XiUOS板级驱动当前支持使用GPIO、I2C、LCD、USB、RTC、SPI、Timer、UART和WDT等。
|
||||||
|
|
||||||
|
## 2. 编译说明
|
||||||
|
|
||||||
|
### 编辑环境:`Ubuntu18.04`
|
||||||
|
|
||||||
|
### 编译工具链:`arm-none-eabi-gcc`
|
||||||
|
|
||||||
|
使用`VScode`打开工程的方法有多种,本文介绍一种快捷键,在项目目录下将`code .`输入终端即可打开目标项目
|
||||||
|
|
||||||
|
修改`applications`文件夹下`main.c`
|
||||||
|
在输出函数中写入 `Hello, world!!! \n Running on stm32f407-st-discovery`完成代码编辑。
|
||||||
|
|
||||||
|
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210428145204668.png#pic_center)
|
||||||
|
|
||||||
|
编译步骤:
|
||||||
|
|
||||||
|
1.在代码根目录下执行以下命令,生成配置文件
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make BOARD=stm32f407-st-discovery menuconfig
|
||||||
|
```
|
||||||
|
|
||||||
|
2.在menuconfig界面配置需要关闭和开启的功能,按回车键进入下级菜单,按Y键选中需要开启的功能,按N键选中需要关闭的功能,配置结束后保存并退出
|
||||||
|
|
||||||
|
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210426212955727.png?x-oss-process=none,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1ViaXF1aXRvdXNUZWFt,size_16,color_FFFFFF,t_70#pic_center)
|
||||||
|
|
||||||
|
3.继续执行以下命令,进行编译
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make BOARD=stm32f407-st-discovery
|
||||||
|
```
|
||||||
|
|
||||||
|
4.如果编译正确无误,会产生XiUOS_stm32f407-st-discovery.elf、XiUOS_stm32f407-st-discovery.bin文件。其中XiUOS_stm32f407-st-discovery.bin需要烧写到设备中进行运行。
|
||||||
|
|
||||||
|
## 3. 烧写及执行
|
||||||
|
|
||||||
|
将 BOARD=stm32f407-st-discovery开发板SWD经 st-link 转接到USB接口,然后使用st-flash工具进行烧写bin文件。
|
||||||
|
![在这里插入图片描述](https://img-blog.csdnimg.cn/2021042716353240.png?x-oss-process=none,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0FJSVRfVWJpcXVpdG91cw==,size_16,color_FFFFFF,t_70#pic_center)
|
||||||
|
|
||||||
|
### 烧写工具
|
||||||
|
|
||||||
|
ARM:ST-LINK(ST-LINK V2实物如图,可在购物网站搜索关键字购买)
|
||||||
|
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210427144736126.png#pic_center)
|
||||||
|
|
||||||
|
下载并以下执行命令以下命令安装st-link工具(本文使用v1.5.1版本),下载地址为:[http://101.36.126.201:8011/stlink.zip](http://101.36.126.201:8011/stlink.zip)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install libusb-dev
|
||||||
|
sudo apt install libusb-1.0-0-dev
|
||||||
|
sudo apt install cmake
|
||||||
|
cd stlink
|
||||||
|
make
|
||||||
|
cd build/Release && make install DESTDIR=_install
|
||||||
|
```
|
||||||
|
|
||||||
|
将生成的st-flash(在stlink/build/Release/bin文件夹下)复制到/usr/bin下就可使用了
|
||||||
|
|
||||||
|
代码根目录下执行st-flash工具烧录
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo st-flash write build/XiUOS_stm32f407-st-discovery.bin 0x8000000
|
||||||
|
```
|
||||||
|
|
||||||
|
此外,推荐用户使用putty作为终端工具,安装命令如下:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install putty
|
||||||
|
```
|
||||||
|
|
||||||
|
打开putty配置串口信息
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo puty
|
||||||
|
```
|
||||||
|
|
||||||
|
选择ttyUSB0(这个端口号根据具体情况而定),配置波特率为115200。
|
||||||
|
![在这里插入图片描述](https://img-blog.csdnimg.cn/2021042815015872.png?x-oss-process=none,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0FJSVRfVWJpcXVpdG91cw==,size_16,color_FFFFFF,t_70#pic_center)
|
||||||
|
|
||||||
|
注意:选择正确的终端端口号,最后可以执行以下命令,清除配置文件和编译生成的文件
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make BOARD=stm32f407-st-discovery distclean
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3.1 运行结果
|
||||||
|
|
||||||
|
如果编译 & 烧写无误,将会在串口终端上看到信息打印输出,(终端串口引脚为PB6、PB7)。
|
||||||
|
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210426213212239.PNG?x-oss-process=none,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1ViaXF1aXRvdXNUZWFt,size_16,color_FFFFFF,t_70#pic_center)
|