Skip to content

Commit 0e0c488

Browse files
MaureenHelmutzig
authored andcommitted
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 <[email protected]>
1 parent f9be7a9 commit 0e0c488

File tree

5 files changed

+43
-43
lines changed

5 files changed

+43
-43
lines changed

docs/testplan-mynewt.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ slot 0 and vice-versa.
150150

151151
* Mass erase MCU
152152

153-
$ pyocd-flashtool -ce
153+
$ pyocd erase --chip
154154

155155
* Flashing image in slot 1:
156156

157-
$ pyocd-flashtool -se --address 0x80000 ${IMG_FILE} bin
157+
$ pyocd flash -e sector -a 0x80000 ${IMG_FILE} bin

docs/testplan-zephyr.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ target:
2020

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

23-
$ pyocd-flashtool -ce
23+
$ pyocd erase --chip
2424
$ make flash_boot
2525

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

4545
Now reset the target::
4646

47-
$ pyocd-tool reset
47+
$ pyocd commander -c reset
4848

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

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

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

61-
$ pyocd-flashtool -a 0x7ffe8 image_ok.bin
62-
$ pyocd-tool reset
61+
$ pyocd flash -a 0x7ffe8 image_ok.bin
62+
$ pyocd commander -c reset
6363

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

samples/zephyr/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ FLASH_ALIGNMENT = 8
7575

7676
IMGTOOL = ../../scripts/imgtool.py
7777
ASSEMBLE = ../../scripts/assemble.py
78-
PYOCD_FLASHTOOL = pyocd-flashtool
78+
PYOCD = pyocd
7979

8080
SOURCE_DIRECTORY := $(CURDIR)
8181
BUILD_DIRECTORY := $(CURDIR)/build/$(BOARD)
@@ -166,16 +166,16 @@ clean_hello2: check
166166
# are hardcoded at this time.
167167

168168
flash_boot:
169-
$(PYOCD_FLASHTOOL) -ce -a 0 mcuboot.bin
169+
$(PYOCD) flash -e chip -a 0 mcuboot.bin
170170

171171
flash_hello1:
172-
$(PYOCD_FLASHTOOL) -a 0x20000 signed-hello1.bin
172+
$(PYOCD) flash -a 0x20000 signed-hello1.bin
173173

174174
flash_hello2:
175-
$(PYOCD_FLASHTOOL) -a 0x80000 signed-hello2.bin
175+
$(PYOCD) flash -a 0x80000 signed-hello2.bin
176176

177177
flash_full:
178-
$(PYOCD_FLASHTOOL) -ce -a 0 full.bin
178+
$(PYOCD) flash -e chip -a 0 full.bin
179179

180180
# These test- targets reinvoke make with the configuration set to test
181181
# various configurations. This will generally be followed by using

