44#
55VERSION_MAJOR := 2
66VERSION_MINOR := 2
7- VERSION_PATCH := 3
7+ VERSION_PATCH := 4
88
99BUILD_DIR := _build
1010BUILDEE_DIR := _buildee
4141#
4242ifeq ($(PICO_BOARDEE ) ,)
4343 # pico|pico_w|pico_debug_probe|pico2
44- PICO_BOARDEE := pico
44+ PICO_BOARDEE := pico2
4545endif
4646
4747PICO_CHIPEE := rp2040
@@ -221,7 +221,7 @@ show-options:
221221# - most work is done in the debuggEE
222222#
223223DEBUGGER_SERNO ?= 2739E00F30FE67E7
224- OPENOCD_R := /home/hardy /.pico-sdk/openocd/0.12.0+dev
224+ OPENOCD_R := ~ /.pico-sdk/openocd/0.12.0+dev
225225OPENOCD := $(OPENOCD_R ) /openocd
226226OPENOCD_S := $(OPENOCD_R ) /scripts
227227# DEBUGGEE_CLIB := picolibc
@@ -244,18 +244,23 @@ all-debuggEE:
244244.PHONY : debuggEE-flash
245245debuggEE-flash :
246246 $(MAKE ) all-debuggEE
247- pyocd flash -f 6M --probe $(DEBUGGER_SERNO ) -e auto $(BUILDEE_DIR ) /$(PROJECT ) .hex
247+ pyocd flash -t $(PICO_CHIPEE ) -f 6M --probe $(DEBUGGER_SERNO ) -e auto $(BUILDEE_DIR ) /$(PROJECT ) .hex
248+ # pyocd flash -t $(PICO_CHIPEE) -f 6M --probe $(DEBUGGER_SERNO) -e auto -L "pyocd.probe.*=debug" $(BUILDEE_DIR)/$(PROJECT).hex
249+ @echo "ok."
250+
251+ .PHONY : debuggEE-flash-cp
252+ debuggEE-flash-cp :
253+ $(MAKE ) all-debuggEE
254+ cp $(BUILDEE_DIR ) /$(PROJECT ) .uf2 /media/picoprobe
248255 @echo " ok."
249256
250257.PHONY : debuggEE-flash-openocd
251258debuggEE-flash-openocd :
252259 $(MAKE ) all-debuggEE
253260 # openocd does much faster flashing
254- $(OPENOCD ) -s $(OPENOCD_S ) -f interface/cmsis-dap.cfg -f target/$(PICO_CHIPEE ) .cfg \
261+ $(OPENOCD ) -s $(OPENOCD_S ) -f interface/cmsis-dap.cfg -f target/$(PICO_CHIPEE ) .cfg \
255262 -c " adapter speed 6000; adapter serial $( DEBUGGER_SERNO) " \
256- -c " program {$( BUILDEE_DIR) /$( PROJECT) .hex} verify; exit;"
257- # "pyocd reset" required to start
258- pyocd reset -f 6M --probe $(DEBUGGER_SERNO )
263+ -c " program {$( BUILDEE_DIR) /$( PROJECT) .hex} verify reset exit"
259264 @echo " ok."
260265
261266.PHONY : debuggEE-flash-probe-rs
@@ -277,19 +282,19 @@ debuggEE-flash-erase:
277282 # -c "adapter speed 6000; adapter serial $(DEBUGGER_SERNO)" \
278283 # -c "flash init; flash list; flash banks; init; flash erase_address 0x10000000 0x10000; init; exit;"
279284 # and this one is slow because chip erase is not implemented in the blobs (src/daplink-pico/family/raspberry/flash_blob.c)
280- pyocd erase --mass
285+ pyocd erase --mass -t $( PICO_CHIPEE ) -f 6M --probe $( DEBUGGER_SERNO )
281286 @echo " ok."
282287
283288
284289.PHONY : debuggEE-reset
285290debuggEE-reset :
286- pyocd reset -v -f 6M --probe $(DEBUGGER_SERNO )
291+ pyocd reset -v -t $( PICO_CHIPEE ) - f 6M --probe $(DEBUGGER_SERNO )
287292
288293.PHONY : debuggEE-reset-openocd
289294debuggEE-reset-openocd :
290295 $(OPENOCD ) -s $(OPENOCD_S ) -f interface/cmsis-dap.cfg -f target/$(PICO_CHIPEE ) .cfg \
291296 -c " adapter speed 6000; adapter serial $( DEBUGGER_SERNO) " \
292- -c " init; exit;"
297+ -c " init; reset run; exit;"
293298
294299.PHONY : debuggEE-reset-probe-rs
295300debuggEE-reset-probe-rs :
@@ -302,7 +307,7 @@ cmake-create-debuggEE: clean-build-debuggEE
302307 $(CMAKE_FLAGS ) \
303308 -DPICO_CLIB=$(DEBUGGEE_CLIB) \
304309 -DOPT_NET= -DOPT_PROBE_DEBUG_OUT=RTT \
305- -DOPT_SIGROK=0 -DOPT_MSC=0 -DOPT_CMSIS_DAPV1=0 -DOPT_CMSIS_DAPV2=0 -DOPT_TARGET_UART=1
310+ -DOPT_SIGROK=0 -DOPT_MSC=0 -DOPT_CMSIS_DAPV1=0 -DOPT_CMSIS_DAPV2=1 -DOPT_TARGET_UART=1
306311
307312
308313.PHONY : cmake-create-debuggEE-clang
@@ -313,7 +318,7 @@ cmake-create-debuggEE-clang: clean-build-debuggEE
313318 -DPICO_CLIB=llvm_libc \
314319 -DPICO_COMPILER=pico_arm_clang \
315320 -DOPT_NET= -DOPT_PROBE_DEBUG_OUT=RTT \
316- -DOPT_SIGROK=0 -DOPT_MSC=0 -DOPT_CMSIS_DAPV1=0 -DOPT_CMSIS_DAPV2=0 -DOPT_TARGET_UART=1
321+ -DOPT_SIGROK=0 -DOPT_MSC=0 -DOPT_CMSIS_DAPV1=0 -DOPT_CMSIS_DAPV2=1 -DOPT_TARGET_UART=1
317322
318323
319324.PHONY : cmake-create-debuggEE-release
@@ -322,7 +327,7 @@ cmake-create-debuggEE-release: clean-build-debuggEE
322327 $(CMAKE_FLAGS ) \
323328 -DPICO_CLIB=$(DEBUGGEE_CLIB ) \
324329 -DOPT_NET= -DOPT_PROBE_DEBUG_OUT=RTT \
325- -DOPT_SIGROK=1 -DOPT_MSC=0 -DOPT_CMSIS_DAPV1=0 -DOPT_CMSIS_DAPV2=0 -DOPT_TARGET_UART=1
330+ -DOPT_SIGROK=1 -DOPT_MSC=0 -DOPT_CMSIS_DAPV1=0 -DOPT_CMSIS_DAPV2=1 -DOPT_TARGET_UART=1
326331
327332
328333.PHONY : cmake-create-debugger
@@ -331,3 +336,15 @@ cmake-create-debugger: clean-build
331336 $(CMAKE_FLAGS ) \
332337 -DPICO_CLIB=newlib \
333338 -DOPT_NET= -DOPT_SIGROK=0 -DOPT_MSC=0
339+
340+
341+ .PHONY : benchmark-probe-rs
342+ benchmark-probe-rs :
343+ probe-rs benchmark --protocol swd --address 0x20020000 --min-speed 1000 --max-speed 10000 --chip $(PICO_CHIPEE )
344+
345+
346+ # this is actually just a reminder for the probe-rs command line
347+ # "probe-rs gdb" does actually not run well under Eclipse(?)
348+ .PHONY : gdb-server-probe-rs
349+ gdb-server-probe-rs :
350+ probe-rs gdb --chip rp2350 --gdb-connection-string 127.0.0.1:3333 --speed 9000 --protocol swd
0 commit comments