From d23d7a4a14471254ee608307d707baad008ceece Mon Sep 17 00:00:00 2001 From: lidongshan Date: Tue, 30 Nov 2021 16:39:46 +0800 Subject: [PATCH] add goodix gr5515_sk board base code Signed-off-by: zounan --- BUILD.gn | 24 +++ Kconfig.liteos_m.boards | 15 ++ Kconfig.liteos_m.defconfig.boards | 14 ++ LICENSE | 201 +++++++++++++++++++++ README.en.md | 2 +- README.md | 147 ++++++++++++--- drivers/BUILD.gn | 19 ++ gr5515_sk/BUILD.gn | 20 ++ gr5515_sk/Kconfig.liteos_m.board | 21 +++ gr5515_sk/Kconfig.liteos_m.defconfig.board | 19 ++ gr5515_sk/gr5515_sk_defconfig | 16 ++ gr5515_sk/liteos_m/BUILD.gn | 19 ++ gr5515_sk/liteos_m/config.gni | 181 +++++++++++++++++++ hcs/BUILD.gn | 19 ++ hcs/gr5515_sk.hcs | 17 ++ 15 files changed, 703 insertions(+), 31 deletions(-) create mode 100755 BUILD.gn create mode 100755 Kconfig.liteos_m.boards create mode 100755 Kconfig.liteos_m.defconfig.boards create mode 100755 LICENSE mode change 100644 => 100755 README.en.md mode change 100644 => 100755 README.md create mode 100755 drivers/BUILD.gn create mode 100755 gr5515_sk/BUILD.gn create mode 100755 gr5515_sk/Kconfig.liteos_m.board create mode 100755 gr5515_sk/Kconfig.liteos_m.defconfig.board create mode 100755 gr5515_sk/gr5515_sk_defconfig create mode 100755 gr5515_sk/liteos_m/BUILD.gn create mode 100755 gr5515_sk/liteos_m/config.gni create mode 100755 hcs/BUILD.gn create mode 100755 hcs/gr5515_sk.hcs diff --git a/BUILD.gn b/BUILD.gn new file mode 100755 index 0000000..912a017 --- /dev/null +++ b/BUILD.gn @@ -0,0 +1,24 @@ +# Copyright (c) 2021 GOODIX. +# 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 = [ + "gr5515_sk", + "drivers", + "hcs", + ] + } +} diff --git a/Kconfig.liteos_m.boards b/Kconfig.liteos_m.boards new file mode 100755 index 0000000..3a5c3d0 --- /dev/null +++ b/Kconfig.liteos_m.boards @@ -0,0 +1,15 @@ +# Copyright (c) 2021 GOODIX. +# 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" + diff --git a/Kconfig.liteos_m.defconfig.boards b/Kconfig.liteos_m.defconfig.boards new file mode 100755 index 0000000..6c3a8f4 --- /dev/null +++ b/Kconfig.liteos_m.defconfig.boards @@ -0,0 +1,14 @@ +# Copyright (c) 2021 GOODIX. +# 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" diff --git a/LICENSE b/LICENSE new file mode 100755 index 0000000..29f81d8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/README.en.md b/README.en.md old mode 100644 new mode 100755 index 82b755a..7c3f651 --- a/README.en.md +++ b/README.en.md @@ -1,4 +1,4 @@ -# device_board_goodix +# device_board_fnlink #### Description {**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 960c714..fcdfece --- a/README.md +++ b/README.md @@ -1,39 +1,126 @@ -# device_board_goodix +# GR5515 Starter Kit -#### 介绍 -{**以下是 Gitee 平台说明,您可以替换此简介** -Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} +## 介绍 -#### 软件架构 -软件架构说明 +GR5515 Starter Kit(以下简称GR5515 SK)套件是基于GR551x芯片(支持Bluetooth 5.1)设计的开发平台,包含Starter Kit开发板(以下简称GR5515 SK板)、原理图和使用指南。用户可以在该平台上熟悉GR551x开发工具以及快速搭建自己的产品原型并验证相关功能。 + +开发板外观如下图所示: + +![开发板外观](https://docs.goodix.com/zh/docimg/gr5515_starter_kit_user_guide/190/gr5515_starter_kit_V1.7/zh//images/board.png) + +开发板硬件布局如下图所示: + +![开发板硬件布局上](https://docs.goodix.com/zh/docimg/gr5515_starter_kit_user_guide/190/gr5515_starter_kit_V1.7/zh//images/board_top.svg) + +![开发板硬件布局下](https://docs.goodix.com/zh/docimg/gr5515_starter_kit_user_guide/190/gr5515_starter_kit_V1.7/zh//images/board_bot.svg) + +开发板功能框图如下图所示: + +![开发板硬件功能框图](https://docs.goodix.com/zh/docimg/gr5515_starter_kit_user_guide/190/gr5515_starter_kit_V1.7/zh//images/board_blo_dia.svg) -#### 安装教程 +## 开发板功能 +* 支持Bluetooth 5.1的单模低功耗蓝牙SoC +* 多功能按键和LED指示灯 +* 支持Arduino模块插接接口,IO电压可以通过level shift灵活配置 +* 支持调试功能的SEGGER J-Link OB +* UART转USB接口 +* Micro USB接口连接PC +* 1.44寸TFT彩色显示屏 +* 板上集成QSPI Flash -1. xxxx -2. xxxx -3. xxxx +## 开发板规格 -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request +| 器件类别 | 开发板 | +| ---------- | -------------------------------- | +| CPU | ARM Cortex-M4 (64Mhz) | +| RAM | 256KB SRAM | +| Flash | 1MB片内Flash + 8MB SPI Flash | +| GPIO | 45 | +| I2C | 2 | +| I2S | 2 | +| UART | 2 | +| SPI | 2 | +| PWM | 6 | +| LED | 2 | +| Debug | J-Link、CDC UART | +| ADC | 5channel 13bit | +| Display | 1.44寸TFT彩色 | +| 按键 | up、down、left、right、ok、power | -#### 特技 +## 关键特性 +| 组件名 | 能力介绍 | +| --------------- | ------------------------------------------------------------------------------------------ | +| BLE 服务 | 提供蓝牙 BLE 功能。 | +| 模组外设控制 | 提供操作外设的能力。包括:I2C、I2S、ADC、UART、SPI、GPIO、PWM、FLASH等。 | +| 分布式软总线 | 在OpenHarmony分布式网络中,提供设备被发现、数据传输的能力。 | +| 设备安全绑定 | 提供在设备互联场景中,数据在设备之间的安全流转的能力。 | +| 基础加解密 | 提供密钥管理、加解密等能力。 | +| 系统服务管理 | 系统服务管理基于面向服务的架构,提供了OpenHarmony统一化的系统服务开发框架。 | +| 启动引导 | 提供系统服务的启动入口标识。在系统服务管理启动时,调用boostrap标识的入口函数,并启动系统服务。 | +| 基础库 | 提供公共基础库能力。包括:文件操作、KV存储管理等。 | +| XTS | 提供OpenHarmony生态认证测试套件的集合能力。 | +| HDF | 提供OpenHarmony硬件配置驱动的能力。 | +| Kconfig | 提供内核配置能力。 | + + +## 引脚定义 + +参考datasheet: [GR5515RGBD BGA68引脚定义](https://docs.goodix.com/zh/online/detail/gr551x_datasheet_brief/V1.7/7a02161fefa917a1b63f3d5a8338e879) + +## 搭建开发环境 + +### 系统要求 + +系统要求基于Cortex-m4的liteos_m内核操作系统,采用arm-none-eabi-gcc 10.2.1版本toolchain,提供256KB内存和1MB flash系统配置。 + +OpenHarmony基于Goodix GR5515RGBD芯片的GR5515 Starter Kit开发板,依赖liteos_m内核,内核依赖cortex-m4架构配置,编译依赖arm官方的arm-none-eabi-gcc 10.2.1版本。 + +OpenHarmony需要按照[官方文档](https://gitee.com/openharmony-sig/devboard_device_goodix_gr551x/blob/master/README.md)介绍安装环境, 然后编译出烧录包,按照文档介绍烧录。 + +### 工具要求 +ubuntu 18.04编译,windows10系统烧录。 + +1. Ubuntu18.04系统安装 +`sudo apt-get install build-essential gcc g++ make zlib* libffi-dev e2fsprogs pkg-config flex bison perl bc openssl libssl-dev libelf-dev libc6-dev-amd64 binutils binutils-dev libdwarf-dev u-boot-tools mtd-utils gcc-arm-linux-gnueabi` + +2. Ubuntu18.04安装python3和pip3 +`python3 -m pip install --user ohos-build` + +3. Ubuntu18.04 配置arm-none-eabi-gcc 10.2.1 + +下载网站:https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads + +选择:gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 +下载解压到指定目录,然后通过bashrc配置环境变量。 + +### 搭建过程 + +参考 [环境搭建步骤](https://gitee.com/openharmony-sig/devboard_device_goodix_gr551x/blob/master/README.md) + +## 编译调试 + +参考 [编译调试步骤](https://gitee.com/openharmony-sig/devboard_device_goodix_gr551x/blob/master/README.md) + + +## 首个示例 + +代码默认有两个示例: +1. [BLE示例](https://gitee.com/openharmony-sig/devboard_vendor_goodix_gr5515_sk_basic/tree/master/gr5515_sk_iotlink_demo) +2. [XTS测试示例](https://gitee.com/openharmony-sig/devboard_vendor_goodix_gr5515_sk_basic/tree/master/gr5515_sk_xts_demo) + +## 参考资源 + +为了更好的使用GR5515 Starter Kit套件,建议参考下表相关资料。 + +| 名称 | 描述 | +| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| GR5515 Starter Kit用户指南 | 介绍GR5515 Starter Kit套件使用方法: [《GR5515 Starter Kit用户指南》]( https://docs.goodix.com/zh/online/detail/gr5515_starter_kit_user_guide/V1.7/42a03ba92cad1d63afd9baa8bb8c37df) | +| GR551x开发者指南 | GR551x软硬件介绍、快速使用及资源总览: [《GR551x开发者指南》]( https://docs.goodix.com/zh/online/detail/gr551x_develop_guide/V2.3/27f7d503bcd7ad1d63fa5b316b3bde4f) | +| J-Link用户指南 | J-Link使用说明:www.segger.com/downloads/jlink/UM08001_JLink.pdf | +| GR5515-SK-BASIC-RevC | GR5515 Starter Kit开发板原理图:[《GR5515-SK-BASIC-RevC.pdf》]( https://product.goodix.com/zh/docview/GR5515-SK-BASIC-RevC_Rev.1.5?objectId=100&objectType=document&version=133) | + +## 联系 +https://www.goodix.com -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/) diff --git a/drivers/BUILD.gn b/drivers/BUILD.gn new file mode 100755 index 0000000..93e94c7 --- /dev/null +++ b/drivers/BUILD.gn @@ -0,0 +1,19 @@ +# Copyright (c) 2021 GOODIX. +# 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") + kernel_module(module_name) { + } +} diff --git a/gr5515_sk/BUILD.gn b/gr5515_sk/BUILD.gn new file mode 100755 index 0000000..133055a --- /dev/null +++ b/gr5515_sk/BUILD.gn @@ -0,0 +1,20 @@ +# Copyright (c) 2021 GOODIX. +# 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 = [ "liteos_m" ] + } +} diff --git a/gr5515_sk/Kconfig.liteos_m.board b/gr5515_sk/Kconfig.liteos_m.board new file mode 100755 index 0000000..f75f688 --- /dev/null +++ b/gr5515_sk/Kconfig.liteos_m.board @@ -0,0 +1,21 @@ +# Copyright (c) 2021 GOODIX. +# 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_GR5515_SK + bool "select board GR5515_SK" + depends on SOC_GR551x + +config LFS_MAX_BLOCK_COUNT + int "Number of Flash sectors allocated by Littlefs" + default 60 + depends on SOC_GR551x \ No newline at end of file diff --git a/gr5515_sk/Kconfig.liteos_m.defconfig.board b/gr5515_sk/Kconfig.liteos_m.defconfig.board new file mode 100755 index 0000000..fa0fb0b --- /dev/null +++ b/gr5515_sk/Kconfig.liteos_m.defconfig.board @@ -0,0 +1,19 @@ +# Copyright (c) 2021 GOODIX. +# 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_GR5515_SK +config BOARD + string + default "gr5515_sk" +endif # BOARD_GR5515_SK + diff --git a/gr5515_sk/gr5515_sk_defconfig b/gr5515_sk/gr5515_sk_defconfig new file mode 100755 index 0000000..7d4309a --- /dev/null +++ b/gr5515_sk/gr5515_sk_defconfig @@ -0,0 +1,16 @@ +# Copyright (c) 2021 GOODIX. +# 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. + +LOSCFG_BOARD_GR5515_SK=y +LOSCFG_SOC_SERIES_GR551x=y +LOSCFG_SOC_GR551x=y \ No newline at end of file diff --git a/gr5515_sk/liteos_m/BUILD.gn b/gr5515_sk/liteos_m/BUILD.gn new file mode 100755 index 0000000..124ed9d --- /dev/null +++ b/gr5515_sk/liteos_m/BUILD.gn @@ -0,0 +1,19 @@ +# Copyright (c) 2021 GOODIX. +# 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("//kernel/liteos_m/liteos.gni") + +module_name = get_path_info(rebase_path("."), "name") +kernel_module(module_name) { + deps = [ "$product_path/hdf_config:hdf_hcs" ] +} diff --git a/gr5515_sk/liteos_m/config.gni b/gr5515_sk/liteos_m/config.gni new file mode 100755 index 0000000..e0d5ea7 --- /dev/null +++ b/gr5515_sk/liteos_m/config.gni @@ -0,0 +1,181 @@ +# Copyright (c) 2021 GOODIX. +# 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 = "3.0.0" + +# Board CPU type, e.g. "cortex-a7", "riscv32". +board_cpu = "cortex-m4" + +# 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" + +use_board_toolchain = true + +# 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 = "arm-none-eabi-" + +# Compiler type, "gcc" or "clang". +board_toolchain_type = "gcc" + +# Board related common compile flags. +board_cflags = [ + "-std=c99", + "--inline", + "-ggdb", + "-O1", + "-ffunction-sections", + "-fdata-sections", + "-mfloat-abi=softfp", + "-mfpu=fpv4-sp-d16", + "-mapcs-frame", + "-mcpu=cortex-m4", + "-mthumb", + "-mthumb-interwork", + "-gdwarf-2", + "-MD", + "-fno-stack-protector", + "-DLOSCFG_BASE_CORE_HILOG=1", +] +board_cxx_flags = [ ] +board_ld_flags = [ + + "-nostartfiles", + "-mcpu=cortex-m4", + "-mfloat-abi=softfp", + "-mfpu=fpv4-sp-d16", + "-mapcs-frame", + "-mthumb", + "-mthumb-interwork", + "-Wl,--gc-sections", + "-Wl,--start-group", + "-Llibs", + "-Wl,--whole-archive", + + "-lhuks_3.0_sdk", + "-lbootstrap", + "-lsamgr", + "-lsamgr_adapter", + "-lsysparam", + "-ltoken_static", + "-lbroadcast", + "-lhilog_lite", + "-lhiview_lite", + "-lkernel", + "-lsamgr_source", + "-lhal_sysparam", + "-lhal_token_static", + "-lutils_kv_store", + "-lble_sdk", + + # "-lhilinkbtsdk", + # "-lhichain_account", + + "-Wl,--no-whole-archive", + "-Wl,--end-group", + "-Tbin/link.ld", + "-Trom_symbol_gcc.txt", + "-Wl,-Map=bin/application.map", +] + +# Board related headfiles search path. +board_include_dirs = [ + + "//kernel/liteos_m", + "//kernel/liteos_m/kernel/arch/arm/cortex-m4/gcc", + "//kernel/liteos_m/kernel/arch/include", + "//kernel/liteos_m/kernel/include", + "//kernel/liteos_m/kal/cmsis", + "//kernel/liteos_m/kal/posix/include", + "//kernel/liteos_m/utils", + "//kernel/liteos_m/components/exchook", + "//utils/native/lite/kal/timer", + "//utils/native/lite/include", + + "//kernel/liteos_m/components/fs/fatfs", + "//third_party/FatFs/source", + "//third_party/cmsis/CMSIS/Core/Include", + "//third_party/musl/porting/liteos_m/kernel/include", + "//third_party/bounds_checking_function/include", + "//third_party/openssl", + "//third_party/openssl/include", + "//third_party/openssl/crypto/include", + "//third_party/openssl/crypto/ec", + "//third_party/mbedtls/include", + "//foundation/communication/bluetooth/interfaces/innerkits/native_c/include", + + "//device/soc/goodix/gr551x/sdk_liteos/platform/include", + "//device/soc/goodix/gr551x/adapter/hals/bluetooth", + "//device/soc/goodix/gr551x/components/hilink/include", + "//device/soc/goodix/gr551x/sdk_liteos/config", + "//device/soc/goodix/gr551x/sdk_liteos/liteos_m", + "//device/soc/goodix/gr551x/components/watchdog", + + "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/app_drivers/inc", + "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/boards", + "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/drivers_ext/gr551x", + "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/libraries/app_lfs", + "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/libraries/app_assert", + "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/libraries/app_error", + "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/libraries/app_log", + "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/libraries/app_timer", + "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/libraries/hal_flash", + "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/libraries/pmu_calibration", + "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/libraries/ring_buffer", + "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/libraries/utility", + "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/patch/ind", + "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/components/sdk/", + "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/drivers/inc", + "//device/soc/goodix/gr551x/sdk_liteos/gr551x_sdk/toolchain/gr551x/include", +] + +# add hdf includes path +board_include_dirs += [ + "//drivers/adapter/khdf/liteos_m/osal/include/", + "//drivers/framework/ability/sbuf/include", + "//drivers/framework/core/host/include", + "//drivers/framework/core/common/include/host", + "//drivers/framework/core/shared/include", + "//drivers/framework/include", + "//drivers/framework/include/osal", + "//drivers/framework/include/config", + "//drivers/framework/include/core", + "//drivers/framework/include/platform", + "//drivers/framework/include/utils", + "//drivers/framework/include/platform", + "//drivers/framework/support/platform/include", + "//drivers/framework/support/platform/include/common", + "//drivers/framework/utils/include", + "//base/hiviewdfx/hilog_lite/interfaces/native/kits", +] + +# Board adapter dir for OHOS components. +board_adapter_dir = "//device/soc/goodix/gr551x/adapter" + +# Sysroot path. +board_configed_sysroot = "" + +# Board storage type, it used for file system generation. +storage_type = "" + diff --git a/hcs/BUILD.gn b/hcs/BUILD.gn new file mode 100755 index 0000000..e1f18e9 --- /dev/null +++ b/hcs/BUILD.gn @@ -0,0 +1,19 @@ +# Copyright (c) 2021 GOODIX. +# 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") + kernel_module(module_name) { + } +} \ No newline at end of file diff --git a/hcs/gr5515_sk.hcs b/hcs/gr5515_sk.hcs new file mode 100755 index 0000000..29b3c75 --- /dev/null +++ b/hcs/gr5515_sk.hcs @@ -0,0 +1,17 @@ +/*# Copyright (c) 2021 GOODIX. +# 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. +*/ + +#include "../../../soc/goodix/gr551x/hcs/device_info/device_info.hcs" + + \ No newline at end of file