# запуск OpenOCD
$ openocd -f interface/cmsis-dap.cfg -c "set USE_CORE SMP" \
-f target/rp2040.cfg -c "adapter speed 5000"
# запуск с GDB
gdb-multiarch cmake-build-debug/blink/blink.elf
GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from cmake-build-debug/blink/blink.elf...
(gdb) target extended-remote :3333
Remote debugging using :3333
Remote connection closed
(gdb)
Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
SMP
adapter speed: 5000 kHz
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : Using CMSIS-DAPv2 interface with VID:PID=0x2e8a:0x000c, serial=459B221747675453
Info : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: Atomic commands supported
Info : CMSIS-DAP: Test domain timer supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 0 TDI = 0 TDO = 0 nTRST = 0 nRESET = 0
Info : CMSIS-DAP: Interface ready
Info : clock speed 5000 kHz
Info : SWD DPIDR 0x0bc12477, DLPIDR 0x00000001
Info : SWD DPIDR 0x0bc12477, DLPIDR 0x10000001
Info : [rp2040.core0] Cortex-M0+ r0p1 processor detected
Info : [rp2040.core0] target has 4 breakpoints, 2 watchpoints
Info : [rp2040.core1] Cortex-M0+ r0p1 processor detected
Info : [rp2040.core1] target has 4 breakpoints, 2 watchpoints
Info : starting gdb server for rp2040.core0 on 3333
Info : Listening on port 3333 for gdb connections
Info : starting gdb server for rp2040.core1 on 3334
Info : Listening on port 3334 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Error: Unknown flash device (ID 0x00184068)
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected
Error: Unknown flash device (ID 0x0016405e)
FLASH_ID(
"by25q128es", // название чипа
0x03, // "Read Data" - команда чтения
0x0b, // "Quick Read" - ускоренное чтение
0x02, // "Page Program" - записать "страницу"
0xd8, // "64K Block Erase" - стереть блок
0xc7, // "Chip Erase" - стереть всё
0x00184068, // ID производителя / устройства
0x100, // 256 байт, размер "страницы" для записи
0x10000, // 64KiB, размер стираемого блока(в байтах)
0x1000000 // 16MiB, общий объём памяти(в байтах)
),
FLASH_ID("zbit zb25vq32" , 0x03, 0x0b, 0x02, 0xd8, 0xc7, 0x0016405e, 0x100, 0x10000, 0x0400000),
# allow skip flash auto_probe
if { [info exists FLASH_SIZE] } {
set _FLASH_SIZE $FLASH_SIZE
} else {
set _FLASH_SIZE 0
}
# flash bank $_FLASHNAME rp2040_flash 0x10000000 0 0 0 $_FLASH_TARGET
flash bank $_FLASHNAME rp2040_flash 0x10000000 $_FLASH_SIZE 0 0 $_FLASH_TARGET
if { $_BOTH_CORES } {
# Alias to ensure gdb connecting to core 1 gets the correct memory map
# flash bank $_CHIPNAME.alias virtual 0x10000000 0 0 0 $_TARGETNAME_1 $_FLASHNAME
flash bank $_CHIPNAME.alias virtual 0x10000000 $_FLASH_SIZE 0 0 $_TARGETNAME_1 $_FLASHNAME
# Select core 0
targets $_TARGETNAME_0
}