PlatformIO Community

How to upgrade firmware of ESP32 in the field far from internet

Good day fellow PlatformIO users. I’m using PlatformIO on Windows 10 for my ESP32 projects.

Many of my EPS32 LoRa-nodes has no Wifi/Internet connection and I would like to be able to flash the “firmware.bin” file that is created by PlatformIO from my Android smartphone.

I downloaded (and bought) the app “ESP Loader” of Bluino Electronics for this purpose.

I copy the “firmware.bin” file created by PlatformIO to my Google Drive. The mentioned app can connect to my Drive, fetch the .bin and upload it via USB OTG cable to my ESP32. (using Devkit V1 module of DOIT)

Unfortunately the .bin file of PlatformIO don’t run correctly after flashing to the ESP32. The problem according to me can’t be with the app, because when I flash the .bin file created by the Arduino IDE it works time and again.

So, flashing the .bin files of Arduino works, but after flashing a .bin file created by PlatformIO, the code only send the following on the serial port. I would really like to solve this problem and would appreciate some help or hints.

++++++++++++++++++++++++++++++++++++++

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (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:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:10864
load:0x40080400,len:6432
entry 0x400806b8

How does this app know at what address to flash that binary file? The application could start from anywhere according to the partition table.

What are your settings in the Arduino IDE which you have verified to be good, and what’s the platformio.ini?

I really don’t know and must admit that I don’t fully understand this. Is it possible that the Arduino IDE can include this address info in the .bin file?

Or maybe the app determine it based on the partition setting:
image

The app seemed to flash the Arduino IDE created .bin file correctly on both of the partition scheme settings.

See my Arduino IDE settings beneath:

Arduino IDE settings

---------------platformio.ini content:------------------
[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
upload_speed = 921600

To match these setting ins PlatformIO, you would have to write

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
board_build.f_flash = 80000000L
board_build.flash_mode = qio
board_build.partitions = huge_app.csv
upload_speed = 921600

And since the “Huge APP” partition scheme was selected, you should also select the lower option in the flasher app.

1 Like

This solved to problem.
I appreciate your help very much.
Thankyou

1 Like