当前位置:网站首页>合宙ESP32C3基于VSCode PIO Arduino开发框架初探教程
合宙ESP32C3基于VSCode PIO Arduino开发框架初探教程
2022-07-23 13:54:00 【perseverance52】
合宙ESP32C3基于VSCode PIO开发初探教程
- 开发前首先需要对自己手上的合宙开发板硬件信息有所了解。

- 原生PIO主板型号列表里面是并没有这款型号的板子的,我们需要自己添加开发板型号的配置文件。
合宙ESP32C3 VSCode PIO主板配置教程
- 前提是你已经安装了
VSCode以及对应PIO组件以及开发框架所需的固件,这里的框架所需的固件特指:
请注意所安装的固件版本,尽量如果没有什么特殊需求,请尽量安装最新的固件版本。

2. 找到PIO固件安装目录:C:\Users\Administrator\.platformio\platforms\espressif32\boards(根据个人电脑名字,有可能有差异)
找到
esp32-c3-devkitm-1.json复制粘贴一份,重命名:esp32-c3-luat.json
当然也可以不这么做,直接在现有的这个esp32-c3-devkitm-1.json上面来修改也行,只需将文件中的信息原来; “flash_mode”: “qio”,改为 “flash_mode”: “dio”,然后保存即可。

- 根据个人的配置来修改,我将买回来的合宙ESP32C3自己更换了外置的
SPI flash,所以我修改了下面的: “flash_size”: “16MB”,容量,如果你的没有换,那就默认的4MB即可。 - “name”: “Espressif ESP32-C3-luat”,如果是在原有的.json文件上修改就保持文件这个名字,如果是复制粘贴出来的,或者新建的注意,去一个新名字,用于在创建项目时,选择对应开发板型号,不要和现有的重复了。
{
"build": {
"arduino":{
"ldscript": "esp32c3_out.ld"
},
"core": "esp32",
"f_cpu": "160000000L",
"f_flash": "80000000L",
"flash_mode": "dio",
"extra_flags": "-DARDUINO_ESP32C3_DEV",
"mcu": "esp32c3",
"variant": "esp32c3"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32c3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "Espressif ESP32-C3-luat",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 460800
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/hw-reference/esp32c3/user-guide-devkitm-1.html",
"vendor": "Espressif"
}
项目创建
新建项目是时,
Board一栏,选择自己新建出来的开发板型号,或者是自己修改的开发板型号,
项目文件结构

个人添加了一个分区表配置文件,因为我的合宙ESP32C3的外置SHI flash是更换过的16MB的,如果你的没有就可以不需要添加此配置文件。

#include <Arduino.h>
void setup() {
Serial.begin(115200);
pinMode(12,OUTPUT);
pinMode(13,OUTPUT);
}
void loop() {
delay(1000);
Serial.println("hello esp32c3");
digitalWrite(13,!digitalRead(13));
digitalWrite(12,!digitalRead(12));
}
platformio.ini文件中的配置信息
[env:esp32-c3-devkitm-1]
platform = espressif32
board = esp32-c3-luat
framework = arduino
upload_speed = 921600
monitor_speed = 115200
board_build.partitions = partitions_16m.csv
; set frequency to 80MHz
board_build.f_flash = 80000000L
; set frequency to 160MHz
board_build.f_cpu = 160000000L
board_build.flash_mode =dio
;upload_port = /dev/cu.SLAB_USBtoUART
;monitor_port = /dev/cu.SLAB_USBtoUART
partitions_16m.csv分区表配置信息
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x630000,
app1, app, ota_1, 0x640000,0x630000,
fdb, 0x5A, 0x5B, 0xC70000,0x20000,
script, 0x5A, 0x5A, 0xC90000,0x100000,
script_ota, 0x5A, 0x5A, 0xD90000,0x100000,
spiffs, data, spiffs, 0xE90000,0x170000,
边栏推荐
- VMware虚拟机的三种网络模式
- Notes on Microcomputer Principle and technical interface
- Pinia (pineapple)
- MongoDB数据库+图形化工具下载安装及使用
- Shell | ssh失败原因及解决方法不完全总结
- PMP每日一练 | 考试不迷路-7.23
- mysql如何查询不在数据库里的数据?
- Fundamentals of C language -- the data type meaning of 2-4 pointers and the analysis of forced type conversion
- Compose Canvas饼图效果绘制
- SSD: Single Shot MultiBox Detector
猜你喜欢

TOPSIS法(MATLAB)

AutoCAD基本操作

Royal O'Brien, executive director of o3df: open source has no boundaries, and all shared sounds will become the actual direction

考过PMP对实际工作帮助大吗?

无心剑英汉双语诗006.《致爱妻》

Basic auth plug-in based on apisik authorizes Minio file upload function

Win11如何添加图片3D效果?Win11添加图片3D效果的方法

Study note 7 -- traffic environment behavior prediction

Scale Match for Tiny Person Detection

Eureka notes
随机推荐
Network protocol and attack simulation: Wireshark use, ARP Protocol
浏览器同源策略
Pinduoduo app product details interface to obtain activity_ ID value (pinduoduo activity_id interface)
Tips and tricks for neural networks deep learning and training skills summary (updated from time to time)
Eureka笔记
oracle 数据库 11C 之后版本使用 memory_target 自动内存管理
leetcode-168.Excel表列名称
TOPSIS法(MATLAB)
Leetcode-67. binary sum
同花顺上选择券商,网上客户经理开户安全吗
IDEA中给项目添加依赖的jar包
opencv之打开摄像头、边缘检测
anchor free yolov1
英特尔nuc能代替主机吗_终于圆满了!最新款的Intel NUC迷你主机上线
目前有哪些年利率6%左右的保本理财产品?
微信小程序class绑定,怎么绑定2个变量
解决data functions should return an object 并(Property “visible“ must be accessed with “$data.visible“)
Using "soup.h1.text" crawler to extract the title will be one more\
pip报错Could not find a version that satisfies the...No matching distribution
uni-app进阶之认证【day12】