add download mode instruction

This commit is contained in:
gijsio
2021-09-10 10:59:05 +02:00
committed by peter-pycom
parent 16eed9c9c4
commit 2a2a614d41

View File

@@ -88,8 +88,14 @@ make BOARD=GPY SECURE=on TARGET=app
make BOARD=GPY SECURE=on flash
```
Manual flash command:
### Manual flash command:
First put the esp32 in download mode by connecting `P2` to GND. On an expansionboard 3.0 or newer, you can instead instruct the PIC to do so using:
```bash
./tools/fw_updater/pypic.py -p /dev/ttyUSB0 --enter
```
Then, you can use the following to flash the firmware:
```bash
python $IDF_PATH/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before no_reset --after no_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0x0 build/GPY/release/bootloader/bootloader-reflash-digest.bin_enc 0x8000 build/GPY/release/lib/partitions.bin_enc 0x10000 build/GPY/release/gpy.bin_enc_0x10000
```
@@ -103,7 +109,7 @@ Because the encryption is done based on the physical flash address, there are 2
* `gpy.bin_enc_0x10000` which has to be written at default factory address: `0x10000`
* `gpy.bin_enc_0x1A0000` which has to be written at the `ota_0` partition address (`0x1A0000`)
{{% hint style="info" %}}
Hint: on MicroPython interface, the method `pycom.ota_slot()` responds with the address of the next OTA partition available (either `0x10000` or `0x1A0000`).
{{% /hint %}}
> Hint: on MicroPython interface, the method `pycom.ota_slot()` responds with the address of the next OTA partition available (either `0x10000` or `0x1A0000`).