Copyright © https://mongoose-os.com

Mongoose OS Forum

frame
ATTENTION! This forum has moved to:

https://community.mongoose-os.com

Do not post any new messages.

Configuring for an ESP32 chip

edited March 18 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
rst:0x1 (POWERON_RESET),boot:0x33 (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:6188
load:0x40078000,len:9592
load:0x40080400,len:6944
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:

Fetching https://github.com/mongoose-os-apps/demo-js/releases/download/2.12.1/demo-js-esp32.zip...
  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)
Deduping...
    22832 @ 0x1000 -> 18736
     3072 @ 0x8000 -> 0
    16384 @ 0x9000 -> 0
     8192 @ 0xd000 -> 0
   262144 @ 0x190000 -> 151552
Writing...
     8192 @ 0x1000
    12288 @ 0x4000
  1564672 @ 0x10000
   151552 @ 0x190000
Wrote 1730928 bytes in 105.08 seconds (128.70 KBit/sec)
Verifying...
    22832 @ 0x1000
     3072 @ 0x8000
    16384 @ 0x9000
     8192 @ 0xd000
  1560640 @ 0x10000
   262144 @ 0x190000
Booting firmware...
All done!

Comments

  • edited March 18

    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.