Closed sgrimee closed 2 years ago
You have one of these rare(er) chips with 2MB flash instead of the usual 4MB.
@jessebraham - I do not remember - what was our support story for these in espflash?
I believe you can pass --partition-table PATH
, and use the csv format described in the esp-idf docs to reduce your factory partition size to fit in your flash.
But you also need a 2mb bootloader?
Ah sorry I've misunderstood slightly. I though it was possible, but it seems the image we create is hardcoded to 4mb (among other things). I've opened https://github.com/esp-rs/espflash/issues/140 to solve this.
There is now a PR for espflash which should allow the override of header parameters.
Note there is a second way of doing this, you can set the bootloader flash size in sdkconfig, once set you can use the esp-idf bootloader built from your project instead of the builtin bootloader. Passing something like --bootloader target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-3b7438c03099654c/out/build/bootloader/bootloader.bin
should work.
Thanks @MabezDev!
For any beginner like me who stumbles on this, I confirm the following approaches work:
First, create a partition table, e.g.
cat ../partition.csv
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x6000,
phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, 0x10000, 0x1F0000,
Build a bootloader with idf.py using another hello world project and use it with
cargo espflash --bootloader ../bootloader.bin --partition-table ../partition.csv
Add this to sdkconfig.defaults
CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=No
CONFIG_ESPTOOLPY_FLASHSIZE=ESPTOOLPY_FLASHSIZE_2MB
and then use the bootloader build from the project as you suggested:
cargo espflash --monitor --bootloader target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-d108b8d610d9d2bc/out/build/bootloader/bootloader.bin --partition-table ../partition.csv
cargo-espflash --version
cargo-espflash 1.4.0-dev
cargo espflash --flash-size 2MB --partition-table ../partition.csv --monitor
set options in sdkconfig.defaults and then
cargo espflash --partition-table ../partition.csv --monitor
Trying to build the unmodified template of the waveshare ESP-C3-32S-Kit board, I get the following error at boot.
Compilation settings: