ESP32C3 BLE 问题

Jafy_Chan
Posts: 8
Joined: Sun Aug 22, 2021 7:13 am

ESP32C3 BLE 问题

Postby Jafy_Chan » Sun Aug 22, 2021 7:56 am

开发环境:VSCode + Platformio + Arduino
硬件平台:ESP32C3
ESP-IDF版本:V4.1.2
Platformio PACKAGES:
- tool-esptoolpy 1.30100.210531 (3.1.0)
- toolchain-riscv-esp 1.80400.0 (8.4.0)

由于项目要求,以ESP32C3为平台的自研电路板,现在碰见一个比较棘手的问题无法解决。当加载BLE时,烧录后就不断重启,如果不加载BLE,只进行控制,如PWM,ADc,GPIO之类的都是ok的。网上找寻了很多信息,依然没解决问题,请高手指点。

BLE的初始化函数:(只执行到这里,就出异常)

BLEDevice::init(DEVICE_NAME);

不断重启的log信息:

ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0xf (BROWNOUT_RST),boot:0xf (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0x12f4
load:0x403ce000,len:0x93c
load:0x403d0000,len:0x292c
SHA-256 comparison failed:
Calculated: 8d996f0c10c713e532f0d62ceb5bd044db8011bcaef3163574bcc3fc4768f05d
Expected: e9d7702986eabdb730063e52592f19701feea7da0d2207d674ef148b8cdb3216
Attempting to boot anyway...
entry 0x403ce000
I (49) boot: ESP-IDF v4.4-dev-2313-gc69f0ec32 2nd stage bootloader
I (49) boot: compile time 12:10:29
I (49) boot: chip revision: 3
I (49) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (56) boot.esp32c3: SPI Speed : 80MHz
I (59) boot.esp32c3: SPI Mode : DIO
I (63) boot.esp32c3: SPI Flash Size : 4MB
I (67) boot: Enabling RNG early entropy source...
I (71) boot: Partition Table:
I (74) boot: ## Label Usage Type ST Offset Length
I (80) boot: 0 nvs WiFi data 01 02 00009000 00005000
I (87) boot: 1 otadata OTA data 01 00 0000e000 00002000
I (93) boot: 2 app0 OTA app 00 10 00010000 00300000
I (100) boot: 3 spiffs Unknown data 01 82 00310000 000f0000
I (106) boot: End of partition table
I (110) boot_comm: chip revision: 3, min. application chip revision: 0
I (116) esp_image: segment 0: paddr=00010020 vaddr=3c0a0020 size=1c070h (114800) map
I (141) esp_image: segment 1: paddr=0002c098 vaddr=3fc8d000 size=02338h ( 9016) load
I (143) esp_image: segment 2: paddr=0002e3d8 vaddr=40380000 size=01c40h ( 7232) load
I (147) esp_image: segment 3: paddr=00030020 vaddr=42000020 size=96fb4h (618420) map
I (249) esp_image: segment 4: paddr=000c6fdc vaddr=40381c40 size=0b24ch ( 45644) load
I (258) esp_image: segment 5: paddr=000d2230 vaddr=50000000 size=00010h ( 16) load
I (262) boot: Loaded app from partition at offset 0x10000
I (263) boot: Disabling RNG early entropy source...

ESP_XuLZ
Posts: 173
Joined: Fri Mar 26, 2021 6:04 am

Re: ESP32C3 BLE 问题

Postby ESP_XuLZ » Mon Aug 23, 2021 7:28 am

BROWNOUT_RST 是欠压复位, 应该检查下电源,可能之前就是到达一个临界点了,再打开蓝牙就低于能正常运行的电压了

Jafy_Chan
Posts: 8
Joined: Sun Aug 22, 2021 7:13 am

Re: ESP32C3 BLE 问题

Postby Jafy_Chan » Mon Aug 23, 2021 11:40 pm

确实是这个问题,换了一个电流大一点,电压稳定的电源作为输入,这个错误就没有,但是后来又碰见了另外一个rst的错误:

rst:0x13 (GLITCH_RTC_RST) --> 毛刺自启动

在论坛里(viewtopic.php?f=25&t=21460)找到了解决方案,采用了

#include "soc/soc.h"
#include "soc/rtc_cntl_reg.h"

在main函数内增加
REG_SET_FIELD(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_SEL, RTC_CNTL_FIB_SUPER_WDT_RST | RTC_CNTL_FIB_BOR_RST);

想请问这个rst的报错提示说明在哪里可以找到?在官网似乎没找到

ESP_XuLZ
Posts: 173
Joined: Fri Mar 26, 2021 6:04 am

Re: ESP32C3 BLE 问题

Postby ESP_XuLZ » Tue Aug 24, 2021 2:01 am

克隆个 ESP-IDF 仓库:https://github.com/espressif/esp-idf, 在这里面搜索 rst 相关的宏定义,会有简单的说明
有个博客关于esp32的可以参考下,但和C3的有些出入:https://blog.csdn.net/espressif/article ... /107977962

Xin888
Posts: 11
Joined: Wed Dec 15, 2021 8:08 am

Re: ESP32C3 BLE 问题

Postby Xin888 » Sat Dec 25, 2021 1:56 am

楼主解决 sha256 校验不通过得问题吗

Who is online

Users browsing this forum: No registered users and 45 guests