Skip to content

Commit 638eb47

Browse files
committed
Add manual NPCX EC UART flash
Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent cd79dbb commit 638eb47

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

scripts/flash_manual_ec.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
FLASHUART=ttyUSB0
19+
20+
FLASH_SRC="$1/ec.bin"
21+
MONITOR="$1/npcx_monitor.bin"
22+
echo "USING ${FLASH_SRC} to flash EC"
23+
24+
#### DO FLASH
25+
echo "Using NUVOTON Tool ./uartupdatetool"
26+
./uartupdatetool --port ${FLASHUART} --opr wr --addr 0x200c3020 --file ${MONITOR}
27+
./uartupdatetool --port ${FLASHUART} --opr wr --auto --addr 0x0000 --file ${FLASH_SRC}

0 commit comments

Comments
 (0)