From: Liviu I. <il...@li...> - 2025-09-30 10:23:47
|
Hi, I have a test application that I build on various boards and run via openocd. When I try to run it on the Pico, things are fine up to the moment when I try to run the application: ``` test 1 Start 1: rtos-apis-test 1: Test command: /Users/ilg/MyProjects/micro-os-plus.github/micro-os-plus-iii/micro-os-plus-iii.git/tests/build/raspberrypi-pico-cmake-debug/xpacks/.bin/openocd "-c" "gdb port disabled" "-c" "tcl port disabled" "-c" "telnet port disabled" "-f" "interface/cmsis-dap.cfg" "-f" "target/rp2040.cfg" "-c" "adapter speed 5000" "-c" "program rtos-apis-test.elf verify" "-c" "arm semihosting enable" "-c" "arm semihosting_cmdline rtos-apis-test" "-c" "reset run" 1: Working Directory: /Users/ilg/MyProjects/micro-os-plus.github/micro-os-plus-iii/micro-os-plus-iii.git/tests/build/raspberrypi-pico-cmake-debug/platform-bin 1: Test timeout computed to be: 10000000 1: xPack Open On-Chip Debugger 0.12.0+dev-01850-geb6f2745b-dirty (2025-02-07-12:14) 1: Licensed under GNU GPL v2 1: For bug reports, read 1: http://openocd.org/doc/doxygen/bugs.html 1: Info : Hardware thread awareness created 1: Info : Hardware thread awareness created 1: adapter speed: 5000 kHz 1: Info : Using CMSIS-DAPv2 interface with VID:PID=0x2e8a:0x000c, serial=E6616407E339502C 1: Info : CMSIS-DAP: SWD supported 1: Info : CMSIS-DAP: Atomic commands supported 1: Info : CMSIS-DAP: Test domain timer supported 1: Info : CMSIS-DAP: FW Version = 2.0.0 1: Info : CMSIS-DAP: Interface Initialised (SWD) 1: Info : SWCLK/TCK = 0 SWDIO/TMS = 0 TDI = 0 TDO = 0 nTRST = 0 nRESET = 0 1: Info : CMSIS-DAP: Interface ready 1: Info : clock speed 5000 kHz 1: Info : SWD DPIDR 0x0bc12477, DLPIDR 0x00000001 1: Info : SWD DPIDR 0x0bc12477, DLPIDR 0x10000001 1: Info : [rp2040.core0] Cortex-M0+ r0p1 processor detected 1: Info : [rp2040.core0] target has 4 breakpoints, 2 watchpoints 1: Info : [rp2040.core0] Examination succeed 1: Info : [rp2040.core1] Cortex-M0+ r0p1 processor detected 1: Info : [rp2040.core1] target has 4 breakpoints, 2 watchpoints 1: Info : [rp2040.core1] Examination succeed 1: Info : [rp2040.core0] gdb port disabled 1: Info : [rp2040.core1] gdb port disabled 1: [rp2040.core0] halted due to breakpoint, current mode: Thread 1: xPSR: 0xf1000000 pc: 0x000000ee msp: 0x20041f00 1: [rp2040.core1] halted due to breakpoint, current mode: Thread 1: xPSR: 0xf1000000 pc: 0x000000ee msp: 0x20041f00 1: ** Programming Started ** 1: Info : Found flash device 'win w25q16jv' (ID 0x001540ef) 1: Info : RP2040 B0 Flash Probe: 2097152 bytes @0x10000000, in 32 sectors 1: 1: Info : Padding image section 1 at 0x10058934 with 204 bytes (bank write end alignment) 1: Warn : Adding extra erase range, 0x10058a00 .. 0x1005ffff 1: ** Programming Finished ** 1: ** Verify Started ** 1: ** Verified OK ** 1: semihosting is enabled 1: semihosting command line is [rtos-apis-test] 1: Error: [rp2040.core1] not halted 1: Warn : [rp2040.core0] resume of a SMP target failed, trying to resume current one 1: Error: [rp2040.core0] resume failed 1: Error: Failed to resume target 1: Error: [rp2040.core0] Polling failed, trying to reexamine 1: Info : [rp2040.core0] Cortex-M0+ r0p1 processor detected 1: Info : [rp2040.core0] target has 4 breakpoints, 2 watchpoints 1: Info : [rp2040.core0] Examination succeed 1: [rp2040.core0] halted due to debug-request, current mode: Thread 1: xPSR: 0x01000000 pc: 0x10018416 msp: 0x20041f68, semihosting 1: [rp2040.core1] halted due to debug-request, current mode: Thread 1: xPSR: 0x01000000 pc: 0x00000178 msp: 0x20041f00 1: Info : tcl server disabled 1: Info : telnet server disabled ``` openocd hangs at this point, and I have to kill it. Running the same with -d3, I get (only the final part): ``` ... 1: Debug: 1444 4923 command.c:153 script_debug(): command - arm semihosting enable 1: User : 1445 4923 options.c:52 configuration_output_handler(): semihosting is enabledUser : 1446 4923 options.c:52 configuration_output_handler(): 1: Debug: 1447 4923 command.c:153 script_debug(): command - arm semihosting_cmdline rtos-apis-test 1: User : 1448 4923 options.c:52 configuration_output_handler(): semihosting command line is [rtos-apis-test]User : 1449 4923 options.c:52 configuration_output_handler(): 1: Debug: 1450 4923 command.c:153 script_debug(): command - reset run 1: Debug: 1451 4923 target.c:1794 target_call_reset_callbacks(): target reset 1 (run) 1: Debug: 1452 4923 target.c:1794 target_call_reset_callbacks(): target reset 1 (run) 1: Debug: 1453 4923 command.c:153 script_debug(): command - target names 1: Debug: 1454 4923 command.c:153 script_debug(): command - rp2040.core0 invoke-event reset-start 1: Debug: 1455 4923 command.c:153 script_debug(): command - rp2040.core1 invoke-event reset-start 1: Debug: 1456 4923 command.c:153 script_debug(): command - transport select 1: Debug: 1457 4923 command.c:153 script_debug(): command - transport select 1: Debug: 1458 4923 command.c:153 script_debug(): command - rp2040.core0 invoke-event examine-start 1: Debug: 1459 4923 command.c:153 script_debug(): command - rp2040.core0 arp_examine allow-defer 1: Debug: 1460 4924 arm_adi_v5.c:935 mem_ap_init(): MEM_AP CFG: large data 0, long address 0, big-endian 0 1: Debug: 1461 4924 command.c:153 script_debug(): command - rp2040.core0 invoke-event examine-end 1: Debug: 1462 4924 command.c:153 script_debug(): command - transport select 1: Debug: 1463 4924 command.c:153 script_debug(): command - rp2040.core1 invoke-event examine-start 1: Debug: 1464 4924 command.c:153 script_debug(): command - rp2040.core1 arp_examine allow-defer 1: Debug: 1465 4925 arm_adi_v5.c:935 mem_ap_init(): MEM_AP CFG: large data 0, long address 0, big-endian 0 1: Debug: 1466 4925 command.c:153 script_debug(): command - rp2040.core1 invoke-event examine-end 1: Debug: 1467 4925 command.c:153 script_debug(): command - rp2040.core0 invoke-event reset-assert-pre 1: Debug: 1468 4925 command.c:153 script_debug(): command - rp2040.core1 invoke-event reset-assert-pre 1: Debug: 1469 4925 command.c:153 script_debug(): command - transport select 1: Debug: 1470 4925 command.c:153 script_debug(): command - rp2040.core0 arp_reset assert 0 1: Debug: 1471 4925 target.c:2130 target_free_all_working_areas_restore(): freeing all working areas 1: Debug: 1472 4925 target.c:1902 print_wa_layout(): 0x20010000-0x2001ffff (65536 bytes) 1: Debug: 1473 4925 cortex_m.c:1692 cortex_m_assert_reset(): [rp2040.core0] target->state: halted, examined 1: Debug: 1474 4927 cortex_m.c:557 cortex_m_clear_halt(): [rp2040.core0] NVIC_DFSR 0x1 1: Debug: 1475 4927 cortex_m.c:1806 cortex_m_assert_reset(): [rp2040.core0] Using Cortex-M SYSRESETREQ 1: Debug: 1476 4928 arm_adi_v5.c:859 dap_dp_init_or_reconnect(): rp2040.dap0 1: Debug: 1477 4928 arm_adi_v5.c:783 dap_dp_init(): rp2040.dap0 1: Debug: 1478 4928 arm_adi_v5.c:816 dap_dp_init(): DAP: wait CDBGPWRUPACK 1: Debug: 1479 4928 arm_adi_v5.h:683 dap_dp_poll_register(): DAP: poll 4, mask 0x20000000, value 0x20000000 1: Debug: 1480 4928 arm_adi_v5.c:824 dap_dp_init(): DAP: wait CSYSPWRUPACK 1: Debug: 1481 4928 arm_adi_v5.h:683 dap_dp_poll_register(): DAP: poll 4, mask 0x80000000, value 0x80000000 1: Debug: 1482 4928 cmsis_dap.c:839 cmsis_dap_swd_write_from_queue(): refusing to enable sticky overrun detection 1: Debug: 1483 4988 command.c:153 script_debug(): command - transport select 1: Debug: 1484 4988 command.c:153 script_debug(): command - rp2040.core1 arp_reset assert 0 1: Debug: 1485 4988 target.c:2130 target_free_all_working_areas_restore(): freeing all working areas 1: Debug: 1486 4988 cortex_m.c:1692 cortex_m_assert_reset(): [rp2040.core1] target->state: halted, examined 1: Debug: 1487 4990 cortex_m.c:557 cortex_m_clear_halt(): [rp2040.core1] NVIC_DFSR 0x1 1: Debug: 1488 4990 cortex_m.c:1806 cortex_m_assert_reset(): [rp2040.core1] Using Cortex-M SYSRESETREQ 1: Debug: 1489 4990 arm_adi_v5.c:859 dap_dp_init_or_reconnect(): rp2040.dap1 1: Debug: 1490 4991 arm_adi_v5.c:783 dap_dp_init(): rp2040.dap1 1: Debug: 1491 4991 arm_adi_v5.c:816 dap_dp_init(): DAP: wait CDBGPWRUPACK 1: Debug: 1492 4991 arm_adi_v5.h:683 dap_dp_poll_register(): DAP: poll 4, mask 0x20000000, value 0x20000000 1: Debug: 1493 4991 arm_adi_v5.c:824 dap_dp_init(): DAP: wait CSYSPWRUPACK 1: Debug: 1494 4991 arm_adi_v5.h:683 dap_dp_poll_register(): DAP: poll 4, mask 0x80000000, value 0x80000000 1: Debug: 1495 4991 cmsis_dap.c:839 cmsis_dap_swd_write_from_queue(): refusing to enable sticky overrun detection 1: Debug: 1496 5048 command.c:153 script_debug(): command - rp2040.core0 invoke-event reset-assert-post 1: Debug: 1497 5048 command.c:153 script_debug(): command - rp2040.core1 invoke-event reset-assert-post 1: Debug: 1498 5048 command.c:153 script_debug(): command - rp2040.core0 invoke-event reset-deassert-pre 1: Debug: 1499 5048 command.c:153 script_debug(): command - rp2040.core1 invoke-event reset-deassert-pre 1: Debug: 1500 5048 command.c:153 script_debug(): command - transport select 1: Debug: 1501 5048 command.c:153 script_debug(): command - rp2040.core0 arp_reset deassert 0 1: Debug: 1502 5048 target.c:2130 target_free_all_working_areas_restore(): freeing all working areas 1: Debug: 1503 5048 target.c:1902 print_wa_layout(): 0x20010000-0x2001ffff (65536 bytes) 1: Debug: 1504 5048 cortex_m.c:1850 cortex_m_deassert_reset(): [rp2040.core0] target->state: reset, examined 1: Debug: 1505 5049 command.c:153 script_debug(): command - transport select 1: Debug: 1506 5049 command.c:153 script_debug(): command - rp2040.core1 arp_reset deassert 0 1: Debug: 1507 5049 target.c:2130 target_free_all_working_areas_restore(): freeing all working areas 1: Debug: 1508 5049 cortex_m.c:1850 cortex_m_deassert_reset(): [rp2040.core1] target->state: reset, examined 1: Debug: 1509 5049 command.c:153 script_debug(): command - rp2040.core0 invoke-event reset-deassert-post 1: Debug: 1510 5049 command.c:153 script_debug(): command - rp2040.core1 invoke-event reset-deassert-post 1: Debug: 1511 5049 command.c:153 script_debug(): command - rp2040.core0 invoke-event reset-end 1: Debug: 1512 5049 command.c:153 script_debug(): command - rp2040.core1 invoke-event reset-end 1: Debug: 1513 5050 cortex_m.c:1013 cortex_m_poll_one(): [rp2040.core0] Exit from reset with dcb_dhcsr 0x30003 1: Debug: 1514 5050 cortex_m.c:619 cortex_m_endreset_event(): [rp2040.core0] DCB_DEMCR = 0x01000000 1: Debug: 1515 5051 target.c:2652 target_write_u32(): address: 0xe0002000, value: 0x00000003 1: Debug: 1516 5051 target.c:2564 target_read_u32(): address: 0xe0002000, value: 0x00000041 1: Debug: 1517 5051 target.c:2652 target_write_u32(): address: 0xe0002008, value: 0x00000000 1: Debug: 1518 5052 target.c:2652 target_write_u32(): address: 0xe000200c, value: 0x00000000 1: Debug: 1519 5052 target.c:2652 target_write_u32(): address: 0xe0002010, value: 0x00000000 1: Debug: 1520 5052 target.c:2652 target_write_u32(): address: 0xe0002014, value: 0x00000000 1: Debug: 1521 5052 target.c:2652 target_write_u32(): address: 0xe0001020, value: 0x00000000 1: Debug: 1522 5053 target.c:2652 target_write_u32(): address: 0xe0001024, value: 0x00000000 1: Debug: 1523 5053 target.c:2652 target_write_u32(): address: 0xe0001028, value: 0x00000000 1: Debug: 1524 5053 target.c:2652 target_write_u32(): address: 0xe0001030, value: 0x00000000 1: Debug: 1525 5053 target.c:2652 target_write_u32(): address: 0xe0001034, value: 0x00000000 1: Debug: 1526 5053 target.c:2652 target_write_u32(): address: 0xe0001038, value: 0x00000000 1: Debug: 1527 5054 cortex_m.c:852 cortex_m_debug_entry(): [rp2040.core0] 1: Debug: 1528 5055 cortex_m.c:557 cortex_m_clear_halt(): [rp2040.core0] NVIC_DFSR 0x3 1: Debug: 1529 5057 cortex_m.c:359 cortex_m_fast_read_all_regs(): [rp2040.core0] read 20 32-bit registers 1: Debug: 1530 5057 cortex_m.c:927 cortex_m_debug_entry(): [rp2040.core0] entered debug state in core mode: Thread at PC 0x100183d2, cpu in Non-Secure state, target->state: halted 1: Debug: 1531 5057 arm_adi_v5.c:401 mem_ap_setup_transfer_verify_size_packing(): AP#0x0 probed size 2: supported 1: Debug: 1532 5057 target.c:2588 target_read_u16(): address: 0x100183d2, value: 0xbeab 1: Debug: 1533 5057 semihosting_common.c:399 semihosting_common(): op=0x1 (OPEN), param=0x20041f70 1: Debug: 1534 5058 arm_adi_v5.c:401 mem_ap_setup_transfer_verify_size_packing(): AP#0x0 probed size 1: supported 1: Debug: 1535 5058 semihosting_common.c:977 semihosting_common(): dup(STDOUT)=5 1: Debug: 1536 5058 target.c:1776 target_call_event_callbacks(): target event 3 (resume-start) for core rp2040.core0 1: Debug: 1537 5058 target.c:2130 target_free_all_working_areas_restore(): freeing all working areas 1: Debug: 1538 5058 target.c:1902 print_wa_layout(): 0x20010000-0x2001ffff (65536 bytes) 1: Debug: 1539 5058 target.c:2588 target_read_u16(): address: 0x100183d2, value: 0xbeab 1: Debug: 1540 5058 armv7m.c:1122 armv7m_maybe_skip_bkpt_inst(): [rp2040.core0] Skipping over BKPT instruction 1: Debug: 1541 5058 armv7m.c:199 armv7m_restore_context(): [rp2040.core0] 1: Debug: 1542 5059 armv7m.c:469 armv7m_write_core_reg(): [rp2040.core0] write pc value 0x100183d4 1: Debug: 1543 5059 armv7m.c:469 armv7m_write_core_reg(): [rp2040.core0] write r0 value 0x00000005 1: Error: 1544 5059 cortex_m.c:1323 cortex_m_restore_one(): [rp2040.core1] not halted 1: Warn : 1545 5059 cortex_m.c:1472 cortex_m_resume(): [rp2040.core0] resume of a SMP target failed, trying to resume current one 1: Debug: 1546 5059 target.c:1776 target_call_event_callbacks(): target event 2 (resumed) for core rp2040.core0 1: Error: 1547 5059 cortex_m.c:1477 cortex_m_resume(): [rp2040.core0] resume failed 1: Error: 1548 5059 arm_semihosting.c:63 arm_semihosting_resume(): Failed to resume target 1: Debug: 1549 5059 cortex_m.c:1056 cortex_m_poll_one(): [rp2040.core0] postpone target event 'halted' 1: Debug: 1550 5059 target.c:1776 target_call_event_callbacks(): target event 0 (gdb-halt) for core rp2040.core0 1: Error: 1551 5059 target.c:3000 handle_target(): [rp2040.core0] Polling failed, trying to reexamine 1: Debug: 1552 5059 target.c:674 target_examine_one(): [rp2040.core0] Examination started 1: Debug: 1553 5059 target.c:1776 target_call_event_callbacks(): target event 19 (examine-start) for core rp2040.core0 1: Debug: 1554 5059 arm_adi_v5.c:935 mem_ap_init(): MEM_AP CFG: large data 0, long address 0, big-endian 0 1: Debug: 1555 5060 target.c:2564 target_read_u32(): address: 0xe000ed00, value: 0x410cc601 1: Info : 1556 5060 cortex_m.c:2646 cortex_m_examine(): [rp2040.core0] Cortex-M0+ r0p1 processor detected 1: Debug: 1557 5060 cortex_m.c:2666 cortex_m_examine(): [rp2040.core0] cpuid: 0x410cc601 1: Debug: 1558 5060 target.c:2564 target_read_u32(): address: 0xe000edf0, value: 0x01030003 1: Debug: 1559 5060 target.c:2652 target_write_u32(): address: 0xe000edfc, value: 0x01000000 1: Debug: 1560 5060 target.c:2652 target_write_u32(): address: 0xe0000fb0, value: 0xc5acce55 1: Debug: 1561 5061 target.c:2564 target_read_u32(): address: 0xe0000e80, value: 0x00000000 1: Debug: 1562 5061 target.c:2652 target_write_u32(): address: 0xe0000e80, value: 0x00000000 1: Debug: 1563 5061 target.c:2564 target_read_u32(): address: 0xe0000e80, value: 0x00000000 1: Debug: 1564 5061 target.c:2652 target_write_u32(): address: 0xe0000e80, value: 0x00010009 1: Debug: 1565 5061 target.c:2652 target_write_u32(): address: 0xe0000e00, value: 0x00000001 1: Debug: 1566 5062 target.c:2652 target_write_u32(): address: 0xe0000e04, value: 0x00000000 1: Debug: 1567 5062 target.c:2652 target_write_u32(): address: 0xe0000e08, value: 0x00000000 1: Debug: 1568 5062 target.c:2652 target_write_u32(): address: 0xe0000e0c, value: 0x00000000 1: Debug: 1569 5062 target.c:2652 target_write_u32(): address: 0xe0000e10, value: 0x00000000 1: Debug: 1570 5062 target.c:2652 target_write_u32(): address: 0xe0000e14, value: 0x00000000 1: Debug: 1571 5063 target.c:2652 target_write_u32(): address: 0xe0000e18, value: 0x00000000 1: Debug: 1572 5063 target.c:2652 target_write_u32(): address: 0xe0000e1c, value: 0x00000000 1: Debug: 1573 5063 target.c:2564 target_read_u32(): address: 0xe0002000, value: 0x00000041 1: Debug: 1574 5063 target.c:2652 target_write_u32(): address: 0xe0002008, value: 0x00000000 1: Debug: 1575 5064 target.c:2652 target_write_u32(): address: 0xe000200c, value: 0x00000000 1: Debug: 1576 5064 target.c:2652 target_write_u32(): address: 0xe0002010, value: 0x00000000 1: Debug: 1577 5064 target.c:2652 target_write_u32(): address: 0xe0002014, value: 0x00000000 1: Debug: 1578 5064 cortex_m.c:2789 cortex_m_examine(): [rp2040.core0] FPB fpcr 0x41, numcode 4, numlit 0 1: Debug: 1579 5064 target.c:2564 target_read_u32(): address: 0xe0001000, value: 0x20000000 1: Debug: 1580 5064 cortex_m.c:2460 cortex_m_dwt_setup(): [rp2040.core0] DWT_CTRL: 0x20000000 1: Debug: 1581 5065 target.c:2564 target_read_u32(): address: 0xe0001fbc, value: 0x00000000 1: Debug: 1582 5065 cortex_m.c:2467 cortex_m_dwt_setup(): [rp2040.core0] DWT_DEVARCH: 0x0 1: Debug: 1583 5065 target.c:2652 target_write_u32(): address: 0xe0001028, value: 0x00000000 1: Debug: 1584 5065 target.c:2652 target_write_u32(): address: 0xe0001038, value: 0x00000000 1: Debug: 1585 5065 cortex_m.c:2516 cortex_m_dwt_setup(): [rp2040.core0] DWT dwtcr 0x20000000, comp 2, watch/trigger 1: Info : 1586 5065 cortex_m.c:2798 cortex_m_examine(): [rp2040.core0] target has 4 breakpoints, 2 watchpoints 1: Debug: 1587 5065 target.c:1776 target_call_event_callbacks(): target event 21 (examine-end) for core rp2040.core0 1: Info : 1588 5065 target.c:690 target_examine_one(): [rp2040.core0] Examination succeed 1: Debug: 1589 5066 cortex_m.c:1013 cortex_m_poll_one(): [rp2040.core1] Exit from reset with dcb_dhcsr 0x40001 1: Debug: 1590 5066 cortex_m.c:619 cortex_m_endreset_event(): [rp2040.core1] DCB_DEMCR = 0x01000000 1: Debug: 1591 5067 target.c:2652 target_write_u32(): address: 0xe0002000, value: 0x00000003 1: Debug: 1592 5067 target.c:2564 target_read_u32(): address: 0xe0002000, value: 0x00000041 1: Debug: 1593 5067 target.c:2652 target_write_u32(): address: 0xe0002008, value: 0x00000000 1: Debug: 1594 5067 target.c:2652 target_write_u32(): address: 0xe000200c, value: 0x00000000 1: Debug: 1595 5068 target.c:2652 target_write_u32(): address: 0xe0002010, value: 0x00000000 1: Debug: 1596 5068 target.c:2652 target_write_u32(): address: 0xe0002014, value: 0x00000000 1: Debug: 1597 5068 target.c:2652 target_write_u32(): address: 0xe0001020, value: 0x00000000 1: Debug: 1598 5068 target.c:2652 target_write_u32(): address: 0xe0001024, value: 0x00000000 1: Debug: 1599 5068 target.c:2652 target_write_u32(): address: 0xe0001028, value: 0x00000000 1: Debug: 1600 5069 target.c:2652 target_write_u32(): address: 0xe0001030, value: 0x00000000 1: Debug: 1601 5069 target.c:2652 target_write_u32(): address: 0xe0001034, value: 0x00000000 1: Debug: 1602 5069 target.c:2652 target_write_u32(): address: 0xe0001038, value: 0x00000000 1: Debug: 1603 5070 cortex_m.c:1202 cortex_m_halt_one(): [rp2040.core0] target->state: running 1: Debug: 1604 5071 cortex_m.c:1202 cortex_m_halt_one(): [rp2040.core1] target->state: running 1: Debug: 1605 5073 cortex_m.c:852 cortex_m_debug_entry(): [rp2040.core0] 1: Debug: 1606 5073 cortex_m.c:557 cortex_m_clear_halt(): [rp2040.core0] NVIC_DFSR 0x3 1: Debug: 1607 5076 cortex_m.c:359 cortex_m_fast_read_all_regs(): [rp2040.core0] read 20 32-bit registers 1: Debug: 1608 5076 cortex_m.c:927 cortex_m_debug_entry(): [rp2040.core0] entered debug state in core mode: Thread at PC 0x10018416, cpu in Non-Secure state, target->state: halted 1: Debug: 1609 5076 cortex_m.c:1056 cortex_m_poll_one(): [rp2040.core0] postpone target event 'halted' 1: Debug: 1610 5077 cortex_m.c:852 cortex_m_debug_entry(): [rp2040.core1] 1: Debug: 1611 5077 cortex_m.c:557 cortex_m_clear_halt(): [rp2040.core1] NVIC_DFSR 0x1 1: Debug: 1612 5080 cortex_m.c:359 cortex_m_fast_read_all_regs(): [rp2040.core1] read 20 32-bit registers 1: Debug: 1613 5080 cortex_m.c:927 cortex_m_debug_entry(): [rp2040.core1] entered debug state in core mode: Thread at PC 0x178, cpu in Non-Secure state, target->state: halted 1: Debug: 1614 5080 cortex_m.c:1056 cortex_m_poll_one(): [rp2040.core1] postpone target event 'halted' 1: Debug: 1615 5080 cortex_m.c:1171 cortex_m_poll_smp(): [rp2040.core0] sending postponed target event 'halted' 1: Debug: 1616 5080 target.c:1776 target_call_event_callbacks(): target event 0 (gdb-halt) for core rp2040.core0 1: Debug: 1617 5080 target.c:1776 target_call_event_callbacks(): target event 1 (halted) for core rp2040.core0 1: User : 1618 5080 armv7m.c:781 armv7m_arch_state(): [rp2040.core0] halted due to debug-request, current mode: Thread 1: xPSR: 0x01000000 pc: 0x10018416 msp: 0x20041f68, semihosting 1: Debug: 1619 5080 cortex_m.c:1171 cortex_m_poll_smp(): [rp2040.core1] sending postponed target event 'halted' 1: Debug: 1620 5080 target.c:1776 target_call_event_callbacks(): target event 0 (gdb-halt) for core rp2040.core1 1: Debug: 1621 5080 target.c:1776 target_call_event_callbacks(): target event 1 (halted) for core rp2040.core1 1: User : 1622 5080 armv7m.c:781 armv7m_arch_state(): [rp2040.core1] halted due to debug-request, current mode: Thread 1: xPSR: 0x01000000 pc: 0x00000178 msp: 0x20041f00 1: Info : 1623 5080 tcl_server.c:280 tcl_init(): tcl server disabled 1: Info : 1624 5080 telnet_server.c:945 telnet_init(): telnet server disabled 1: Debug: 1625 5080 command.c:153 script_debug(): command - init ``` The same ELF runs fine on the same board, when programmed with J-Link and Ozone ``` 1.382 829 SEGGER Ozone - The J-Link Debugger V3.40b 1.605 091 J-Link software found at: /Applications/SEGGER/Ozone_V340b/Ozone.app/Contents/MacOS/Lib/libjlinkarm.dylib 8.423 831 File.NewProject(); 31.200 443 File.Open: completed in 233 ms 31.200 755 Program segments: 31.200 777 Address Size Code RO Data RW Data ZI Data Flg 31.200 798 --------- --------- --------- --------- --------- --------- --- 31.200 806 10048148 0 0 0 0 0 R 31.200 814 10000000 295 164 275 952 19 212 0 0 RWE 31.200 822 20000000 54 716 0 0 54 716 0 RW 31.200 829 2000D5C0 13 560 0 0 0 13 560 RW 31.200 836 --------- --------- --------- --------- --------- --------- --- 31.200 842 Total: 363 440 275 952 19 212 54 716 13 560 31.200 847 --------- --------- --------- --------- --------- --------- --- 31.200 854 For further information on ELF file data sections, execute command Elf.PrintSectionInfo(0). 31.271 708 Debug.ReadIntoInstCache: updated instruction information within 2 code ranges (0x10000000-0x1004363C) 31.604 002 File.Open ("/Users/ilg/MyProjects/micro-os-plus.github/micro-os-plus-iii/micro-os-plus-iii.git/tests/build/raspberrypi-pico-cmake-debug/platform-bin/rtos-apis-test.elf"); 36.182 476 Tools.DebugSettings(); 01:16.697 191 J-Link settings were written to the project file. 01:16.713 477 Target core support plugin loaded.: /Applications/SEGGER/Ozone_V340b/Ozone.app/Contents/MacOS/Plugins/Core/CorePluginARM.dylib 01:16.751 314 Debug.ReadIntoInstCache: updated instruction information within 2 code ranges (0x10000000-0x1004363C) 01:16.969 723 Project.SetDevice ("RP2040_M0_0"); 01:16.969 804 Project.SetTargetIF ("SWD"); 01:16.970 091 Project.SetTIFSpeed ("4 MHz"); 01:30.901 712 Debug.Start(); 01:31.559 160 Device "RP2040_M0_0" selected. 01:31.595 029 ConfigTargetSettings() start 01:31.595 078 J-Link script: ConfigTargetSettings() 01:31.595 090 ConfigTargetSettings() end - Took 487us 01:31.595 098 Found SW-DP with ID 0x0BC12477 01:31.595 106 DPIDR: 0x0BC12477 01:31.595 112 CoreSight SoC-400 or earlier 01:31.595 121 Scanning AP map to find all available APs 01:31.595 129 AP[1]: Stopped AP scan as end of AP map has been reached 01:31.595 137 AP[0]: AHB-AP (IDR: 0x04770031, ADDR: 0x00000000) 01:31.595 146 Iterating through AP map to find AHB-AP to use 01:31.598 546 AP[0]: Core found 01:31.598 569 AP[0]: AHB-AP ROM base: 0xE00FF000 01:31.598 577 CPUID register: 0x410CC601. Implementer code: 0x41 (ARM) 01:31.598 584 Found Cortex-M0 r0p1, Little endian. 01:31.598 591 FPUnit: 4 code (BP) slots and 0 literal slots 01:31.598 597 CoreSight components: 01:31.598 604 ROMTbl[0] @ E00FF000 01:31.598 609 [0][0]: E000E000 CID B105E00D PID 000BB008 SCS 01:31.598 615 [0][1]: E0001000 CID B105E00D PID 000BB00A DWT 01:31.598 620 [0][2]: E0002000 CID B105E00D PID 000BB00B FPB 01:31.611 005 Connected to target device. 01:31.611 032 J-Link/J-Trace serial number: 174300531 01:31.655 079 Reset type: NORMAL (https://wiki.segger.com/J-Link_Reset_Strategies) 01:31.655 148 Reset: Halt core after reset via DEMCR.VC_CORERESET. 01:31.655 156 Reset: Reset device via AIRCR.SYSRESETREQ. 01:31.818 141 AfterResetTarget() start 01:31.818 174 AfterResetTarget() end - Took 2.81ms 01:32.718 737 J-Link: Flash download: Bank 0 @ 0x10000000: Skipped. Contents already match 01:32.726 600 Memory map 'after startup completion point' is active 01:32.813 757 Performing semihosting operation SysOpen. 01:32.814 884 Semihosting operation SysOpen completed with result code 4294967040. 01:32.853 144 Performing semihosting operation SysWrite. 01:32.854 220 Semihosting operation SysWrite completed with result code 0. 01:32.901 204 Performing semihosting operation SysWrite. ... 02:59.563 672 Semihosting operation SysWrite completed with result code 0. 02:59.611 834 Performing semihosting operation SysWrite. 02:59.612 876 Semihosting operation SysWrite completed with result code 0. 02:59.667 317 Performing semihosting operation SysWrite. 02:59.668 322 Semihosting operation SysWrite completed with result code 0. 02:59.716 675 Performing semihosting operation SysExit. 02:59.716 708 Target application exited with exit code (0x20026). 02:59.716 717 Semihosting operation SysExit completed with result code 131110. 02:59.716 774 Debug.Stop(); 02:59.809 437 Disconnected from target device. ``` My experience with openocd is limited, and with multi-core devices even more limited, so I have difficulties to understand the debug log. However I guess that the issue is somehow caused by the lack of specificity when reseting the target, probably it should mention explicitly that I want only the rp2040.core0 to run, and keep rp2040.core1 halted. Any suggestions how to fix this? Thank you, Liviu |