乐鑫技术交流
直播中

李宛蔓

8年用户 1047经验值
私信 关注
[问答]

Platform IO抛出异常的简单代码是为什么?

我正在使用 Platform IO,配置了 heltec_wifi_kit_32 板和 arduino 框架。没有安装 pio 库。
当我构建并上传代码时,它会启动接入点,我可以连接到它。
当我重建它(未更改)并上传并
时,它会将 esp 放入一个重启循环,并在串行监视器上显示堆栈转储。
如果我更改 ssid,然后构建和上传,它会工作一次。
似乎我的 WiFi 代码中缺少某些东西,或者当客户端有现有租约时 dhcp 库中存在错误。
代码:
代码:全选#include
#include
#include

IPAddress ip(192, 168, 1, 1);

void setup() {
  delay(3000);

  WiFi.disconnect();
  WiFi.mode(WIFI_OFF);

  WiFi.mode(WIFI_AP);
  WiFi.softAPConfig(ip, ip, IPAddress(255, 255, 255, 0));
  WiFi.softAP("test");
}

void loop() { }


代码:全选Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x17 (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:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5828
entry 0x400806ac
dhcps: send_offer>>udp_sendto result 0
Guru Meditation Error: Core  0 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 0 register dump:
PC      : 0x00000000  PS      : 0x00060e30  A0      : 0x8010dfd9  A1      : 0x3ffb3b40  
A2      : 0x3ffcb660  A3      : 0x3ffcbc0c  A4      : 0x3ffbda68  A5      : 0x3ffbda48  
A6      : 0x0201a8c0  A7      : 0x0c01a8c0  A8      : 0x8010de7c  A9      : 0x3ffb3b00  
A10     : 0x3ffcb670  A11     : 0x3ffcbc0c  A12     : 0x3ffb3b4c  A13     : 0x00000044  
A14     : 0x00000001  A15     : 0x00000006  SAR     : 0x00000010  EXCCAUSE: 0x00000014  
EXCVADDR: 0x00000000  LBEG    : 0x4000c349  LEND    : 0x4000c36b  LCOUNT  : 0x00000000  

Backtrace: 0x00000000:0x3ffb3b40 0x4010dfd6:0x3ffb3b80 0x40116515:0x3ffb3ba0 0x4011b51d:0x3ffb3be0 0x40120642:0x3ffb3c00 0x4010e1a3:0x3ffb3c20 0x400886e1:0x3ffb3c50
  #0  0x00000000:0x3ffb3b40 in ?? ??:0
  #1  0x4010dfd6:0x3ffb3b80 in handle_dhcp at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/apps/dhcpserver/dhcpserver.c:1031
  #2  0x40116515:0x3ffb3ba0 in udp_input at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/udp.c:401
  #3  0x4011b51d:0x3ffb3be0 in ip4_input at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/core/ipv4/ip4.c:740
  #4  0x40120642:0x3ffb3c00 in ethernet_input at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/netif/ethernet.c:184
  #5  0x4010e1a3:0x3ffb3c20 in tcpip_thread at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/api/tcpip.c:483
  #6  0x400886e1:0x3ffb3c50 in vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)

更多回帖

发帖
×
20
完善资料,
赚取积分