samples/zephyr/run-tests.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var tests = []struct {
5151
{
5252
commands: [][]string{
5353
{"make", "test-good-rsa"},
54-
{"pyocd-flashtool", "-ce"},
54+
{"pyocd", "erase", "--chip"},
5555
{"make", "flash_boot"},
5656
},
5757
expect: "Unable to find bootable image",
@@ -70,7 +70,7 @@ var tests = []struct {
7070
},
7171
{
7272
commands: [][]string{
73-
{"pyocd-tool", "reset"},
73+
{"pyocd", "commander", "-c", "reset"},
7474
},
7575
expect: "Hello World from hello1",
7676
},
@@ -82,7 +82,7 @@ var tests = []struct {
8282
{
8383
commands: [][]string{
8484
{"make", "test-good-ecdsa"},
85-
{"pyocd-flashtool", "-ce"},
85+
{"pyocd", "erase", "--chip"},
8686
{"make", "flash_boot"},
8787
},
8888
expect: "Unable to find bootable image",
@@ -101,7 +101,7 @@ var tests = []struct {
101101
},
102102
{
103103
commands: [][]string{
104-
{"pyocd-tool", "reset"},
104+
{"pyocd", "commander", "-c", "reset"},
105105
},
106106
expect: "Hello World from hello1",
107107
},
@@ -113,7 +113,7 @@ var tests = []struct {
113113
{
114114
commands: [][]string{
115115
{"make", "test-overwrite"},
116-
{"pyocd-flashtool", "-ce"},
116+
{"pyocd", "erase", "--chip"},
117117
{"make", "flash_boot"},
118118
},
119119
expect: "Unable to find bootable image",
@@ -132,7 +132,7 @@ var tests = []struct {
132132
},
133133
{
134134
commands: [][]string{
135-
{"pyocd-tool", "reset"},
135+
{"pyocd", "commander", "-c", "reset"},
136136
},
137137
expect: "Hello World from hello2",
138138
},
@@ -144,7 +144,7 @@ var tests = []struct {
144144
{
145145
commands: [][]string{
146146
{"make", "test-bad-rsa-upgrade"},
147-
{"pyocd-flashtool", "-ce"},
147+
{"pyocd", "erase", "--chip"},
148148
{"make", "flash_boot"},
149149
},
150150
expect: "Unable to find bootable image",
@@ -163,7 +163,7 @@ var tests = []struct {
163163
},
164164
{
165165
commands: [][]string{
166-
{"pyocd-tool", "reset"},
166+
{"pyocd", "commander", "-c", "reset"},
167167
},
168168
expect: "Hello World from hello1",
169169
},
@@ -175,7 +175,7 @@ var tests = []struct {
175175
{
176176
commands: [][]string{
177177
{"make", "test-bad-ecdsa-upgrade"},
178-
{"pyocd-flashtool", "-ce"},
178+
{"pyocd", "erase", "--chip"},
179179
{"make", "flash_boot"},
180180
},
181181
expect: "Unable to find bootable image",
@@ -194,7 +194,7 @@ var tests = []struct {
194194
},
195195
{
196196
commands: [][]string{
197-
{"pyocd-tool", "reset"},
197+
{"pyocd", "commander", "-c", "reset"},
198198
},
199199
expect: "Hello World from hello1",
200200
},
@@ -206,7 +206,7 @@ var tests = []struct {
206206
{
207207
commands: [][]string{
208208
{"make", "test-no-bootcheck"},
209-
{"pyocd-flashtool", "-ce"},
209+
{"pyocd", "erase", "--chip"},
210210
{"make", "flash_boot"},
211211
},
212212
expect: "Unable to find bootable image",
@@ -225,7 +225,7 @@ var tests = []struct {
225225
},
226226
{
227227
commands: [][]string{
228-
{"pyocd-tool", "reset"},
228+
{"pyocd", "commander", "-c", "reset"},
229229
},
230230
expect: "Hello World from hello1",
231231
},
@@ -237,7 +237,7 @@ var tests = []struct {
237237
{
238238
commands: [][]string{
239239
{"make", "test-wrong-rsa"},
240-
{"pyocd-flashtool", "-ce"},
240+
{"pyocd", "erase", "--chip"},
241241
{"make", "flash_boot"},
242242
},
243243
expect: "Unable to find bootable image",
@@ -256,7 +256,7 @@ var tests = []struct {
256256
},
257257
{
258258
commands: [][]string{
259-
{"pyocd-tool", "reset"},
259+
{"pyocd", "commander", "-c", "reset"},
260260
},
261261
expect: "Hello World from hello1",
262262
},
@@ -268,7 +268,7 @@ var tests = []struct {
268268
{
269269
commands: [][]string{
270270
{"make", "test-wrong-ecdsa"},
271-
{"pyocd-flashtool", "-ce"},
271+
{"pyocd", "erase", "--chip"},
272272
{"make", "flash_boot"},
273273
},
274274
expect: "Unable to find bootable image",
@@ -287,7 +287,7 @@ var tests = []struct {
287287
},
288288
{
289289
commands: [][]string{
290-
{"pyocd-tool", "reset"},
290+
{"pyocd", "commander", "-c", "reset"},
291291
},
292292
expect: "Hello World from hello1",
293293
},

samples/zephyr/run-tests.sh

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ set -e
3333
echo '--------------------------------------------------------'
3434
echo '------------------------ GOOD RSA ----------------------'
3535
make test-good-rsa
36-
pyocd-flashtool -ce
36+
pyocd erase --chip
3737
echo "Flashing bootloader"
3838
make flash_boot
3939
echo "Expected result: unable to find bootable image"
@@ -47,14 +47,14 @@ make flash_hello2
4747
echo "Expected result: hello2 runs"
4848
ok_yn
4949
echo "Resetting"
50-
pyocd-tool reset
50+
pyocd commander -c reset
5151
echo "Expected result: hello1 runs"
5252
ok_yn
5353

5454
echo '--------------------------------------------------------'
5555
echo '------------------------ GOOD ECDSA --------------------'
5656
make test-good-ecdsa
57-
pyocd-flashtool -ce
57+
pyocd erase --chip
5858
make flash_boot
5959
echo "Expected result: unable to find bootable image"
6060
ok_yn
@@ -67,14 +67,14 @@ make flash_hello2
6767
echo "Expected result: hello2 runs"
6868
ok_yn
6969
echo "Resetting"
70-
pyocd-tool reset
70+
pyocd commander -c reset
7171
echo "Expected result: hello1 runs"
7272
ok_yn
7373

7474
echo '--------------------------------------------------------'
7575
echo '------------------------ OVERWRITE ---------------------'
7676
make test-overwrite
77-
pyocd-flashtool -ce
77+
pyocd erase --chip
7878
make flash_boot
7979
echo "Expected result: unable to find bootable image"
8080
ok_yn
@@ -87,14 +87,14 @@ make flash_hello2
8787
echo "Expected result: hello2 runs"
8888
ok_yn
8989
echo "Resetting"
90-
pyocd-tool reset
90+
pyocd commander -c reset
9191
echo "Expected result: hello2 runs"
9292
ok_yn
9393

9494
echo '--------------------------------------------------------'
9595
echo '------------------------ BAD RSA -----------------------'
9696
make test-bad-rsa-upgrade
97-
pyocd-flashtool -ce
97+
pyocd erase --chip
9898
make flash_boot
9999
echo "Expected result: unable to find bootable image"
100100
ok_yn
@@ -107,14 +107,14 @@ make flash_hello2
107107
echo "Expected result: hello1 runs"
108108
ok_yn
109109
echo "Resetting"
110-
pyocd-tool reset
110+
pyocd commander -c reset
111111
echo "Expected result: hello1 runs"
112112
ok_yn
113113

114114
echo '--------------------------------------------------------'
115115
echo '------------------------ BAD ECDSA ---------------------'
116116
make test-bad-ecdsa-upgrade
117-
pyocd-flashtool -ce
117+
pyocd erase --chip
118118
make flash_boot
119119
echo "Expected result: unable to find bootable image"
120120
ok_yn
@@ -127,14 +127,14 @@ make flash_hello2
127127
echo "Expected result: hello1 runs"
128128
ok_yn
129129
echo "Resetting"
130-
pyocd-tool reset
130+
pyocd commander -c reset
131131
echo "Expected result: hello1 runs"
132132
ok_yn
133133

134134
echo '--------------------------------------------------------'
135135
echo '------------------------ NO BOOTCHECK ------------------'
136136
make test-no-bootcheck
137-
pyocd-flashtool -ce
137+
pyocd erase --chip
138138
make flash_boot
139139
echo "Expected result: unable to find bootable image"
140140
ok_yn
@@ -147,14 +147,14 @@ make flash_hello2
147147
echo "Expected result: hello1 runs"
148148
ok_yn
149149
echo "Resetting"
150-
pyocd-tool reset
150+
pyocd commander -c reset
151151
echo "Expected result: hello1 runs"
152152
ok_yn
153153

154154
echo '--------------------------------------------------------'
155155
echo '------------------------ WRONG RSA ---------------------'
156156
make test-wrong-rsa
157-
pyocd-flashtool -ce
157+
pyocd erase --chip
158158
make flash_boot
159159
echo "Expected result: unable to find bootable image"
160160
ok_yn
@@ -167,14 +167,14 @@ make flash_hello2
167167
echo "Expected result: hello1 runs"
168168
ok_yn
169169
echo "Resetting"
170-
pyocd-tool reset
170+
pyocd commander -c reset
171171
echo "Expected result: hello1 runs"
172172
ok_yn
173173

174174
echo '--------------------------------------------------------'
175175
echo '------------------------ WRONG ECDSA -------------------'
176176
make test-wrong-ecdsa
177-
pyocd-flashtool -ce
177+
pyocd erase --chip
178178
make flash_boot
179179
echo "Expected result: unable to find bootable image"
180180
ok_yn
@@ -187,7 +187,7 @@ make flash_hello2
187187
echo "Expected result: hello1 runs"
188188
ok_yn
189189
echo "Resetting"
190-
pyocd-tool reset
190+
pyocd commander -c reset
191191
echo "Expected result: hello1 runs"
192192
ok_yn
193193

0 commit comments

Comments
 (0)