Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example when flashed just boot loops the esp32 #4

Open
vgarleanu opened this issue Apr 29, 2020 · 2 comments
Open

Example when flashed just boot loops the esp32 #4

vgarleanu opened this issue Apr 29, 2020 · 2 comments

Comments

@vgarleanu
Copy link

When compiling and flashing the code in this repo, the esp32 just enters a bootloop, with the following console output:

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:2
load:0x3f400020,len:30732

Any idea where we can start debugging this?

@sdobz
Copy link

sdobz commented May 13, 2020

Actually yes!

This package does not flash the bootloader or partition table to the esp32.

I fixed it by flashing a standard esp-idf C++ project and inspecting build/flasher_args.json

Mine looked similar to:

{
    "write_flash_args" : [ "--flash_mode", "dio",
                           "--flash_size", "detect",
                           "--flash_freq", "40m" ],
    "flash_settings" : {
        "flash_mode": "dio",
        "flash_size": "detect",
        "flash_freq": "40m"
    },
    "flash_files" : {
        "0x8000" : "partition_table/partition-table.bin",
        "0x1000" : "bootloader/bootloader.bin",
        "0x10000" : "esp32.bin"
    },
    "partition_table" : { "offset" : "0x8000", "file" : "partition_table/partition-table.bin" },
    "bootloader" : { "offset" : "0x1000", "file" : "bootloader/bootloader.bin" },
    "app" : { "offset" : "0x10000", "file" : "esp32.bin" },
    "extra_esptool_args" : {
        "after"  : "hard_reset",
        "before" : "default_reset",
        "stub"   : "TRUE",
        "chip"   : "esp32"
    }
}

pay special attention to the offsets. The typical esptool.py flash command looks similar to:

esptool.py \
	--chip esp32 \
	elf2image \
	--flash_mode "dio" \
	--flash_freq "40m" \
	--flash_size "2MB" \
	-o $TARGET_DIR/esp32-hello.bin \
	0x10000 $TARGET_DIR/esp32-hello

Make sure that the offset there matches the flasher_args

There's a command on esptool.py image_info which can reveal info about an image (docs):

esptool.py --chip esp32 image_info target/xtensa-esp32-none-elf/release/esp32-hello.bin

which might provide additional information.

@vgarleanu
Copy link
Author

vgarleanu commented May 13, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants