完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
void my_timer_init(void)
{ timer_config_t timer_config_str; timer_config_str.divider = timer_divider; //分频值,默认时钟是80mhz,80mhz/80=1mhz=1us timer_config_str.counter_dir = TIMER_COUNT_UP;//向上计数模式 timer_config_str.counter_en = TIMER_PAUSE;//定时器计数失能 timer_config_str.alarm_en = TIMER_ALARM_EN;//使能定时器报警 timer_config_str.intr_type = TIMER_INTR_LEVEL;//定时器中断模式为电平模式 timer_config_str.auto_reload = 1; //使能自动装载 /*! /*! timer_init(TIMER_GROUP_0,TIMER_0,&timer_config_str);//esp32定时器共有两组,每组两个 timer_set_counter_value(TIMER_GROUP_0, TIMER_0, 0);//设置定时器的计数值 timer_set_alarm_value(TIMER_GROUP_0, TIMER_0, timer_go_handler);//设置定时器的报警值(进入中断的值) timer_enable_intr(TIMER_GROUP_0, TIMER_0);//使能定时器中断 timer_isr_callback_add(TIMER_GROUP_0, TIMER_0, my_isr_handler, NULL,0);//添加定时器中断回调 timer_start(TIMER_GROUP_0, TIMER_0);//打开定时器 } void IRAM_ATTR my_isr_handler(void) { timer_count++; timer_count_value = timer_group_get_counter_value_in_isr(TIMER_GROUP_0,TIMER_0); } 这个使用的时候编译没有错误,下载进板子之后就会一直报错,一直重启,报错内容如下 Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU0). Core 0 register dump: PC : 0x400881b2 PS : 0x00060034 A0 : 0x80083e94 A1 : 0x3ffb07e0 0x400881b2: spinlock_acquire at D:/ESP32_IDF/components/esp_hw_support/include/soc/spinlock.h:122 (inlined by) vPortCPUAcquireMutex at D:/ESP32_IDF/components/freertos/port/xtensa/include/freertos/portmacro.h:158 (inlined by) vPortEnterCritical at D:/ESP32_IDF/components/freertos/port/xtensa/port.c:448 A2 : 0x3ffb0f00 A3 : 0x3ffe3b80 A4 : 0x800d5450 A5 : 0x3ffb5e60 A6 : 0x00000000 A7 : 0xe00a0c00 A8 : 0xb33fffff A9 : 0x0000cdcd A10 : 0x4cc00001 A11 : 0xb33fffff A12 : 0x00060021 A13 : 0x00060023 A14 : 0x00000001 A15 : 0x600a0800 SAR : 0x00000020 EXCCAUSE: 0x00000005 EXCVADDR: 0x00000000 LBEG : 0x4000c46c LEND : 0x4000c477 LCOUNT : 0x00000000 Core 0 was running in ISR context: EPC1 : 0x400d12df EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x400881b2 0x400d12df: uart_hal_write_txfifo at D:/ESP32_IDF/components/hal/uart_hal_iram.c:35 0x400881b2: spinlock_acquire at D:/ESP32_IDF/components/esp_hw_support/include/soc/spinlock.h:122 (inlined by) vPortCPUAcquireMutex at D:/ESP32_IDF/components/freertos/port/xtensa/include/freertos/portmacro.h:158 (inlined by) vPortEnterCritical at D:/ESP32_IDF/components/freertos/port/xtensa/port.c:448 Backtrace:0x400881af:0x3ffb07e0 0x40083e91:0x3ffb0800 0x4008241d:0x3ffb0820 0x400d53ae:0x3ffb5ed0 0x400e4fc4:0x3ffb5ef0 0x40088049:0x3ffb5f10 0x400881af: spinlock_acquire at D:/ESP32_IDF/components/esp_hw_support/include/soc/spinlock.h:122 (inlined by) vPortCPUAcquireMutex at D:/ESP32_IDF/components/freertos/port/xtensa/include/freertos/portmacro.h:158 (inlined by) vPortEnterCritical at D:/ESP32_IDF/components/freertos/port/xtensa/port.c:448 0x40083e91: vPortEnterCriticalSafe at D:/ESP32_IDF/components/freertos/port/xtensa/include/freertos/portmacro.h:222 (inlined by) timer_isr_default at D:/ESP32_IDF/components/driver/timer.c:211 0x4008241d: _xt_lowint1 at D:/ESP32_IDF/components/freertos/port/xtensa/xtensa_vectors.S:1105 0x400d53ae: app_main at C:UserszhaidayuDesktopesp32code4.timerbuild/../main/main.c:17 0x400e4fc4: main_task at D:/ESP32_IDF/components/freertos/port/port_common.c:133 (discriminator 2) 0x40088049: vPortTaskWrapper at D:/ESP32_IDF/components/freertos/port/xtensa/port.c:168 Core 1 register dump: PC : 0x400e49a6 PS : 0x00060834 A0 : 0x800d4bc6 A1 : 0x3ffb7370 0x400e49a6: esp_pm_impl_waiti at D:/ESP32_IDF/components/esp_pm/pm_impl.c:829 A2 : 0x00000000 A3 : 0x00000000 A4 : 0x00000001 A5 : 0x80000001 A6 : 0x00000003 A7 : 0x00060023 A8 : 0x800d7442 A9 : 0x3ffb7340 A10 : 0x00000000 A11 : 0x00060823 A12 : 0x00060820 A13 : 0x00060823 A14 : 0x00000001 A15 : 0x00000000 SAR : 0x00000018 EXCCAUSE: 0x00000005 EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000 Backtrace:0x400e49a3:0x3ffb7370 0x400d4bc3:0x3ffb7390 0x40086a02:0x3ffb73b0 0x40088049:0x3ffb73d0 0x400e49a3: cpu_ll_waiti at D:/ESP32_IDF/components/hal/esp32/include/hal/cpu_ll.h:183 (inlined by) esp_pm_impl_waiti at D:/ESP32_IDF/components/esp_pm/pm_impl.c:827 0x400d4bc3: esp_vApplicationIdleHook at D:/ESP32_IDF/components/esp_common/src/freertos_hooks.c:63 0x40086a02: prvIdleTask at D:/ESP32_IDF/components/freertos/tasks.c:3846 (discriminator 1) 0x40088049: vPortTaskWrapper at D:/ESP32_IDF/components/freertos/port/xtensa/port.c:168 ELF file SHA256: 11b82529bf1c7412 Rebooting... ets Jul 29 2019 12:21:46 rst:0xc (SW_CPU_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:7264 load:0x40078000,len:14912 load:0x40080400,len:3688 0x40080400: _init at ??:? entry 0x4008067c 求解答 |
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
468 浏览 0 评论
984 浏览 0 评论
1707 浏览 0 评论
请问一下我想用ESP8685直接替换ESP8266而不用写程序,可以让ESP8685直接通过之前ESP8266的外挂的flash运行程序吗
1364 浏览 1 评论
1253 浏览 1 评论
为blufi_device设置自定义名称,但是无法修改,为什么?
1286浏览 4评论
请问ESP32-S2-WROOM怎么获得ESP32-S2外接FLASH的唯一序列号?
943浏览 3评论
2378浏览 3评论
ESP-IDF的VScode插件的build按钮点击会报错的原因?
2565浏览 3评论
ESP-Jumpstart例程中第5个工程:5_cloud连接报错是哪里的问题?
1071浏览 2评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-12 08:35 , Processed in 0.611254 second(s), Total 75, Slave 57 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
681
