Commit 0e0c488a authored by Maureen Helm's avatar Maureen Helm Committed by Fabio Utzig
Browse files

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: default avatarMaureen Helm <maureen.helm@nxp.com>
parent f9be7a9f
Loading
Loading
Loading
Loading
+2 −2
Changes for docs/testplan-mynewt.md: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -150,8 +150,8 @@ slot 0 and vice-versa.

* Mass erase MCU

        $ pyocd-flashtool -ce
        $ pyocd erase --chip

* Flashing image in slot 1:

        $ pyocd-flashtool -se --address 0x80000 ${IMG_FILE} bin
        $ pyocd flash -e sector -a 0x80000 ${IMG_FILE} bin
+4 −4
Changes for docs/testplan-zephyr.md: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ target:

Begin by doing a full erase, and programming the bootloader itself:

    $ pyocd-flashtool -ce
    $ pyocd erase --chip
    $ make flash_boot

After it resets, look for "main: Starting bootloader", a few debug
@@ -44,7 +44,7 @@ you should see "hello2".

Now reset the target::

    $ pyocd-tool reset
    $ pyocd commander -c reset

And you should see a revert and "hello1" running.

@@ -58,8 +58,8 @@ revert doesn't happen:

We should have just booted the hello2.  Mark this as OK:

    $ pyocd-flashtool -a 0x7ffe8 image_ok.bin
    $ pyocd-tool reset
    $ pyocd flash -a 0x7ffe8 image_ok.bin
    $ pyocd commander -c reset

And make sure this stays in the "hello2" image.

+5 −5
Changes for samples/zephyr/Makefile: 5 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ FLASH_ALIGNMENT = 8

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 @@ clean_hello2: check
# 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
+16 −16
Changes for samples/zephyr/run-tests.go: 16 added lines, 16 removed lines.
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ var tests = []struct {
			{
				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 @@ var tests = []struct {
			},
			{
				commands: [][]string{
					{"pyocd-tool", "reset"},
					{"pyocd", "commander", "-c", "reset"},
				},
				expect: "Hello World from hello1",
			},
@@ -82,7 +82,7 @@ var tests = []struct {
			{
				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 @@ var tests = []struct {
			},
			{
				commands: [][]string{
					{"pyocd-tool", "reset"},
					{"pyocd", "commander", "-c", "reset"},
				},
				expect: "Hello World from hello1",
			},
@@ -113,7 +113,7 @@ var tests = []struct {
			{
				commands: [][]string{
					{"make", "test-overwrite"},
					{"pyocd-flashtool", "-ce"},
					{"pyocd", "erase", "--chip"},
					{"make", "flash_boot"},
				},
				expect: "Unable to find bootable image",
@@ -132,7 +132,7 @@ var tests = []struct {
			},
			{
				commands: [][]string{
					{"pyocd-tool", "reset"},
					{"pyocd", "commander", "-c", "reset"},
				},
				expect: "Hello World from hello2",
			},
@@ -144,7 +144,7 @@ var tests = []struct {
			{
				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 @@ var tests = []struct {
			},
			{
				commands: [][]string{
					{"pyocd-tool", "reset"},
					{"pyocd", "commander", "-c", "reset"},
				},
				expect: "Hello World from hello1",
			},
@@ -175,7 +175,7 @@ var tests = []struct {
			{
				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 @@ var tests = []struct {
			},
			{
				commands: [][]string{
					{"pyocd-tool", "reset"},
					{"pyocd", "commander", "-c", "reset"},
				},
				expect: "Hello World from hello1",
			},
@@ -206,7 +206,7 @@ var tests = []struct {
			{
				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 @@ var tests = []struct {
			},
			{
				commands: [][]string{
					{"pyocd-tool", "reset"},
					{"pyocd", "commander", "-c", "reset"},
				},
				expect: "Hello World from hello1",
			},
@@ -237,7 +237,7 @@ var tests = []struct {
			{
				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 @@ var tests = []struct {
			},
			{
				commands: [][]string{
					{"pyocd-tool", "reset"},
					{"pyocd", "commander", "-c", "reset"},
				},
				expect: "Hello World from hello1",
			},
@@ -268,7 +268,7 @@ var tests = []struct {
			{
				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 @@ var tests = []struct {
			},
			{
				commands: [][]string{
					{"pyocd-tool", "reset"},
					{"pyocd", "commander", "-c", "reset"},
				},
				expect: "Hello World from hello1",
			},
+16 −16
Changes for samples/zephyr/run-tests.sh: 16 added lines, 16 removed lines.
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ set -e
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 @@ make flash_hello2
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 @@ make flash_hello2
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 @@ make flash_hello2
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 @@ make flash_hello2
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 @@ make flash_hello2
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 @@ make flash_hello2
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 @@ make flash_hello2
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 @@ make flash_hello2
echo "Expected result: hello1 runs"
ok_yn
echo "Resetting"
pyocd-tool reset
pyocd commander -c reset
echo "Expected result: hello1 runs"
ok_yn