-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspiffs-upload.sh
More file actions
executable file
·42 lines (31 loc) · 1.01 KB
/
spiffs-upload.sh
File metadata and controls
executable file
·42 lines (31 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# src: https://github.com/espressif/esp-idf/blob/master/docs/api-reference/storage/spiffs.rst
# https://github.com/igrr/mkspiffs/releases -> version 2.1
# Name, Type, SubType, Offset, Size, Flags
# nvs, data, nvs, 0x9000, 0x5000,
# otadata, data, ota, 0xe000, 0x2000,
# app0, app, ota_0, 0x10000, 0x140000,
# app1, app, ota_1, 0x150000,0x140000,
# eeprom, data, 0x99, 0x290000,0x1000,
# spiffs, data, spiffs, 0x291000,0x16F000,
clear;
echo "spiffs-upload.sh v1.0"
echo
PORT=$1
if [[ -z "$PORT" ]]; then
# choose the first connected ttyUSB* device
PORT=`ls /dev/ttyUSB* | awk {'print $1'}`;
echo "Using $PORT as default port."
echo
else
echo "Using port $PORT."
echo
fi
echo "Compressing files ..."
./mkspiffs -c ./data_upload/ -b 4096 -p 256 -s 0x16F000 spiffs.bin
echo
python ./esptool.py --chip esp32 --port $PORT --baud 115200 write_flash -z 0x291000 ./spiffs.bin
echo
echo "Press any key to continue..."
read -n1 any_key
# pause?!