单独测试TWAI和WIFI功能都是正常的。
先开启WIFI后初始化TWAI会有两种情况:
1、先开启WIFI连接路由器,如果路由器名称密码填写正确,连接成功后,初始化TWAI正常,但是接收一段时间数据后会重启;
2、先开启WIFI连接路由器,如果路由器名称密码填写错误,连接不成功,初始化TWAI会立即重启。
使用idf.py monitor抓到重启时的数据是:
Code: Select all
abort() was called at PC 0x400243d3 on core 0
0x400243d3: lock_acquire_generic at D:/esp-idf/components/newlib/locks.c:139
Backtrace:0x4002b10f:0x3ffeb1b0 0x4002b9e1:0x3ffeb1d0 0x40031242:0x3ffeb1f0 0x400243d3:0x3ffeb260 0x400244f1:0x3ffeb290 0x40024575:0x3ffeb2b0 0x400ff1b6:0x3ffeb2e0 0x401021e9:0x3ffeb5f0 0x4011391d:0x3ffeb620 0x400310e1:0x3ffeb650 0x400f1761:0x3ffeb6a0 0x400f178b:0x3ffeb720 0x40027ab7:0x3ffeb770 0x400e58f3:0x3ffeb7d0 0x400e598b:0x3ffeb7f0 0x400e59fc:0x3ffeb810 0x400e677d:0x3ffeb830 0x400e4f39:0x3ffeb850 0x400d9cd4:0x3ffeb870 0x400d9fb3:0x3ffeb890 0x400da0ea:0x3ffeb8b0 0x400da1ad:0x3ffeb8e0 0x400d5cef:0x3ffeb900 0x400d5ed8:0x3ffeb940 0x400d9db7:0x3ffeb970 0x400d9dd6:0x3ffeb990 0x400d99bd:0x3ffeb9b0 0x400d9bb1:0x3ffeb9d0 0x4010f5dd:0x3ffeb9f0 0x4002ded5:0x3ffeba20
0x4002b10f: panic_abort at D:/esp-idf/components/esp_system/panic.c:368
0x4002b9e1: esp_system_abort at D:/esp-idf/components/esp_system/system_api.c:112
0x40031242: abort at D:/esp-idf/components/newlib/abort.c:46
0x400243d3: lock_acquire_generic at D:/esp-idf/components/newlib/locks.c:139
0x400244f1: _lock_acquire_recursive at D:/esp-idf/components/newlib/locks.c:167
0x40024575: __retarget_lock_acquire_recursive at D:/esp-idf/components/newlib/locks.c:323
0x400ff1b6: _vfprintf_r at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32s2-elf/src/newlib/newlib/libc/stdio/vfprintf.c:853 (discriminator 2)
0x401021e9: vprintf at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32s2-elf/src/newlib/newlib/libc/stdio/vprintf.c:34 (discriminator 5)
0x4011391d: esp_log_writev at D:/esp-idf/components/log/log.c:189
0x400310e1: esp_log_write at D:/esp-idf/components/log/log.c:199
0x400f1761: lib_printf at D:/esp-idf/components/esp_wifi/src/lib_printf.c:47 (discriminator 13)
0x400f178b: phy_printf at D:/esp-idf/components/esp_wifi/src/lib_printf.c:57
0x40027ab7: pll_vol_cal at ??:?
0x400e58f3: set_chan_freq_sw_start at ??:?
0x400e598b: set_channel_rfpll_freq at ??:?
0x400e59fc: chip_v7_set_chan at ??:?
0x400e677d: set_chanfreq at ??:?
0x400e4f39: phy_change_channel at ??:?
0x400d9cd4: ieee80211_timer_process at ??:?
0x400d9fb3: chm_set_current_channel at ??:?
0x400da0ea: chm_init at ??:?
0x400da1ad: chm_start_op at ??:?
0x400d5cef: clear_bss_queue at ??:?
0x400d5ed8: scan_inter_channel_timeout_process at ??:?
0x400d9db7: chm_end_op at ??:?
0x400d9dd6: chm_end_op_timeout_process at ??:?
0x400d99bd: esp_wifi_skip_supp_pmkcaching at ??:?
0x400d9bb1: ieee80211_timer_do_process at ??:?
0x4010f5dd: ppTask at ??:?
0x4002ded5: vPortTaskWrapper at D:/esp-idf/components/freertos/port/xtensa/port.c:168