diff --git a/BUILD.gn b/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..72eb5be82f4bc3a14d96a42de67aa4f5cc62d848 --- /dev/null +++ b/BUILD.gn @@ -0,0 +1,20 @@ +# 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. + +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 = [ "esp32_devkitc_v4" ] + } +} diff --git a/Kconfig.liteos_m.boards b/Kconfig.liteos_m.boards new file mode 100644 index 0000000000000000000000000000000000000000..da2ff2daab3aa8c4847f56ce8e1fcc1dbc419214 --- /dev/null +++ b/Kconfig.liteos_m.boards @@ -0,0 +1,15 @@ +# 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. + +orsource "*/Kconfig.liteos_m.board" + diff --git a/Kconfig.liteos_m.defconfig.boards b/Kconfig.liteos_m.defconfig.boards new file mode 100644 index 0000000000000000000000000000000000000000..86797f876a592d5a47b6f5b0877d0a04f60fa3a1 --- /dev/null +++ b/Kconfig.liteos_m.defconfig.boards @@ -0,0 +1,14 @@ +# 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. + +orsource "*/Kconfig.liteos_m.defconfig.board" diff --git a/Kconfig.liteos_m.shields b/Kconfig.liteos_m.shields new file mode 100644 index 0000000000000000000000000000000000000000..096029e1fca3f91ca3df94e042d472e7ac63a81b --- /dev/null +++ b/Kconfig.liteos_m.shields @@ -0,0 +1,15 @@ +# 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. + +#orsource "shields/Kconfig.liteos_m.defconfig.shields" +orsource "shields/Kconfig.liteos_m.shields" diff --git a/README.md b/README.md index c1af20957aeb25cf2e4af5fab4522c937fedb059..88659a61fd04aa8058a3b5638cae1906f68c6079 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,85 @@ -# device_board_espressif +# ESP32-DEVKITC_V4 +## 介绍 +ESP32-DEVKITC_V4是乐鑫一款基于ESP32_WROVER_IE的小型开发板。单模组采用了ESP32系列的ESP32-D0WD-V3芯片(xtensa 32-bit LX6 双核处理器),CPU时钟频率可调节为80MHz到240MHz,配置4MB SPI flash和8MB SPI PSRAM,集成传统蓝牙、低功耗蓝牙和Wi-Fi。可以用于低功耗传感器网络和要求极高的任务,例如语音编码、音频流和 MP3 解码等。 -#### 介绍 -{**以下是 Gitee 平台说明,您可以替换此简介** -Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} +开发板外观图片。 -#### 软件架构 -软件架构说明 +![ESP32正面照片](https://gitee.com/baochenjin/device_board_espressif/raw/master/figures/ESP32正面照片.jpg) +开发板底板图片。 -#### 安装教程 +![ESP32背面照片](https://gitee.com/baochenjin/device_board_espressif/raw/master/figures/ESP32背面照片.jpg) -1. xxxx -2. xxxx -3. xxxx +开发板功能块图。 -#### 使用说明 +![ESP32-WROVER_IE功能图](https://gitee.com/baochenjin/device_board_espressif/raw/master/figures/ESP32-WROVER_IE功能图.png) -1. xxxx -2. xxxx -3. xxxx -#### 参与贡献 +## 模组规格 -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request +| 器件类别 | 开发板| +| ---- | ---- | +| CPU | Xtensa 32-bit LX6 双核处理器(最高240MHz) | +| SRAM | 520 KB| +| ROM | 448 KB| +| RTC SRAM | 16 KB| +| GPIO | 34| +| I2C | 2| +| UART | 3| +| SPI | 4| +| I2S | 2| +| 8bit DAC | 2| +| 12-bit SAR ADC | 18channel 12bit | +| touch sensors | 10| +| host (SD/eMMC/SDIO) | 1| +| Ethernet MAC | IEEE-802.3-2008| +| TWAI | 兼容 ISO11898-1(CAN 规范 2.0)| +| RMT (TX/RX) | 支持| +| Motor PWM | 支持| +| LED PWM | 支持| +| Hall sensor | 支持| +| Radio | 2.4 GHz 接收/发射器| +| WiFi | TCP/IP、802.11 b/g/n、DCF| +| Bluetooth | Bluetoothv4.2、Class-1、Class-2、Class-3、SDIO/SPI/UART HCI +## 引脚定义 -#### 特技 +![ESP32-WROVER_IE管脚](https://gitee.com/baochenjin/device_board_espressif/raw/master/figures/ESP32-WROVER_IE管脚.png) -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/) +![ESP32-WROVER_IE管脚定义2](https://gitee.com/baochenjin/device_board_espressif/raw/master/figures/ESP32-WROVER_IE管脚定义2.png) + + +## 搭建开发环境 + +### 系统要求 +OpenHarmony在基于Xtensa 32-bit LX6芯片的ESP32-WROVER-IE模组,依赖liteos_m内核,内核依赖LX6架构配置,编译依赖a乐鑫官方提供的xtensa-esp32-elf-gcc 8.2.0版本 +OpenHarmony需要按照官方文档介绍安装环境https://gitee.com/openharmony-sig/device_soc_espressif/blob/master/README.md,然后编译出烧录包,按照文档介绍烧录。 + +### 工具要求 +ubuntu 18.04编译,windows10系统烧录。 + +https://gitee.com/openharmony-sig/device_soc_espressif/blob/master/README.md + +### 搭建过程 + +https://gitee.com/openharmony-sig/device_soc_espressif/blob/master/README.md + +## 编译调试 + +https://gitee.com/openharmony-sig/device_soc_espressif/blob/master/README.md + +按下开发板上reset power按钮,通过串口调试工具打印串口log。 + +## 首个示例 + +代码默认有一个UART打印示例。 + +## 参考资源 + +https://gitee.com/openharmony-sig/device_soc_espressif/blob/master/README.md + +https://www.espressif.com/zh-hans/support/documents/technical-documents?keys=&field_type_tid%5B%5D=681 + +## 联系 + +********** \ No newline at end of file diff --git a/esp32_devkitc_v4/BUILD.gn b/esp32_devkitc_v4/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..a90373de9af84e9fba99ce82a4ddc5f717a460f4 --- /dev/null +++ b/esp32_devkitc_v4/BUILD.gn @@ -0,0 +1,20 @@ +# 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. + +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/esp32_devkitc_v4/Kconfig.liteos_m.board b/esp32_devkitc_v4/Kconfig.liteos_m.board new file mode 100644 index 0000000000000000000000000000000000000000..0e76fc3288acd3dbf5cf065f6cdd4823a1becf42 --- /dev/null +++ b/esp32_devkitc_v4/Kconfig.liteos_m.board @@ -0,0 +1,17 @@ +# 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. + +config BOARD_ESP32_DEVKITC_V4 + bool "select board esp32" + depends on SOC_ESP32 + diff --git a/esp32_devkitc_v4/Kconfig.liteos_m.defconfig.board b/esp32_devkitc_v4/Kconfig.liteos_m.defconfig.board new file mode 100644 index 0000000000000000000000000000000000000000..7e3d03180701af915bf966d0aeb0f90551e40678 --- /dev/null +++ b/esp32_devkitc_v4/Kconfig.liteos_m.defconfig.board @@ -0,0 +1,21 @@ +# 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. + +if BOARD_CB2201 +config FLASH_SIZE + int + default 16 + help + support flash size +endif #BOARD_CB2201 + diff --git a/esp32_devkitc_v4/liteos_m/BUILD.gn b/esp32_devkitc_v4/liteos_m/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..f5e1178788a44f94145bae56fe0320f665756fe2 --- /dev/null +++ b/esp32_devkitc_v4/liteos_m/BUILD.gn @@ -0,0 +1,19 @@ +# 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. + +import("//kernel/liteos_m/liteos.gni") + +module_name = get_path_info(rebase_path("."), "name") +module_switch = defined(LOSCFG_BOARD_ESP32) +kernel_module(module_name) { +} diff --git a/esp32_devkitc_v4/liteos_m/config.gni b/esp32_devkitc_v4/liteos_m/config.gni new file mode 100644 index 0000000000000000000000000000000000000000..2723ec2bac674590620bb92f103e1e2e5e295c9c --- /dev/null +++ b/esp32_devkitc_v4/liteos_m/config.gni @@ -0,0 +1,107 @@ +# 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. + +# 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 = "" + +# Board arch, e.g. "armv7-a", "rv32imac". +board_arch = "" + +# Board, e.g. "esp32". +board = "esp32" + +# 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 = "xtensa-esp32-elf-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 = "xtensa-esp32-elf-" + +# Compiler type, "gcc" or "clang". +board_toolchain_type = "gcc" + +# Board related common compile flags. +board_cflags = [ + "-mlongcalls", + "-O0", + "-g", + "-Wall", + "-Wextra", + "-fno-common", + "-Wdouble-promotion", + "-mtext-section-literals", + "-DESP32", + "-Wno-implicit-function-declaration", + "-Wno-sign-conversion", + "-Wno-sign-compare", + "-W", + "-Wshadow", + "-ffunction-sections", + "-fdata-sections", + "-Wno-conversion", + "-Wno-unused-parameter", + "-Wno-unused-variable", + "-Wno-type-limits", + "-Wno-cast-function-type", + "-Wno-implicit-fallthrough", + "-Wno-parentheses", + "-Wno-pointer-sign", + "-D__FPU_PRESENT", + "-DPLAYER_TOOL", + "-DOS_HEAP_SIZE=0x400000", + "-DCHIP_HAS_UART=3", + "-DRTOS", + "-DDEBUG=1", + "-DCMSIS_OS_VER=2", + "-DOS_HWI_MAX_NUM=96", + "-DLFS_MAX_OPEN_DIRS=32", + "-DMBEDTLS_CMSIS_FILE=\"rtos/liteos/liteos_m/kal/cmsis/cmsis_os.h\"", + "-DLOSCFG_BASE_CORE_HILOG", +] + +# config.json parse +if (product_path != "") { + product_conf = read_file("${product_path}/config.json", "json") + product_name = product_conf.product_name + flash_partition_dir = product_conf.flash_partition_dir +} + +board_cxx_flags = board_cflags +board_ld_flags = [ "-L${ohos_root_path}out/${board_name}/${product_name}/libs" ] + +# Board related headfiles search path. +board_include_dirs = [ + "${ohos_root_path}third_party/bounds_checking_function/include", + "${ohos_root_path}utils/native/lite/include", +] +board_include_dirs += [] + +# Board adapter dir for OHOS components. +board_adapter_dir = + "${ohos_root_path}device/soc/espressif/esp32_wrover_ie/liteos_m" + +# Sysroot path. +board_configed_sysroot = "" + +# Board storage type, it used for file system generation. +storage_type = "" diff --git "a/figures/ESP32-WROVER_IE\345\212\237\350\203\275\345\233\276.png" "b/figures/ESP32-WROVER_IE\345\212\237\350\203\275\345\233\276.png" new file mode 100644 index 0000000000000000000000000000000000000000..64d6ea9e1de1b43c2835811e6abd0e4fd0184aaa Binary files /dev/null and "b/figures/ESP32-WROVER_IE\345\212\237\350\203\275\345\233\276.png" differ diff --git "a/figures/ESP32-WROVER_IE\347\256\241\350\204\232.png" "b/figures/ESP32-WROVER_IE\347\256\241\350\204\232.png" new file mode 100644 index 0000000000000000000000000000000000000000..28639b3ef493989c24b5aabd1294bcff75eef0fd Binary files /dev/null and "b/figures/ESP32-WROVER_IE\347\256\241\350\204\232.png" differ diff --git "a/figures/ESP32-WROVER_IE\347\256\241\350\204\232\345\256\232\344\271\2112.png" "b/figures/ESP32-WROVER_IE\347\256\241\350\204\232\345\256\232\344\271\2112.png" new file mode 100644 index 0000000000000000000000000000000000000000..0d4fd29478488e748d0513cd0f7843e2ccac3e38 Binary files /dev/null and "b/figures/ESP32-WROVER_IE\347\256\241\350\204\232\345\256\232\344\271\2112.png" differ diff --git "a/figures/ESP32\346\255\243\351\235\242\347\205\247\347\211\207.jpg" "b/figures/ESP32\346\255\243\351\235\242\347\205\247\347\211\207.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..48b3304dd48b422d144be61cc3b1053f05baa43f Binary files /dev/null and "b/figures/ESP32\346\255\243\351\235\242\347\205\247\347\211\207.jpg" differ diff --git "a/figures/ESP32\350\203\214\351\235\242\347\205\247\347\211\207.jpg" "b/figures/ESP32\350\203\214\351\235\242\347\205\247\347\211\207.jpg" new file mode 100644 index 0000000000000000000000000000000000000000..003be000aa30e0ac01019e29754b2ba57f1eae18 Binary files /dev/null and "b/figures/ESP32\350\203\214\351\235\242\347\205\247\347\211\207.jpg" differ