-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathload_esp32.zsh
executable file
·51 lines (40 loc) · 1.13 KB
/
load_esp32.zsh
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
43
44
45
46
47
48
49
50
51
#!/usr/bin/env zsh
items=(
boot.py
main.py
board.py
include
src
)
# latest binaries: https://micropython.org/download
port=/dev/cu.SLAB_USBtoUART
mpy_binary=./bin/esp32-20190717-v1.11-163.bin
chipset=esp32
if [ "$1" = "erase" ]; then
echo "erasing device..."
esptool.py --chip $chipset --port $port erase_flash
elif [ "$1" = "flash" ]; then
echo "flashing device with micropython..."
esptool.py --chip $chipset --port $port --baud 460800 write_flash -z 0x1000 $mpy_binary
elif [ "$1" = "board" ]; then
echo "copying board.py to device..."
ampy --port $port put board.py
elif [ "$1" = "boot" ]; then
echo "copying boot.py to device..."
ampy --port $port put boot.py
elif [ "$1" = "main" ]; then
echo "copying main.py to device..."
ampy --port $port put main.py
elif [ "$1" = "include" ]; then
echo "copying include directory to device..."
ampy --port $port put include
elif [ "$1" = "src" ]; then
echo "copying src directory to device..."
ampy --port $port put src
else
for i ($items)
do
echo "copying $i to device..."
ampy --port $port put $i
done
fi