From a1948c9cfdc8926d5acbe399350c2c6974966ae6 Mon Sep 17 00:00:00 2001 From: sq2ips Date: Thu, 10 Apr 2025 11:14:22 +0200 Subject: [PATCH] Fix protect command --- README.md | 4 ++-- m20/Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b9ee30f..7065e2d 100644 --- a/README.md +++ b/README.md @@ -239,7 +239,7 @@ make protect ``` or if you don't have `make` or want to run it directly: ```bash -openocd -s ./openocd/ -f ./openocd/openocd_m20.cfg -c "init; halt; flash protect 0 0 7 reset; exit" +openocd -s ./openocd/ -f ./openocd/openocd_m20.cfg -c "init; halt; flash protect 0 0 7 off; exit" ``` After it finishes you can flash the built firmware: ```bash @@ -255,7 +255,7 @@ After it finishes your sonde should now work with the new firmware. First [download OpenOCD](https://github.com/xpack-dev-tools/openocd-xpack/releases/latest) select the file with ending `win32-x64.zip`, then extract it. Go to the path of the project then to `m20/`. Ensure that ST-Link is connected and then remove the write protection (only before the first flash): ```cmd -\bin\openocd.exe -s openocd -f openocd\openocd_m20.cfg -c "init; halt; flash protect 0 0 7 reset; exit" +\bin\openocd.exe -s openocd -f openocd\openocd_m20.cfg -c "init; halt; flash protect 0 0 7 off; exit" ``` replace `` with path of the extracted program. After it finishes you can flash the built firmware: diff --git a/m20/Makefile b/m20/Makefile index 9653be2..d9a2421 100644 --- a/m20/Makefile +++ b/m20/Makefile @@ -212,6 +212,6 @@ flash: openocd -s ./openocd/ -f ./openocd/openocd_m20.cfg -c "program build/m20.elf verify reset exit" # remove protect protect: - openocd -s ./openocd/ -f ./openocd/openocd_m20.cfg -c "init; halt; flash protect 0 0 7 reset; exit" + openocd -s ./openocd/ -f ./openocd/openocd_m20.cfg -c "init; halt; flash protect 0 0 7 off; exit" # *** EOF ***