当前位置:网站首页>EPS32+Platform+Arduino 跑马灯
EPS32+Platform+Arduino 跑马灯
2022-07-29 05:23:00 【BobBobBao】
软硬件平台
硬件使用ESP32 D0WQ6,是在淘宝上购买的一个核心功能板,用做simplFOC的核心控制板。
软件平台使用Arduino,Arduino-ESP32有详细介绍ESP32针对arduino平台做的library和API接口
IDE软件采用PlatformIO,主要因为这个IDE比Arduino IDE的编译速度快很多。Arduino IDE简单易用,但是编译上传实在太慢,忍无可忍才找到了PlatforIO来替换
环境搭建
platformIO整个环境的搭建和使用已经有很多文章了,可以参考VSCode + PlatformIO + STM32/ESP32 ARDUINO。这里主要记录下测试跑马灯时的问题。具体程序可以看下节跑马灯程序及配置。
新建工程后,首次编译没有问题,首次点击 upload 提示Tool Manager: Installing platformio/tool-mkspiffs @ ~2.230.0,这里需要安装一系列的upload工具套件,必须关闭网络加速/代理,否则会一直停在这里,超时后会报错:终端将被任务重用 按任意键关闭。
我的环境需要安装的套件:
Installing platformio/tool-mkspiffs @ ~2.230.0
Installing platformio/tool-mklittlefs @ ~1.203.0
Installing platformio/tool-mkfatfs @ ~2.0.0
跑马灯程序及配置
跑马灯程序代码如下:
#include <Arduino.h>
#define LED 22
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED as an output.
pinMode(LED, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a second
digitalWrite(LED, LOW); // turn the LED off by making the voltage LOW
delay(500); // wait for a second
}
配置文件platformio.ini:
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
upload_port = COM10
如下图点击上传后,platformio会进行编译,上传,过程提示如下
* 正在执行任务: C:\Users\49196\.platformio\penv\Scripts\platformio.exe run --target upload --environment esp32dev
Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (5.0.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 @ 3.20003.220626 (2.0.3)
- tool-esptoolpy @ 1.30300.0 (3.3.0)
- tool-mkfatfs @ 2.0.1
- tool-mklittlefs @ 1.203.210628 (2.3)
- tool-mkspiffs @ 2.230.0 (2.30)
- toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 32 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\esp32dev\src\main.cpp.o
Linking .pio\build\esp32dev\firmware.elf
Retrieving maximum program size .pio\build\esp32dev\firmware.elf
Checking size .pio\build\esp32dev\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 4.9% (used 16148 bytes from 327680 bytes)
Flash: [== ] 16.2% (used 212701 bytes from 1310720 bytes)
Building .pio\build\esp32dev\firmware.bin
esptool.py v3.3
Creating esp32 image...
Merged 2 ELF sections
Successfully created esp32 image.
Configuring upload protocol...
AVAILABLE: cmsis-dap, esp-bridge, esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
Looking for upload port...
Using manually specified: COM10
Uploading .pio\build\esp32dev\firmware.bin
esptool.py v3.3
Serial port COM10
Connecting.....
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 78:21:84:79:43:2c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00044fff...
Compressed 17088 bytes to 11848...
Writing at 0x00001000... (100 %)
Wrote 17088 bytes (11848 compressed) at 0x00001000 in 0.5 seconds (effective 286.8 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.0 seconds (effective 586.7 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 656.9 kbit/s)...
Hash of data verified.
Compressed 213088 bytes to 115386...
Writing at 0x00010000... (12 %)
Writing at 0x0001dcac... (25 %)
Writing at 0x0002334b... (37 %)
Writing at 0x000285ed... (50 %)
Writing at 0x0002e68a... (62 %)
Writing at 0x00038862... (75 %)
Writing at 0x0003e351... (87 %)
Writing at 0x00043c6c... (100 %)
Wrote 213088 bytes (115386 compressed) at 0x00010000 in 2.9 seconds (effective 592.0 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
================================================= [SUCCESS] Took 14.34 seconds =================================================
* 终端将被任务重用,按任意键关闭。
看到[SUCCESS] 提示,耗时14.34 seconds。下载运行成功
参考
边栏推荐
- 基于51单片机ADC0808的proteus仿真
- Power Bi report server custom authentication
- Transformer review + understanding
- Continue the new journey and control smart storage together
- ML16-神经网络(2)
- Si12T和Si14T低功耗电容触摸芯片
- ML8自学笔记-LDA原理公式推导
- Hal library learning notes-11 I2C
- 1、 Transmission of file stream on Web page
- HAL库学习笔记-10 HAL库外设驱动框架概述
猜你喜欢

Transformer review + understanding

ML8自学笔记

How to use the pre training language model

HAL库学习笔记-11 I2C

【RoboMaster】从零开始控制RM电机(2)-CAN通信原理及电调通信协议

基于STC51:四轴飞控开源项目原理图与源码(入门级DIY)

一、常见损失函数的用法

6、 Pointer meter recognition based on deep learning key points

Pytorch's data reading mechanism

零基础学FPGA(五):时序逻辑电路设计之计数器(附有呼吸灯实验、简单组合逻辑设计介绍)
随机推荐
ML9自学笔记
二、多并发实现接口压力测试
Set automatic build in idea - change the code, and refresh the page without restarting the project
Reading papers on false news detection (I): fake news detection using semi supervised graph revolutionary network
Error importing Spacy module - oserror: [e941] can't find model 'en'
Si12T和Si14T低功耗电容触摸芯片
CS4344国产替代DP4344 192K 双通道 24 位 DA 转换器
ML11-SKlearn实现支持向量机
QT learning notes QT model/view
预训练语言模型的使用方法
基于51单片机的四路抢答器仿真
基于DAC0832的直流电机控制系统
2022春招——芯动科技FPGA开发岗笔试题(原题以及心得)
迁移学习——Low-Rank Transfer Subspace Learning
基于STC51:四轴飞控开源项目原理图与源码(入门级DIY)
6、 Pointer meter recognition based on deep learning key points
Typical cases of xdfs & China Daily Online Collaborative Editing Platform
2022春招——禾赛科技FPGA技术岗(一、二面,收集于:数字IC打工人及FPGA探索者)
Change! Change! Change!
How to use the pre training language model