Copyright ©

Mongoose OS Forum

ATTENTION! This forum has moved to:

Do not post any new messages.

Configuring for an ESP32 chip

edited March 2019 in Mongoose OS

I am able to successfully build and flash (i.e. verification of the download completes) the default example program to an ESP32 chip with 2 Mbytes of internal flash using the following commands:

mos build --platform esp32 --local
mos flash esp32

However, on rebooting the chip the serial output tells me partition 0 invalid magic number and reboots continuously:

ets Jun  8 2016 00:22:57
configsip: 0, SPIWP:0xee
mode:DIO, clock div:1
entry 0x40080740
boot: ESP-IDF v3.2-r2 2nd stage bootloader
boot: compile time 13:55:00
boot: Enabling RNG early entropy source...
qio_mode: Enabling default flash chip QIO
boot: SPI Speed      : 80MHz
boot: SPI Mode       : QIO
boot: SPI Flash Size : 2MB
flash_parts: partition 0 invalid magic number 0x0
boot: Failed to verify partition table
boot: load partition table error!

So I assume that I need to edit some .yaml configuration to put the downloaded code in the right place etc. for this chip. Is there any platform/porting documentation that might guide me on how to do this?

FYI, the output from the successful mos flash step is:

  done, 1858988 bytes.
Loaded demo-js/esp32 version 1.0 (20190222-135520/2.10.0-g237ecfd-master)
Opening COM52 @ 115200...
Connecting to ESP32 ROM, attempt 1 of 10...
  Connected, chip: ESP32D0WDQ6 R1
Running flasher @ 0...
  Flasher is running
Flash size: 2097152, params: 0x021f (dio,16m,80m)
    22832 @ 0x1000 -> 18736
     3072 @ 0x8000 -> 0
    16384 @ 0x9000 -> 0
     8192 @ 0xd000 -> 0
   262144 @ 0x190000 -> 151552
     8192 @ 0x1000
    12288 @ 0x4000
  1564672 @ 0x10000
   151552 @ 0x190000
Wrote 1730928 bytes in 105.08 seconds (128.70 KBit/sec)
    22832 @ 0x1000
     3072 @ 0x8000
    16384 @ 0x9000
     8192 @ 0xd000
  1560640 @ 0x10000
   262144 @ 0x190000
Booting firmware...
All done!


  • edited March 2019

    FYI, after browsing the forums here I've tried specifying FLASH_SIZE:

    mos build --platform esp32 --local --build-var FLASH_SIZE=2097152 --clean

    ...but that doesn't make any difference.

  • nliviunliviu Romania

    ESP32 with flash <4MB is not supported

  • Ah, that'll be the reason, thanks for the swift response. I'll go buy a bigger chip.

Sign In or Register to comment.