Skip to content

Commit b4bba0a

Browse files
Merge pull request #7 from FrameworkComputer/manual-flash
Flash Nuvoton using minimal UART adapter setup
2 parents cd79dbb + ecd241f commit b4bba0a

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

scripts/flash_manual_ec.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
3+
# Only works on NPCX EC chips
4+
# Every Framework system, except 11-13th Gen Intel
5+
#
6+
# Using bare UART adapter with manual reset/flashmode buttons
7+
# Usage:
8+
# 0. Connect USB-UART adapter to EC UART (TX, RX, GND)
9+
# 1. Hold down flashmode button (5.1k from EC UART TX to GND)
10+
# 2. Press and release EC reset button (RST short to GND)
11+
# 3. Run this script to flash
12+
# ./flash_manual_ec.sh ~/Downloads/sunflower/
13+
# Where the folder contains ec.bin and npcx_monitor.bin
14+
# If the adapter shows up at a different port, set it in an environment variable:
15+
# env FLASHUART=ttyUSB1 ./flash_manual_ec.sh ~/Downloads/sunflower/
16+
# 4. Press and release EC reset button to boot EC again
17+
#
18+
# Useful to combine with the gh command
19+
# > gh run download -R FrameworkComputer/ec -D temp
20+
# > ./flash_manual_ec.sh temp/
21+
# Or with chromium chroot build
22+
# > ./flash_manual_ec.sh ~/chromiumos/src/platform/ec/build/zephyr/marigold/output/
23+
24+
FLASHUART=ttyUSB0
25+
26+
FLASH_SRC="$1/ec.bin"
27+
MONITOR="$1/npcx_monitor.bin"
28+
echo "USING ${FLASH_SRC} to flash EC"
29+
30+
#### DO FLASH
31+
echo "Using NUVOTON Tool ./uartupdatetool"
32+
./uartupdatetool --port ${FLASHUART} --opr wr --addr 0x200c3020 --file ${MONITOR}
33+
./uartupdatetool --port ${FLASHUART} --opr wr --auto --addr 0x0000 --file ${FLASH_SRC}

0 commit comments

Comments
 (0)