ESP32-S3 Arduino 库更新为3.0.1出现问题

Moderator: ESP_ZT

sojufe
Posts: 4
Joined: Fri Jun 14, 2024 11:33 am

ESP32-S3 Arduino 库更新为3.0.1出现问题

Postby sojufe » Fri Jun 14, 2024 11:42 am

各位大佬麻烦看一下,我把库更新成了3.0.1,按照例程写的程序,汇报错误。程序如下:
hw_timer_t *timer0 = NULL;
volatile int interruptCounter = 0;

void ARDUINO_ISR_ATTR time0_isr(void);

void Timer0_Init(unsigned long per)
{
timer0 = timerBegin(1000000);
timerAttachInterrupt(timer0, &time0_isr);
// 设定定时器的报警值,第三个参数设置为 true 表示自动重载
timerAlarm(timer0, per*1000, true, 0);

}

void ARDUINO_ISR_ATTR time0_isr(void)
{
interruptCounter++; // 中断计数器增加
Serial.println("reboot\n");
}
#include "config.h"
#include "esp32-hal-timer.h"

volatile int interruptCounterBefore = 0;


void setup()
{
Serial.begin(115200); // 初始化串行通信,波特率为115200
Timer0_Init(10); // ms计数
}

void loop()
{
if(interruptCounterBefore != interruptCounter)
{
Serial.println(interruptCounter);
interruptCounterBefore = interruptCounter;
}
}

上传之后通过串口助手,看不断刷新如下:
Core 0 register dump:
19:39:50.545 -> PC : 0x40378a00 PS : 0x00060034 A0 : 0x8037cf31 A1 : 0x3fc92bf0
19:39:50.545 -> A2 : 0x3fc91bd0 A3 : 0xb33fffff A4 : 0x0000cdcd A5 : 0xb81fc000
19:39:50.578 -> A6 : 0x00060b23 A7 : 0x00000000 A8 : 0xc4000000 A9 : 0x00000000
19:39:50.578 -> A10 : 0x03c91bd0 A11 : 0x3fc91bd0 A12 : 0x3fcf4360 A13 : 0x3fcf4340
19:39:50.578 -> A14 : 0x00000000 A15 : 0x3fc94a98 SAR : 0x0000000e EXCCAUSE: 0x00000006
19:39:50.578 -> EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000
19:39:50.610 ->
19:39:50.610 ->
19:39:50.610 -> Backtrace: 0x403789fd:0x3fc92bf0 0x4037cf2e:0x3fc92c10 0x4037bb00:0x3fc92c40 0x4037d45b:0x3fc92c60 0x403775c8:0x3fc92c80 0x40377a39:0x3fc92�xx���x�����������x����x���x����xx�x���������x��������x�x�x�����x����xx�x�����������x����������x�����������x����xx�x��������x�xx�xx�xx�xx�xxx�xx���x��x�xxx���x�xx��x�������������xx���x��x��x�xxx��xx�����x�x��xx�x��xx�xx�x�x�x��x�x�xx�x�xx�xESP-ROM:esp32s3-20210327

19:39:50.680 -> Build:Mar 27 2021
19:39:50.680 -> rst:0xc (RTC_SW_CPU_RST),boot:0xa (SPI_FAST_FLASH_BOOT)
19:39:50.680 -> Saved PC:0x420084d3
19:39:50.680 -> SPIWP:0xee
19:39:50.680 -> mode:DIO, clock div:1
19:39:50.680 -> load:0x3fce3818,len:0x508
19:39:50.680 -> load:0x403c9700,len:0x4
19:39:50.680 -> load:0x403c9704,len:0xad0
19:39:50.680 -> load:0x403cc700,len:0x29e4
19:39:50.680 -> entry 0x403c9880
19:39:50.800 -> reboot
求各位大佬指点

sojufe
Posts: 4
Joined: Fri Jun 14, 2024 11:33 am

Re: ESP32-S3 Arduino 库更新为3.0.1出现问题

Postby sojufe » Mon Jun 24, 2024 3:06 am

已解决,中断中不能使用Serial.println("reboot\n");这样的语句

harvey.zhang
Posts: 1
Joined: Fri Sep 13, 2024 6:46 am

Re: ESP32-S3 Arduino 库更新为3.0.1出现问题

Postby harvey.zhang » Fri Sep 13, 2024 6:48 am

大神,库更新到3.0后,定时器初始化的时候貌似不对定时器的编号做定义了。这个是怎么回事?

sojufe
Posts: 4
Joined: Fri Jun 14, 2024 11:33 am

Re: ESP32-S3 Arduino 库更新为3.0.1出现问题

Postby sojufe » Sat Oct 12, 2024 1:46 am

现在改用IDF开发了 :D

Who is online

Users browsing this forum: No registered users and 7 guests