问题描述
我正在尝试使用 arduino-uno-wifi-r3-atmega328p-esp8266-32mb-flash-usb-ttl-ch340g-micro-usb 板。 我能够按照链接下的说明创建一个连接到我的 WiFi 的基本应用程序。 下面是初始化 WiFi 的代码片段
#include <ESP8266WiFi.h>
const char* ssid = "xxx";
const char* password = "xxxxxxx";
void setup() {
Serial.begin(115200);
Serial.println("Initialization of a Server");
WiFi.begin(ssid,password);
....
}
如果我按照页面上的建议使用 Arduino IDE 编译代码并将其上传到 ESP8266,它运行得很好。
我想使用 platformio 做同样的事情,这就是我遇到麻烦的地方。它无法初始化 WiFi,我在日志中看到以下内容
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
ets Jan 8 2013,rst cause:2,boot mode:(3,6)
load 0x4010f000,len 3584,room 16
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld
Initialization of a Server
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
Exception (3):
epc1=0x40100718 epc2=0x00000000 epc3=0x00000000 excvaddr=0x4006e989 depc=0x00000000
LoadStoreError: Processor internal physical address or data error during load or store
epc1=0x40100718 in umm_malloc_core at umm_malloc.cpp:?
>>>stack>>>
ctx: cont
sp: 3ffffba0 end: 3fffffc0 offset: 0190
3ffffd30: feefeffe feefeffe feefeffe feefeffe
3ffffd40: feefeffe feefeffe feefeffe feefeffe
3ffffd50: feefeffe feefeffe feefeffe 3fffff00
3ffffd60: 0000049c 0000049c 00000020 40100902
3ffffd70: feefeffe feefeffe feefeffe feefeffe
3ffffd80: 00000000 400042db 000003fd 40100b50
3ffffd90: 40004b31 00001000 000003fd 4010027c
3ffffda0: 40105b1c feefeffe feefeffe 4022d125
3ffffdb0: 40100c1d 4022d20f 3ffef124 0000049c
3ffffdc0: 000003fd 3fffff00 3ffef124 4022d1f2
3ffffdd0: ffffff00 55aa55aa 00000009 00000020
3ffffde0: 00000020 00000002 00000002 aa55aa55
3ffffdf0: 000003ff 4022d6f2 3ffef124 3ffef124
3ffffe00: 000000ff 000000f2 000000f2 40100647
3ffffe10: 40100c1d 00000001 3ffef134 4022d912
3ffffe20: 00000005 3ffef124 000000ff 3fffff00
3ffffe30: 3fffff20 3ffef15b 00000009 00000020
3ffffe40: 3ffef1e4 3fffff61 00000001 4022d9c2
3ffffe50: 3fffff00 40239b10 00000000 0000000b
3ffffe60: 3ffef524 3fffff20 3fff545c 4022d991
3ffffe70: 3ffef124 4022d9f8 3ffe84d4 3ffe8642
3ffffe80: 40201952 3ffe8642 3ffe8636 402018a7
3ffffe90: 6e6f6c63 00343265 00000020 40100900
3ffffea0: 40204705 feefeffe feefeffe feefeffe
3ffffeb0: 62303938 62303938 00303938 40204a17
3ffffec0: 0000001c 0001c200 00000000 00000000
3ffffed0: 00000003 40204bd9 ffffffff 00000001
3ffffee0: feefeffe 00000001 3ffee4b4 3ffee52c
3ffffef0: 2c871c00 fef80c67 feefeffe 00000100
3fffff00: 6e6f6c63 00343265 00000020 40100902
3fffff10: 40203305 feefeffe feefeffe feefeffe
3fffff20: 62303938 62303938 00303938 4020326d
3fffff30: 3ffe8652 00000000 53007265 4020326d
3fffff40: 3ffe8626 402037d9 ffffffff 3ffee3d4
3fffff50: 40201a68 3ffee35c 3ffe8650 40201a74
3fffff60: 40201a00 3ffee35c 3ffe8681 00000002
3fffff70: 00000004 00000000 3ffee328 00000001
3fffff80: 3fffdad0 00000000 3ffee35c 3ffee3d4
3fffff90: 3fffdad0 00000000 3ffee35c 40201068
3fffffa0: feefeffe feefeffe 3ffee394 402024c0
3fffffb0: feefeffe feefeffe 3ffe84ec 40100bc5
<<<stack<<<
0x40100902 in malloc at ??:?
0x40100b50 in calloc at ??:?
0x4010027c in pvPortZalloc at ??:?
0x40105b1c in spi_flash_read at ??:?
0x4022d125 in wifi_param_save_protect_with_check at ??:?
0x40100c1d in __wrap_spi_flash_read at ??:?
0x4022d20f in system_param_save_with_protect at ??:?
0x4022d1f2 in system_param_save_with_protect at ??:?
0x4022d6f2 in wifi_station_ap_number_set at ??:?
0x40100647 in umm_free_core at umm_malloc.cpp:?
0x40100c1d in __wrap_spi_flash_read at ??:?
0x4022d912 in wifi_station_ap_number_set at ??:?
0x4022d9c2 in wifi_station_ap_number_set at ??:?
0x40239b10 in sleep_reset_analog_rtcreg_8266 at ??:?
0x4022d991 in wifi_station_ap_number_set at ??:?
0x4022d9f8 in wifi_station_set_config at ??:?
0x40201952 in ESP8266WiFiSTAClass::begin(char const*,char const*,int,unsigned char const*,bool) at ??:?
0x402018a7 in ESP8266WiFiSTAClass::begin(char const*,bool) at ??:?
0x40100900 in malloc at ??:?
0x40204705 in read_encoded_value_with_base at /workdir/repo/gcc/libgcc/unwind-pe.h:252
0x40204a17 in linear_search_fdes at /workdir/repo/gcc/libgcc/unwind-dw2-fde.c:808
0x40204bd9 in fde_unencoded_compare at /workdir/repo/gcc/libgcc/unwind-dw2-fde.c:344
0x40100902 in malloc at ??:?
0x40203305 in uart_flush at ??:?
0x4020326d in uart_write at ??:?
0x4020326d in uart_write at ??:?
0x402037d9 in uart_set_debug at ??:?
0x40201a68 in HardwareSerial::write(unsigned char const*,unsigned int) at ??:?
0x40201a74 in HardwareSerial::write(unsigned char const*,unsigned int) at ??:?
0x40201a00 in WiFiClient::stopAll() at ??:?
0x40201068 in setup at ??:?
0x402024c0 in loop_wrapper() at core_esp8266_main.cpp:?
0x40100bc5 in cont_wrapper at ??:?
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
可能是我设置的板不正确这里是我在 platformio.ini
中的设置
[env:esp12e]
platform = espressif8266
board = esp12e
framework = arduino
monitor_speed=115200
monitor_filters=esp8266_exception_decoder
我尝试了不同的 espressif 板,但即使我可以编译和上传代码,它也无法初始化 WiFi。我正在努力寻找以下问题的答案:
- 如何找到要选择的板/平台?
- 所选平台/板卡如何影响运行时?
以下是我在 Arduino IDE 中的设置,我能够在设备上成功编译、上传和运行相同的代码
以及来自我的 Arduino Uno 的 ESP 芯片(不确定它是否有帮助,但以防万一)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)