Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cpq committed Jun 17, 2022
1 parent 2365dc4 commit feedffb
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,17 +212,19 @@ The image should be of the following format:

Image header format includes two bytes, `F1` and `F2`, which desribe
SPI flash parameters that ROM bootloader uses to load the rest of the firmware.
Those two bytes encode three parameters:

- Flash mode (F1 byte - can be `0`, `1`, `2`, `3`)
- FLash size (hight 4 bits of F2 byte - can be `0`, `1`, `2`, `3`, `4`)
- Flash frequency (low 4 bits of F2 byte - can be `0`, `1`, `2`, `f`)

By default, `esputil` fetches flash params `F1` and `F2` from the
existing bootloader by reading first 4 bytes of the bootloader from flash.
It is possible to manually set flash params via the `-fp`
flag, which is an integer value that represent 3 hex nimbles.
For example `fp 0x22f` sets flash to DIO, 4MB, 80MHz:
- Flash mode. F1 byte. Can be `0` - qio, `1` - qout, `2` - dio, `3` - dout
- FLash size. High 4 bits of F2 byte. For ESP32: `0` - 1m, `1` - 2m, `2` -
4m, `3` - 8m, `4` - 16m. For ESP8266: `0` - 512k, `1` - 256k, `2` - 1m, `3`
- 2m, `4` - 4m, `8` - 8m, `9` - 16m
- Flash frequency. Low 4 bits of F2 byte. Can be `0` - 40m, `1` - 26m, `2` -
20m, `f` - 80m

By default, `esputil` fetches flash params `F1` and `F2` from the existing
bootloader by reading first 4 bytes of the bootloader from flash. It is
possible to manually set flash params via the `-fp 0xABC` command line flag,
where A is flash mode, B is flash size, C is flash frequency. For example `fp
0x220` sets flash to DIO, 4MB, 40MHz:

```sh
$ esputil -fp 0x220 flash 0 firmware.bin
Expand Down

0 comments on commit feedffb

Please sign in to comment.