2022-02-18 08:00:01 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
run_jlinkserver() {
|
2022-02-19 08:01:36 +00:00
|
|
|
JLinkGDBServerCLExe -if SWD -device NUC220LE3AN \
|
|
|
|
-ir -nogui \
|
|
|
|
-localhostonly -port 3333 \
|
2022-02-18 08:00:01 +00:00
|
|
|
-rtos GDBServer/RTOSPlugin_FreeRTOS.so
|
|
|
|
}
|
|
|
|
|
|
|
|
run_openocd_jlink() {
|
2022-02-19 08:01:36 +00:00
|
|
|
openocd -f "interface/jlink.cfg" -c "transport select swd" -f "target/numicro.cfg"
|
2022-02-18 08:00:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
run_pyocd() {
|
2022-02-19 08:01:36 +00:00
|
|
|
echo "Note: pyOCD uses low level DAP APIs provided by J-LINK," \
|
|
|
|
"speed settings and other functions may not available."
|
2022-02-19 13:01:33 +00:00
|
|
|
pyocd gdbserver -t nuc220le3an -f 4m --persist
|
2022-02-18 08:00:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case $1 in
|
2022-02-19 08:01:36 +00:00
|
|
|
jlink)
|
|
|
|
run_jlinkserver
|
|
|
|
;;
|
|
|
|
|
|
|
|
pyocd)
|
|
|
|
run_pyocd
|
|
|
|
;;
|
|
|
|
|
|
|
|
openocd-jlink)
|
|
|
|
run_openocd_jlink
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "Usage: run_debugserver.sh jlink|pyocd|openocd-jlink"
|
|
|
|
;;
|
|
|
|
esac
|