docs: samples: Update pyocd calls to unified tool subcommands
pyocd 0.14.0 merged its command-line tools into a unified pyocd tool
with subcommands. The separate command-line tools still remain, but are
deprecated. Update all pyocd calls in samples and documentation to use
the new unified pyocd tool with subcommands.
Note that pyocd 0.15.0 has an issue with the command 'pyocd erase',
which was fixed in pyocd 0.16.0.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
diff --git a/samples/zephyr/Makefile b/samples/zephyr/Makefile
index 5c3924c..938468e 100644
--- a/samples/zephyr/Makefile
+++ b/samples/zephyr/Makefile
@@ -75,7 +75,7 @@
IMGTOOL = ../../scripts/imgtool.py
ASSEMBLE = ../../scripts/assemble.py
-PYOCD_FLASHTOOL = pyocd-flashtool
+PYOCD = pyocd
SOURCE_DIRECTORY := $(CURDIR)
BUILD_DIRECTORY := $(CURDIR)/build/$(BOARD)
@@ -166,16 +166,16 @@
# are hardcoded at this time.
flash_boot:
- $(PYOCD_FLASHTOOL) -ce -a 0 mcuboot.bin
+ $(PYOCD) flash -e chip -a 0 mcuboot.bin
flash_hello1:
- $(PYOCD_FLASHTOOL) -a 0x20000 signed-hello1.bin
+ $(PYOCD) flash -a 0x20000 signed-hello1.bin
flash_hello2:
- $(PYOCD_FLASHTOOL) -a 0x80000 signed-hello2.bin
+ $(PYOCD) flash -a 0x80000 signed-hello2.bin
flash_full:
- $(PYOCD_FLASHTOOL) -ce -a 0 full.bin
+ $(PYOCD) flash -e chip -a 0 full.bin
# These test- targets reinvoke make with the configuration set to test
# various configurations. This will generally be followed by using
diff --git a/samples/zephyr/run-tests.go b/samples/zephyr/run-tests.go
index 45c0a19..1b1fd76 100644
--- a/samples/zephyr/run-tests.go
+++ b/samples/zephyr/run-tests.go
@@ -51,7 +51,7 @@
{
commands: [][]string{
{"make", "test-good-rsa"},
- {"pyocd-flashtool", "-ce"},
+ {"pyocd", "erase", "--chip"},
{"make", "flash_boot"},
},
expect: "Unable to find bootable image",
@@ -70,7 +70,7 @@
},
{
commands: [][]string{
- {"pyocd-tool", "reset"},
+ {"pyocd", "commander", "-c", "reset"},
},
expect: "Hello World from hello1",
},
@@ -82,7 +82,7 @@
{
commands: [][]string{
{"make", "test-good-ecdsa"},
- {"pyocd-flashtool", "-ce"},
+ {"pyocd", "erase", "--chip"},
{"make", "flash_boot"},
},
expect: "Unable to find bootable image",
@@ -101,7 +101,7 @@
},
{
commands: [][]string{
- {"pyocd-tool", "reset"},
+ {"pyocd", "commander", "-c", "reset"},
},
expect: "Hello World from hello1",
},
@@ -113,7 +113,7 @@
{
commands: [][]string{
{"make", "test-overwrite"},
- {"pyocd-flashtool", "-ce"},
+ {"pyocd", "erase", "--chip"},
{"make", "flash_boot"},
},
expect: "Unable to find bootable image",
@@ -132,7 +132,7 @@
},
{
commands: [][]string{
- {"pyocd-tool", "reset"},
+ {"pyocd", "commander", "-c", "reset"},
},
expect: "Hello World from hello2",
},
@@ -144,7 +144,7 @@
{
commands: [][]string{
{"make", "test-bad-rsa-upgrade"},
- {"pyocd-flashtool", "-ce"},
+ {"pyocd", "erase", "--chip"},
{"make", "flash_boot"},
},
expect: "Unable to find bootable image",
@@ -163,7 +163,7 @@
},
{
commands: [][]string{
- {"pyocd-tool", "reset"},
+ {"pyocd", "commander", "-c", "reset"},
},
expect: "Hello World from hello1",
},
@@ -175,7 +175,7 @@
{
commands: [][]string{
{"make", "test-bad-ecdsa-upgrade"},
- {"pyocd-flashtool", "-ce"},
+ {"pyocd", "erase", "--chip"},
{"make", "flash_boot"},
},
expect: "Unable to find bootable image",
@@ -194,7 +194,7 @@
},
{
commands: [][]string{
- {"pyocd-tool", "reset"},
+ {"pyocd", "commander", "-c", "reset"},
},
expect: "Hello World from hello1",
},
@@ -206,7 +206,7 @@
{
commands: [][]string{
{"make", "test-no-bootcheck"},
- {"pyocd-flashtool", "-ce"},
+ {"pyocd", "erase", "--chip"},
{"make", "flash_boot"},
},
expect: "Unable to find bootable image",
@@ -225,7 +225,7 @@
},
{
commands: [][]string{
- {"pyocd-tool", "reset"},
+ {"pyocd", "commander", "-c", "reset"},
},
expect: "Hello World from hello1",
},
@@ -237,7 +237,7 @@
{
commands: [][]string{
{"make", "test-wrong-rsa"},
- {"pyocd-flashtool", "-ce"},
+ {"pyocd", "erase", "--chip"},
{"make", "flash_boot"},
},
expect: "Unable to find bootable image",
@@ -256,7 +256,7 @@
},
{
commands: [][]string{
- {"pyocd-tool", "reset"},
+ {"pyocd", "commander", "-c", "reset"},
},
expect: "Hello World from hello1",
},
@@ -268,7 +268,7 @@
{
commands: [][]string{
{"make", "test-wrong-ecdsa"},
- {"pyocd-flashtool", "-ce"},
+ {"pyocd", "erase", "--chip"},
{"make", "flash_boot"},
},
expect: "Unable to find bootable image",
@@ -287,7 +287,7 @@
},
{
commands: [][]string{
- {"pyocd-tool", "reset"},
+ {"pyocd", "commander", "-c", "reset"},
},
expect: "Hello World from hello1",
},
diff --git a/samples/zephyr/run-tests.sh b/samples/zephyr/run-tests.sh
index a6794d6..e2e4a9c 100755
--- a/samples/zephyr/run-tests.sh
+++ b/samples/zephyr/run-tests.sh
@@ -33,7 +33,7 @@
echo '--------------------------------------------------------'
echo '------------------------ GOOD RSA ----------------------'
make test-good-rsa
-pyocd-flashtool -ce
+pyocd erase --chip
echo "Flashing bootloader"
make flash_boot
echo "Expected result: unable to find bootable image"
@@ -47,14 +47,14 @@
echo "Expected result: hello2 runs"
ok_yn
echo "Resetting"
-pyocd-tool reset
+pyocd commander -c reset
echo "Expected result: hello1 runs"
ok_yn
echo '--------------------------------------------------------'
echo '------------------------ GOOD ECDSA --------------------'
make test-good-ecdsa
-pyocd-flashtool -ce
+pyocd erase --chip
make flash_boot
echo "Expected result: unable to find bootable image"
ok_yn
@@ -67,14 +67,14 @@
echo "Expected result: hello2 runs"
ok_yn
echo "Resetting"
-pyocd-tool reset
+pyocd commander -c reset
echo "Expected result: hello1 runs"
ok_yn
echo '--------------------------------------------------------'
echo '------------------------ OVERWRITE ---------------------'
make test-overwrite
-pyocd-flashtool -ce
+pyocd erase --chip
make flash_boot
echo "Expected result: unable to find bootable image"
ok_yn
@@ -87,14 +87,14 @@
echo "Expected result: hello2 runs"
ok_yn
echo "Resetting"
-pyocd-tool reset
+pyocd commander -c reset
echo "Expected result: hello2 runs"
ok_yn
echo '--------------------------------------------------------'
echo '------------------------ BAD RSA -----------------------'
make test-bad-rsa-upgrade
-pyocd-flashtool -ce
+pyocd erase --chip
make flash_boot
echo "Expected result: unable to find bootable image"
ok_yn
@@ -107,14 +107,14 @@
echo "Expected result: hello1 runs"
ok_yn
echo "Resetting"
-pyocd-tool reset
+pyocd commander -c reset
echo "Expected result: hello1 runs"
ok_yn
echo '--------------------------------------------------------'
echo '------------------------ BAD ECDSA ---------------------'
make test-bad-ecdsa-upgrade
-pyocd-flashtool -ce
+pyocd erase --chip
make flash_boot
echo "Expected result: unable to find bootable image"
ok_yn
@@ -127,14 +127,14 @@
echo "Expected result: hello1 runs"
ok_yn
echo "Resetting"
-pyocd-tool reset
+pyocd commander -c reset
echo "Expected result: hello1 runs"
ok_yn
echo '--------------------------------------------------------'
echo '------------------------ NO BOOTCHECK ------------------'
make test-no-bootcheck
-pyocd-flashtool -ce
+pyocd erase --chip
make flash_boot
echo "Expected result: unable to find bootable image"
ok_yn
@@ -147,14 +147,14 @@
echo "Expected result: hello1 runs"
ok_yn
echo "Resetting"
-pyocd-tool reset
+pyocd commander -c reset
echo "Expected result: hello1 runs"
ok_yn
echo '--------------------------------------------------------'
echo '------------------------ WRONG RSA ---------------------'
make test-wrong-rsa
-pyocd-flashtool -ce
+pyocd erase --chip
make flash_boot
echo "Expected result: unable to find bootable image"
ok_yn
@@ -167,14 +167,14 @@
echo "Expected result: hello1 runs"
ok_yn
echo "Resetting"
-pyocd-tool reset
+pyocd commander -c reset
echo "Expected result: hello1 runs"
ok_yn
echo '--------------------------------------------------------'
echo '------------------------ WRONG ECDSA -------------------'
make test-wrong-ecdsa
-pyocd-flashtool -ce
+pyocd erase --chip
make flash_boot
echo "Expected result: unable to find bootable image"
ok_yn
@@ -187,7 +187,7 @@
echo "Expected result: hello1 runs"
ok_yn
echo "Resetting"
-pyocd-tool reset
+pyocd commander -c reset
echo "Expected result: hello1 runs"
ok_yn