Using platformio to upload a sketch to ESP8266 of an arduino uno wifi r3 atmega328p esp8266 32mb

0

I am trying to use arduino-uno-wifi-r3-atmega328p-esp8266-32mb-flash-usb-ttl-ch340g-micro-usb board. I am able to create a basic application that connects to my WiFi following the instruction under the link. Below is a code snippet that initializing 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);
....
}

and it runs just fine if I use Arduino IDE to compile and upload the code to ESP8266 as suggested on the page.

I would like to do the same using platformio and this is where I having troubles. It cannot initialize WiFi and I see the following in the log

    --------------- 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*, char const*, int, unsigned 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 ---------------

It might be the case that the board I set is not the right one here is my settings in platformio.ini

[env:esp12e]
platform = espressif8266
board = esp12e
framework = arduino
monitor_speed=115200
monitor_filters=esp8266_exception_decoder

I have tried different boards, of espressif but even if I can compile and upload the code, it fails to initialize WiFi. I am struggling to find answers to the following questions:

  1. How one can find what board/platform to choose?
  2. How selected platform/board influences the runtime?

Below is the settings I have in Arduino IDE and I am able to compile, upload and run the same code successfully on the device

enter image description here

and the ESP chip from my Arduino Uno (not sure if it can help, but just in case) enter image description here

arduino-uno
arduino-ide
arduino-esp8266
platformio
asked on Stack Overflow Jan 9, 2021 by jjd

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0