Update code structure

Signed-off-by: ygopenhm <ygopenhm@vyagoo.com>
Change-Id: Idcf733414bd89d006fc82c10e138706a59601f3c
This commit is contained in:
ygopenhm
2022-03-21 20:01:27 +08:00
parent 0c23e09390
commit ba11234870
30 changed files with 127 additions and 1416 deletions
Executable → Regular
+1 -2
View File
@@ -1,4 +1,3 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
@@ -174,4 +173,4 @@
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS
Executable
+36
View File
@@ -0,0 +1,36 @@
# device_board_seed
#### Description
This warehouse is used to place the content related to the seed open source board.
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create xxx branch
3. Commit your code
4. Create Pull Request
#### Gitee Feature
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/
Executable
+34
View File
@@ -0,0 +1,34 @@
# device_board_seed
#### 介绍
本仓用于放置seed开源板相关内容。
#### 软件架构
软件架构需参见device/soc/allwinner对应芯片readme。
#### 安装教程
安装教程请参见开发板readme。
#### 使用说明
请参见开发板readme。
#### 参与贡献
1. Fork 本仓库
2. 新建 xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
+56
View File
@@ -0,0 +1,56 @@
End User License Agreement
THIS END USER LICENSE AGREEMENT (“AGREEMENT”) IS A LEGAL AGREEMENT BETWEEN YOU (EITHER A SINGLE INDIVIDUAL, OR SINGLE LEGAL ENTITY) AND Shenzhen Allwinner Online Co., Ltd. (HERE AFTER REFERRED TO AS"AWOL") FOR THE USE OF THE SOFTWARE ACCOMPANYING THIS AGREEMENT. AWOL IS ONLY WILLING TO LICENSE THE SOFTWARE TO YOU ON CONDITION THAT YOU ACCEPT ALL OF THE TERMS IN THIS AGREEMENT. BY DOWNDOADING OR BY INSTALLING OR OTHERWISE USING OR COPYING THE SOFTWARE YOU INDICATE THAT YOU AGREE TO BE BOUND BY ALL OF THE TERMS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO THE TERMS OF THIS AGREEMENT,AWOL WILL NOT LICENSE THE SOFTWARE TO YOU AND YOU MAY NOT INSTALL, USE OR COPY THE SOFTWARE, AND YOU SHALL PROMPTLY DESTROY, DELETE, OR RETURN THE SOFTWARE TO YOUR SUPPLIER.
“SOFTWARE” means the software in object code provided under the terms of this Agreement.
Xiangzhou District,Zhuhai,China is the signing place of this Agreement.
1. GRANT OF LICENSE
In consideration of your agreement to abide by the following terms, and subject to the terms and conditions of this Agreement, AWOL hereby grants YOU, a non-transferable, non-exclusive, royalty-free, revocable, worldwide copyright license (without the right to sublicense) to internally use the SOFTWARE and to manufacture, have manufactured, or sell, supply or distribute any products which use or embody any of the SOFTWARE or any of the intellectual property rights therein.
All rights to the SOFTWARE and all intellectual property rights contained therein are reserved and shall remain the sole and exclusive property of AWOL . The SOFTWARE is licensed but not sold. Except as expressly licensed in Clause 1, in no event shall the license granted in this Clause 1 be construed as granting YOU expressly or by implication, estoppels or otherwise, licenses to any intellectual property rights, including but not limited to patent rights, copyrights, trademark or trade secret in the SOFTWARE.
2. RESTRICTIONS
YOU shall reproduce and not remove or obscure any notice incorporated by AWOL in the SOFTWARE to protect AWOLs intellectual property rights embodied therein.
YOU shall not decompile, disassemble, or reverse engineer the SOFTWARE.
YOU shall not distribute the SOFTWARE under an open source license as listed by the Open Source Initiative (a non-profit corporation whose website is www.opensource.org), or other license which requires the source code or object code of the SOFTWARE to be licensed or otherwise shared with any third party.
3. CONFLICT WITH OPEN SOURCE SOFTWARE LICENSE
The SOFTWARE may contain open source software. If the license applied on such open source software has conflict with this Agreement, the license applied on such open source software will prevail and apply to the open source software.
4. FEEDBACK
YOU may choose to provide suggestions, comments, feedback, ideas, modifications or know-how (whether in oral or written form) relating to the use of the SOFTWARE ("Feedback") to AWOL under the terms of this Agreement. YOU hereby grants to AWOL and its affiliates, under all of you and your affiliates (as applicable) intellectual property rights, a perpetual, irrevocable, royalty free, non-exclusive, worldwide license to (i) use, copy and modify the Feedback; (ii) sell, supply, or otherwise distribute the Feedback; (iii) design, have designed, manufacture, have manufactured, use, import, sell, and otherwise distribute and dispose of products that incorporate the Feedback; and (iv) sublicense (together with the rights to further sublicense) the rights granted in this paragraph to any third party.
5. NO WARRANTY
YOU AGREE THAT THE SOFTWARE IS PROVIDED BY AWOL ON AN "AS IS" BASIS. AWOL MAKES NO WARRANTY, EXPRESSED OR IMPLIED OR STATUTORY, WITH RESPECT TO ANY OF THE SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.
YOU EXPRESSLY ASSUME ALL LIABILITIES AND RISKS, FOR USE OR OPERATION OF THE SOFTWARE, INCLUDING WITHOUT LIMITATION, SOFTWARE APPLICATIONS DESIGNED OR INTENDED FOR MISSION CRITICAL APPLICATIONS, SUCH AS PACEMAKERS, WEAPONRY, AIRCRAFT NAVIGATION, FACTORY CONTROL SYSTEMS, ETC. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
6. NO LIABILITY
PLEASE NOTE THAT YOU SHOULD USE THE SOFTWARE AT YOUR OWN RISK.
IN NO EVENT SHALL AWOL BE LIABLE FOR ANY DIRECT OR INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE, WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHER LEGAL THEORY, EVEN IF AWOL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. EVEN IF THE SOFTWARE HAS ANY MATERIAL, VERIFIABLE, AND REPRODUCIBLE PROGRAM ERRORS, AWOL SHALL HAVE NO LIABILITY TO MODIFY SUCH ERRORS.
NOTWITHSTANDING ANYTHING TO THE CONTRARY CONTAINED IN THIS AGREEMENT, THE MAXIMUM LIABILITY OF AWOL TO YOU IN AGGREGATE FOR ALL CLAIMS MADE AGAINST AWOL IN CONTRACT TORT OR OTHERWISE UNDER OR IN CONNECTION WITH THE SUBJECT MATTER OF THIS AGREEMENT SHALL NOT EXCEED THE TOTAL OF SUMS RECEIVED BY AWOL FROM YOU FOR THIS AGREEMENT. THE EXISTENCE OF MORE THAN ONE CLAIM WILL NOT ENLARGE OR EXTEND THE LIMIT.
7. CONFIDENTIALITY
YOU acknowledge and agree that the SOFTWARE provided under this Agreement contain trade secrets and confidential material of AWOL and YOU agree to maintain all such information in confidence and apply security measures no less stringent than the measures which YOU apply to protect your own like information, but not less than a reasonable degree of care, to prevent their unauthorized disclosure and use. The period of confidentiality shall be indefinite. YOU agree not to use any such information other than in normal use of the SOFTWARE under the license granted in this Agreement.
8. TERM AND TERMINATION
This Agreement shall remain in force until terminated. AWOL may terminate this Agreement at any time with or without any cause. Upon termination of this Agreement, YOU shall immediately stop using the SOFTWARE and confidential information and destroy all copies of the SOFTWARE and confidential information in your possession, together with all documentation and related materials. The provisions of clauses 2, 3, 4, 5, 6, 78 and 9 shall survive termination of this Agreement.
9. GENERAL
Any provision of this Agreement which is prohibited or unenforceable in any jurisdiction shall be ineffective to the extent of such prohibition or unenforceability without affecting, impairing or invalidating the remaining provisions hereof.
The failure by AWOL to enforce any of the provisions of this Agreement, unless waived in writing, shall not constitute a waiver of AWOL's rights to enforce such provision or any other provision of this Agreement in the future.
This Agreement shall be governed by and construed in accordance with the laws of Peoples Republic of China, without reference to the principles of conflicts of laws. Any dispute arising out of or relating to this Agreement shall be submitted to the jurisdiction of the court of the signing place of this Agreement and the parties waive all objections to that jurisdiction and venue.
---------------------------------------------------------------------
Copyright (C) 2022 VYAGOO TECHNOLOGY Co., Ltd. All rights reserved.
-22
View File
@@ -1,22 +0,0 @@
# Copyright (C) 2021 XRADIO TECHNOLOGY CO., LTD. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
if (ohos_kernel_type == "liteos_m") {
import("//kernel/liteos_m/liteos.gni")
module_name = get_path_info(rebase_path("."), "name")
module_group(module_name) {
modules = [
"drivers"
]
}
}
-14
View File
@@ -1,14 +0,0 @@
# Copyright (C) 2021 XRADIO TECHNOLOGY CO., LTD. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
orsource "*/Kconfig.liteos_m.board"
-14
View File
@@ -1,14 +0,0 @@
# Copyright (C) 2021 XRADIO TECHNOLOGY CO., LTD. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
orsource "*/Kconfig.liteos_m.defconfig.board"
-36
View File
@@ -1,36 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 2021 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This is the configuration file template for OpenHarmony OSS Audit Tool, please copy it to your project root dir and modify it refer to OpenHarmony/tools_oat/README.
-->
<configuration>
<oatconfig>
<licensefile></licensefile>
<policylist>
<policy name="projectPolicy" desc="">
<policyitem type="copyright" name="Copyright (C) 2021 XRADIO TECHNOLOGY CO., LTD." path=".*" desc="original xradio 2021 copyright"/>
<policyitem type="license" name="Apache" path=".*" desc="xradio use apache 2.0 license"/>
</policy>
</policylist>
<filefilterlist>
<filefilter name="defaultFilter" desc="Files not to check">
<filteritem type="filename" name="*.pdf|*.xls|*.png" desc="desc files"/>
<filteritem type="filename" name="*.hcs" desc="config files"/>
</filefilter>
</filefilterlist>
</oatconfig>
</configuration>
-182
View File
@@ -1,182 +0,0 @@
# XR806_OpenHarmony开发板
* [介绍](#介绍)
* [快速入门](#快速入门)
* [相关仓](#相关仓)
## 介绍
### 芯片介绍
XR806是全志科技旗下子公司深圳全志科技有限公司研发设计的一款支持高集成度无线MCU芯片,支持**OpenHarmony轻量设置系统**。具有集成度高、硬件设计简单、BOM成本低、安全可靠等优点。可广泛满足 **智能家居、智慧楼宇、工业互联、儿童玩具、电子竞赛、极客DIY** 等领域的无线连接需求。
### 开发板介绍
#### 开发板概述
XR806_OpenHarmony开发板是基于XR806芯片设计开发的参考评估,板身集成了XR806芯片、无线/蓝牙双天线、供电系统、按钮及LED等,并引出了所有可用引脚,可供开发者进行方案评估、DIY或小规模产品研发使用。
#### 开发板外观图片
<img src="D:\1--git\XR806\device_board\device_board_allwinner_xr806\docs\img\image-readme-main.png" alt="mainview" style="zoom:50%;" />
#### 参数规格
| 对象 | 参数 |
| -------- | -------------------------------------- |
| 主控 | XR806AF2L |
| DDR | SIP 288KB SRAM. |
| 存储 | SIP 160KB Code ROM. SIP 16Mbit Flash. |
| 天线 | 板载WiFi/BT双天线,可共存。 |
| 按键 | reboot按键x1,功能按键 x1。 |
| 灯 | 红色电源指示灯 *1,蓝色可调节LED * 1。 |
| 供电 | Type-C 5V。 |
| 引脚 | 插针引脚 *9。 |
| 调试方式 | Type-C(已板载串口转USB芯片)。 |
| 晶振 | 外接40MHz晶振。 |
#### 关键特性
| 组件名 | 能力介绍 |
| -------------- | ------------------------------------------------------------ |
| WLAN服务 | 提供WLAN服务能力。包括:station和hotspot(正在支持中)模式的连接、断开、状态查询等。 |
| BLUETOOTH 服务 | 提供BLE MESH 等功能(正在支持中)。 |
| 模组外设控制 | 提供操作外设的能力。包括:I2C、I2S、ADC、UART、SPI、GPIO、PWM、FLASH等。 |
| 基础库 | 提供公共基础库能力。包括:文件操作、KV存储管理等。 |
| XTS | 提供OpenHarmony生态认证测试套件的集合能力。 |
| HDF | 提供OpenHarmony硬件配置驱动的能力。 |
| Kconfig | 提供内核配置能力。 |
#### 引脚定义
| 引脚序号 | IO name | Function0 | Function1 | Function2 | Function3 | Function4 | Function5 | Function6 | Function7 | Function8 | Function9 |
| -------- | ------- | --------- | --------- | ------------ | ----------- | --------- | -------------- | --------- | --------- | --------- | ---------- |
| 1 | VBAT | — | — | — | — | — | — | — | — | — | — |
| 2 | PA23 | Input | Output | DCXO_PUP_OUT | IR_RX | FEM_CTRL1 | FEM_CTRL2 | EINTA23 | Z | KEY_X7 | I2S_MCLK |
| 3 | PA22 | Input | Output | UART2_TX | CARD_DETECT | PWM3/ECT3 | SPI0_CLK | EINTA22 | Z | KEY_X6 | I2S_LRCLK |
| 4 | PA21 | Input | Output | UART2_RX | CARD_RST | PWM2/ECT2 | SPI0_CS0 | EINTA21 | Z | KEY_X5 | I2S_DO |
| 5 | PA20 | Input | Output | UART2_CTS | CARD_CLK | PWM1/ECT1 | SPI0_MISO | EINTA20 | Z | KEY_X4 | AUDIO_PWMN |
| 6 | PA19 | Input | Output | UART2_RTS | CARD_DATA | PWM0/ECT0 | SPI0_MOSI | EINTA19 | Z | KEY_X3 | AUDIO_PWMP |
| 7 | PA13 | Input | Output | ADC_CH3 | PWM5/ECT5 | I2S_DI | UART2_TX | EINTA13 | Z | KEY_Y5 | TWI0_SDA |
| 8 | PA12 | Input | Output | ADC_CH2 | PWM4/ECT4 | I2S_BCLK | IR_TX | EINTA12 | Z | KEY_Y4 | TWI0_SCL |
| 9 | PA11 | Input | Output | ADC_CH1 | SPI0_MISO | I2S_MCLK | UART1_TX | EINTA11 | Z | KEY_Y3 | IR_RX |
| 10 | VDD | — | — | — | — | — | — | — | — | — | — |
| 11 | GND | — | — | — | — | — | — | — | — | — | — |
| 12 | PB04 | Input | Output | SPI0_MOSI | PWM0/ECT0 | UART1_RTS | FLASH_MOSI/IO0 | EINTB4 | Z | KEY_Y12 | I2S_BCLK |
| 13 | PB06 | Input | Output | SPI0_CS0 | PWM2/ECT2 | UART1_RX | FLASH_CS0 | EINTB6 | Z | KEY_Y14 | I2S_DO |
| 14 | PB05 | Input | Output | SPI0_MISO | PWM1/ECT1 | UART1_CTS | FLASH_MISO/IO1 | EINTB5 | Z | KEY_Y13 | I2S_DI |
| 15 | PB07 | Input | Output | SPI0_CLK | PWM3/ECT3 | UART1_TX | FLASH_CLK | EINTB7 | Z | KEY_Y15 | I2S_LRCLK |
| 16 | PB03 | Input | Output | UART0_RTS | JTAG_TDI | PWM7/ECT7 | FLASH_HOLD/IO3 | EINTB3 | Z | KEY_Y11 | SWD_TCK |
| 17 | PB15 | Input | Output | UART1_RX | UART2_RX | TWI1_SDA | UART0_RTS | EINTB15 | Z | KEY_Y1 | PWM6/ECT6 |
| 18 | PB14 | Input | Output | UART1_TX | UART2_TX | TWI1_SCL | UART0_CTS | EINTB14 | Z | KEY_Y0 | PWM5/ECT5 |
- [更多硬件资料](./docs/硬件资料)
## 快速入门
### 新建工程
```shell
cd device/board/allwinner #进入指定代码目录
mkdir demo #创建demo文件夹
```
修改device/board/allwinner/BUILD.gn。
```
if (ohos_kernel_type == "liteos_m") {
import("//kernel/liteos_m/liteos.gni")
module_name = get_path_info(rebase_path("."), "name")
module_group(module_name) {
modules = [
"drivers",
"demo" #创建指定文件夹
]
}
}
```
新增编译脚本。
```
cd demo
touch BUILD.gn
vim BUILD.gn #打开并修改BUILD.gn
```
修改BUILD.gn内容如下。
```
import("//kernel/liteos_m/liteos.gni")
module_name = get_path_info(rebase_path("."), "name")
kernel_module(module_name) {
sources = [
"main.c",
]
}
```
新建文件main.c,并修改内容如下。
```
#include <stdio.h>
#include "ohos_init.h"
#include "os_time.h"
#include "os_thread.h"
static OS_Thread_t g_main_thread;
static void MainThread(void *arg)
{
while (1) {
printf("hello world!\n");
OS_MSleep(1000);
}
}
void HelloTestMain(void)
{
printf("Wifi Test Start\n");
if (OS_ThreadCreate(&g_main_thread, "MainThread", MainThread, NULL,
OS_THREAD_PRIO_APP, 4 * 1024) != OS_OK) {
printf("[ERR] Create MainThread Failed\n");
}
}
SYS_RUN(HelloTestMain);
```
上述步骤完成后,编译,生成固件是out/xradio/xradio_wifi_demo/xr_system.img
```
hb build -f #编译命令
```
### 固件烧录
烧录软件为device/soc/allwinner/xradio/xr806/toolsphoenixMC_v3.1.21014b.exe
### 烧录软件界面
![主页面](D:\1--git\XR806\device_board\device_board_allwinner_xr806\docs\img\image-flash-mainView.png)
### 操作步骤
1. PC安装CP2102驱动。([点击下载](https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers))
2. 串口连接:通过USB-typeC数据线连接开发板和PC。
3. 串口设置:点击左上角的“刷新”按钮可刷新已连接串口设备列表,勾选开发板对应的COM口。串口波特率最大支持3000000,波特率越高,烧录速度越快。如果高波特率下容易出现烧录失败,可检查串口线、串口驱动是否稳定支持该波特率;或者降低波特率进行尝试。为了避免烧录速度过慢,建议波特率选择大于等于921600。
4. 固件选择:点击“选择固件”按钮选择需要烧录的固件文件(xr_system.img),固件信息栏会显示出当前固件的详细信息。另外,通过拖拽方式将固件直接拖入工具界面也可以达到同样的效果。
5. 开启一键烧录功能:点击“设置”按钮调出设置界面,如下图勾选“硬件复位烧写模式”
![烧录设置](D:\1--git\XR806\device_board\device_board_allwinner_xr806\docs\img\image-flash-setView.png)
6. 启动烧录:点击“升级固件”按钮启动固件烧录。烧录状态栏显示当前选定串口对应设备的烧录进度和状态。当烧录成功时,进度条会达到100%的进度并显示为绿色;当烧录失败时,进度条显示为红色并报告错误。
7. 复位设备:固件烧录成功后,开启PC串口调试工具(115200,N,8,1),硬件复位开发板(按下复位按钮),会看到每间隔1秒钟打印一次"hello world"!。
## 相关仓
[device/soc/allwinner](https://gitee.com/openharmony-sig/device_soc_allwinner_xr806)
[vendor/allwinner](https://gitee.com/openharmony-sig/vendor_allwinner)
-182
View File
@@ -1,182 +0,0 @@
# XR806_OpenHarmony开发板
* [介绍](#介绍)
* [快速入门](#快速入门)
* [相关仓](#相关仓)
## 介绍
### 芯片介绍
XR806是全志科技旗下子公司深圳全志科技有限公司研发设计的一款支持高集成度无线MCU芯片,支持**OpenHarmony轻量设置系统**。具有集成度高、硬件设计简单、BOM成本低、安全可靠等优点。可广泛满足 **智能家居、智慧楼宇、工业互联、儿童玩具、电子竞赛、极客DIY** 等领域的无线连接需求。
### 开发板介绍
#### 开发板概述
XR806_OpenHarmony开发板是基于XR806芯片设计开发的参考评估,板身集成了XR806芯片、无线/蓝牙双天线、供电系统、按钮及LED等,并引出了所有可用引脚,可供开发者进行方案评估、DIY或小规模产品研发使用。
#### 开发板外观图片
<img src="docs/img/image-readme-main.png" alt="mainview" style="zoom:50%;" />
#### 参数规格
| 对象 | 参数 |
| -------- | -------------------------------------- |
| 主控 | XR806AF2L |
| DDR | SIP 288KB SRAM. |
| 存储 | SIP 160KB Code ROM. SIP 16Mbit Flash. |
| 天线 | 板载WiFi/BT双天线,可共存。 |
| 按键 | reboot按键x1,功能按键 x1。 |
| 灯 | 红色电源指示灯 *1,蓝色可调节LED * 1。 |
| 供电 | Type-C 5V。 |
| 引脚 | 插针引脚 *9。 |
| 调试方式 | Type-C(已板载串口转USB芯片)。 |
| 晶振 | 外接40MHz晶振。 |
#### 关键特性
| 组件名 | 能力介绍 |
| -------------- | ------------------------------------------------------------ |
| WLAN服务 | 提供WLAN服务能力。包括:station和hotspot(正在支持中)模式的连接、断开、状态查询等。 |
| BLUETOOTH 服务 | 提供BLE MESH 等功能(正在支持中)。 |
| 模组外设控制 | 提供操作外设的能力。包括:I2C、I2S、ADC、UART、SPI、GPIO、PWM、FLASH等。 |
| 基础库 | 提供公共基础库能力。包括:文件操作、KV存储管理等。 |
| XTS | 提供OpenHarmony生态认证测试套件的集合能力。 |
| HDF | 提供OpenHarmony硬件配置驱动的能力。 |
| Kconfig | 提供内核配置能力。 |
#### 引脚定义
| 引脚序号 | IO name | Function0 | Function1 | Function2 | Function3 | Function4 | Function5 | Function6 | Function7 | Function8 | Function9 |
| -------- | ------- | --------- | --------- | ------------ | ----------- | --------- | -------------- | --------- | --------- | --------- | ---------- |
| 1 | VBAT | — | — | — | — | — | — | — | — | — | — |
| 2 | PA23 | Input | Output | DCXO_PUP_OUT | IR_RX | FEM_CTRL1 | FEM_CTRL2 | EINTA23 | Z | KEY_X7 | I2S_MCLK |
| 3 | PA22 | Input | Output | UART2_TX | CARD_DETECT | PWM3/ECT3 | SPI0_CLK | EINTA22 | Z | KEY_X6 | I2S_LRCLK |
| 4 | PA21 | Input | Output | UART2_RX | CARD_RST | PWM2/ECT2 | SPI0_CS0 | EINTA21 | Z | KEY_X5 | I2S_DO |
| 5 | PA20 | Input | Output | UART2_CTS | CARD_CLK | PWM1/ECT1 | SPI0_MISO | EINTA20 | Z | KEY_X4 | AUDIO_PWMN |
| 6 | PA19 | Input | Output | UART2_RTS | CARD_DATA | PWM0/ECT0 | SPI0_MOSI | EINTA19 | Z | KEY_X3 | AUDIO_PWMP |
| 7 | PA13 | Input | Output | ADC_CH3 | PWM5/ECT5 | I2S_DI | UART2_TX | EINTA13 | Z | KEY_Y5 | TWI0_SDA |
| 8 | PA12 | Input | Output | ADC_CH2 | PWM4/ECT4 | I2S_BCLK | IR_TX | EINTA12 | Z | KEY_Y4 | TWI0_SCL |
| 9 | PA11 | Input | Output | ADC_CH1 | SPI0_MISO | I2S_MCLK | UART1_TX | EINTA11 | Z | KEY_Y3 | IR_RX |
| 10 | VDD | — | — | — | — | — | — | — | — | — | — |
| 11 | GND | — | — | — | — | — | — | — | — | — | — |
| 12 | PB04 | Input | Output | SPI0_MOSI | PWM0/ECT0 | UART1_RTS | FLASH_MOSI/IO0 | EINTB4 | Z | KEY_Y12 | I2S_BCLK |
| 13 | PB06 | Input | Output | SPI0_CS0 | PWM2/ECT2 | UART1_RX | FLASH_CS0 | EINTB6 | Z | KEY_Y14 | I2S_DO |
| 14 | PB05 | Input | Output | SPI0_MISO | PWM1/ECT1 | UART1_CTS | FLASH_MISO/IO1 | EINTB5 | Z | KEY_Y13 | I2S_DI |
| 15 | PB07 | Input | Output | SPI0_CLK | PWM3/ECT3 | UART1_TX | FLASH_CLK | EINTB7 | Z | KEY_Y15 | I2S_LRCLK |
| 16 | PB03 | Input | Output | UART0_RTS | JTAG_TDI | PWM7/ECT7 | FLASH_HOLD/IO3 | EINTB3 | Z | KEY_Y11 | SWD_TCK |
| 17 | PB15 | Input | Output | UART1_RX | UART2_RX | TWI1_SDA | UART0_RTS | EINTB15 | Z | KEY_Y1 | PWM6/ECT6 |
| 18 | PB14 | Input | Output | UART1_TX | UART2_TX | TWI1_SCL | UART0_CTS | EINTB14 | Z | KEY_Y0 | PWM5/ECT5 |
- [更多硬件资料](./docs/硬件资料)
## 快速入门
### 新建工程
```shell
cd device/board/allwinner #进入指定代码目录
mkdir demo #创建demo文件夹
```
修改device/board/allwinner/BUILD.gn。
```
if (ohos_kernel_type == "liteos_m") {
import("//kernel/liteos_m/liteos.gni")
module_name = get_path_info(rebase_path("."), "name")
module_group(module_name) {
modules = [
"drivers",
"demo" #创建指定文件夹
]
}
}
```
新增编译脚本。
```
cd demo
touch BUILD.gn
vim BUILD.gn #打开并修改BUILD.gn
```
修改BUILD.gn内容如下。
```
import("//kernel/liteos_m/liteos.gni")
module_name = get_path_info(rebase_path("."), "name")
kernel_module(module_name) {
sources = [
"main.c",
]
}
```
新建文件main.c,并修改内容如下。
```
#include <stdio.h>
#include "ohos_init.h"
#include "os_time.h"
#include "os_thread.h"
static OS_Thread_t g_main_thread;
static void MainThread(void *arg)
{
while (1) {
printf("hello world!\n");
OS_MSleep(1000);
}
}
void HelloTestMain(void)
{
printf("Wifi Test Start\n");
if (OS_ThreadCreate(&g_main_thread, "MainThread", MainThread, NULL,
OS_THREAD_PRIO_APP, 4 * 1024) != OS_OK) {
printf("[ERR] Create MainThread Failed\n");
}
}
SYS_RUN(HelloTestMain);
```
上述步骤完成后,编译,生成固件是out/xradio/xradio_wifi_demo/xr_system.img
```
hb build -f #编译命令
```
### 固件烧录
烧录软件为device/soc/allwinner/xradio/xr806/toolsphoenixMC_v3.1.21014b.exe
### 烧录软件界面
![主页面](./docs/img/image-flash-mainView.png)
### 操作步骤
1. PC安装CP2102驱动。([点击下载](https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers))
2. 串口连接:通过USB-typeC数据线连接开发板和PC。
3. 串口设置:点击左上角的“刷新”按钮可刷新已连接串口设备列表,勾选开发板对应的COM口。串口波特率最大支持3000000,波特率越高,烧录速度越快。如果高波特率下容易出现烧录失败,可检查串口线、串口驱动是否稳定支持该波特率;或者降低波特率进行尝试。为了避免烧录速度过慢,建议波特率选择大于等于921600。
4. 固件选择:点击“选择固件”按钮选择需要烧录的固件文件(xr_system.img),固件信息栏会显示出当前固件的详细信息。另外,通过拖拽方式将固件直接拖入工具界面也可以达到同样的效果。
5. 开启一键烧录功能:点击“设置”按钮调出设置界面,如下图勾选“硬件复位烧写模式”
![烧录设置](./docs/img/image-flash-setView.png)
6. 启动烧录:点击“升级固件”按钮启动固件烧录。烧录状态栏显示当前选定串口对应设备的烧录进度和状态。当烧录成功时,进度条会达到100%的进度并显示为绿色;当烧录失败时,进度条显示为红色并报告错误。
7. 复位设备:固件烧录成功后,开启PC串口调试工具(115200,N,8,1),硬件复位开发板(按下复位按钮),会看到每间隔1秒钟打印一次"hello world"!。
## 相关仓
[device/soc/allwinner](https://gitee.com/openharmony-sig/device_soc_allwinner_xr806)
[vendor/allwinner](https://gitee.com/openharmony-sig/vendor_allwinner)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 461 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
-22
View File
@@ -1,22 +0,0 @@
# Copyright (C) 2021 XRADIO TECHNOLOGY CO., LTD. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//drivers/adapter/khdf/liteos_m/hdf.gni")
module_name = get_path_info(rebase_path("."), "name")
hdf_driver(module_name) {
hcs_sources = ["${module_name}.hcs"]
visibility += [
".",
]
}
-56
View File
@@ -1,56 +0,0 @@
root {
module = "xradio,xr806";
device_info {
match_attr = "hdf_manager";
template host {
hostName = "";
priority = 100;
template device {
template deviceNode {
policy = 0;
priority = 100;
preload = 0;
permission = 0664;
moduleName = "";
serviceName = "";
deviceMatchAttr = "";
}
}
}
platform :: host {
hostName = "platform_host";
priority = 50;
device_gpio :: device {
gpio0 :: deviceNode {
policy = 2;
priority = 100;
moduleName = "XRADIO_GPIO";
serviceName = "HDF_PLATFORM_GPIO";
deviceMatchAttr = "gpio_config";
}
}
device_i2c :: device {
i2c_manager :: deviceNode {
policy = 2;
priority = 50;
moduleName = "HDF_PLATFORM_I2C_MANAGER";
serviceName = "HDF_PLATFORM_I2C_MANAGER";
}
i2c0 :: deviceNode {
policy = 0;
priority = 100;
moduleName = "XRADIO_I2C";
serviceName = "";
deviceMatchAttr = "i2c0_config";
}
i2c1 :: deviceNode {
policy = 0;
priority = 100;
moduleName = "XRADIO_I2C";
serviceName = "";
deviceMatchAttr = "i2c1_config";
}
}
}
}
}
-53
View File
@@ -1,53 +0,0 @@
#include "device_info.hcs"
root {
platform {
gpio_config {
match_attr = "gpio_config";
/*
格式说明:
pinport : 0portA1portB
pinnum : 根据实际选择
driving :驱动能力范围 [0,1,2,3]
mode :0输入,1输出,6中断,7禁止使用
pull : 0悬空,1上拉,2下拉
*/
pinport = 0;
pinnum = 21;
driving = 1;
mode = 1;
pull = 0;
}
i2c_config {
i2c0 {
/*
格式说明:
addrMode : 0地址占用7位,1地址占用10位
clockFreq : 时钟波特率
*/
match_attr = "i2c0_config";
IIC_ID = 0;
addrMode = 0;
clockFreq = 200000;
}
}
adc_config {
adc0 {
/*
格式说明:
work_clk : 0高速时钟,1低速时钟
delay : 首次覆盖延迟
vref_mode : 0内部参考,输入范围0~1.4,1内部参考,输入范围0~2.52VDD_IO作为参考电压
mode : 0单次采样,1单次循环采样,2连续采样,3多通道采样
irq_mode : 0直接获取,1使用中断获取
*/
match_attr = "adc0_config";
work_clk = 0;
delay = 10;
suspend_bypass = 0;
vref_mode = 1;
mode = 2;
irq_mode = 0;
}
}
}
}
-16
View File
@@ -1,16 +0,0 @@
# Copyright (C) 2021 XRADIO TECHNOLOGY CO., LTD. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
config BOARD_XRxx
bool "select board XRxx"
depends on SOC_XR806 || SOC_XR872
@@ -1,19 +0,0 @@
# Copyright (C) 2021 XRADIO TECHNOLOGY CO., LTD. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
if BOARD_XRxx
config BOARD
string
default "XRxx"
endif # BOARD_XRxx
-18
View File
@@ -1,18 +0,0 @@
# Copyright (C) 2021 XRADIO TECHNOLOGY CO., LTD. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# config PROJECT
# string "Projects Selected"
# default ""
# help
# [test/driver_test demo/wlan_demo examples/uart ...] Projects Selsected
-75
View File
@@ -1,75 +0,0 @@
# Copyright (C) 2021 XRADIO TECHNOLOGY CO., LTD. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Kernel type, e.g. "linux", "liteos_a", "liteos_m".
kernel_type = "liteos_m"
# Kernel version.
kernel_version = ""
# Board CPU type, e.g. "cortex-a7", "riscv32".
board_cpu = "cortex-m33"
# Board arch, e.g. "armv7-a", "rv32imac".
board_arch = ""
# Toolchain name used for system compiling.
# E.g. gcc-arm-none-eabi, arm-linux-harmonyeabi-gcc, ohos-clang, riscv32-unknown-elf.
# Note: The default toolchain is "ohos-clang". It's not mandatory if you use the default toochain.
board_toolchain = "arm-none-eabi-gcc"
# The toolchain path instatlled, it's not mandatory if you have added toolchian path to your ~/.bashrc.
board_toolchain_path = ""
# Compiler prefix.
board_toolchain_prefix = "/home/PDC-XRseries/tools/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-"
# Compiler type, "gcc" or "clang".
board_toolchain_type = "gcc"
# Board related common compile flags.
board_cflags = [
"-mcpu=cortex-m33",
"-mtune=cortex-m33",
"-march=armv8-m.main+dsp",
"-mfpu=fpv5-sp-d16",
"-mfloat-abi=softfp",
"-mcmse",
"-mthumb",
"-fno-common",
"-fno-exceptions",
"-ffunction-sections",
"-fdata-sections",
"-fomit-frame-pointer",
"-includexr_config.h",
"-includecommon/prj_conf_opt.h",
"-DCONFIG_CHIP_ARCH_VER=3",
"-DCONFIG_ARCH_APP_CORE",
"-DCONFIG_CPU_CM33F",
]
board_cxx_flags = []
board_ld_flags = []
# Board adapter dir for OHOS components.
board_adapter_dir = "//device/soc/allwinner/xradio/adapter"
board_include_dirs = [
"//utils/native/lite/include",
]
# Sysroot path.
board_configed_sysroot = ""
# Board storage type, it used for file system generation.
storage_type = ""