ESP32-D2WD does not execute code from Arduino (works fine with ESP-IDF)
Posted: Mon Aug 14, 2017 7:45 am
Disclaimer: I never use Arduino, so expect the simplest mistakes on my part.
I have developed a custom board for ESP32-D2WD and am now in the process of programming it. Since this is going to be an open source project, I would like the board to be programmed in the Arduino environment to maximize community accessibility. Unfortunately, it seems like the compiling or flashing procedure used by the arduino-esp32 (https://github.com/espressif/arduino-esp32) toolchain does something differently compared to the ESP-IDF toolchain that causes code to run fine under ESP-IDF and not at all under Arduino.
So, first things first, I literally try the first available examples:
- Change menuconfig to the correct serial port
- compile and flash hello_world in esp-idf
This works flawlessly.
Then I start the Arduino environment, set up exactly following the instructions and compile/flash the sample program in the readme file
This is with the correct settings (40MHz flash, DIO)
This does not work and returns:
I have tried a bunch of things; e.g. copying the hello_world example into Arduino and compiling/flashing that - doesn't work. Trying it in the setup()/loop() format, doesn't work. And yes, I added 'extern "C"' to make app_main() work. The correct program is being compiled, i can find some recognizable strings in there. The flash size is recognized correctly (2MB) and nothing seems to go wrong during flashing.
What could I be doing wrong?
I have developed a custom board for ESP32-D2WD and am now in the process of programming it. Since this is going to be an open source project, I would like the board to be programmed in the Arduino environment to maximize community accessibility. Unfortunately, it seems like the compiling or flashing procedure used by the arduino-esp32 (https://github.com/espressif/arduino-esp32) toolchain does something differently compared to the ESP-IDF toolchain that causes code to run fine under ESP-IDF and not at all under Arduino.
So, first things first, I literally try the first available examples:
- Change menuconfig to the correct serial port
- compile and flash hello_world in esp-idf
This works flawlessly.
Then I start the Arduino environment, set up exactly following the instructions and compile/flash the sample program in the readme file
Code: Select all
#include "Arduino.h"
void setup(){
Serial.begin(115200);
}
void loop(){
Serial.println("loop");
delay(1000);
}
This does not work and returns:
Code: Select all
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, 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:0x3fff0010,len:4
load:0x3fff0014,len:588
load:0x40078000,len:0
load:0x40078000,len:10472
entry 0x40078a28
user code done
What could I be doing wrong?