This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSPM0G3507: MSPM0G3507

Part Number: MSPM0G3507

Tool/software:

Hello, Good day!

We are trying to build openOCD using the following Repo (https://github.com/nmenon/openocd/tree/mspm0-dev).

We have used MSYS2 to build the openocd.

-- Following dependances we have installed before building openocd

Jimtcl (link)

Libusb-1.0.28

automake

autoconf

pkg-config

libtool

make

Gcc (13.3.0)

Arm GCC (arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi (link))

-- To build OpenOCD we have used the following sequence of command

./bootstrap

./configure --host=i686-w64-mingw32 --enable-ftdi --enable-swd  --disable-werror

 make -j$(nproc)

 make install

--> launch json file

{

    "version": "0.2.0",

    "configurations": [

        {

            "name": "MSYS OpenOCD Debug",

            "cwd": "${workspaceRoot}",

            "executable":  "C:/Users/UserName/Downloads/Repos/_Repo/vs_code_integration/thb/build/gcc/debug/temp.out",

            "request": "attach",

            "type": "cortex-debug",

            "servertype": "openocd",

            "configFiles": [

                "C:/openocd_msys/tcl/interface/xds110.cfg",

                "C:/openocd_msys/tcl/target/ti_mspm0.cfg"

            ],

            "runToEntryPoint": "main",

            "showDevDebugOutput": "raw",

            "searchDir": [],

            "svdPath": "C:/Users/UserNameDownloads/Repos/Repo/vs_code_integration/utils/MSPM0G350X.svd",

            "svdFile": "C:/Users/UserName/Downloads/Repos/Repo/vs_code_integration/utils/MSPM0G350X.svd"

        },

getting the above error. Do you have any suggestions?

  • We are trying to build openOCD using the following Repo (https://github.com/nmenon/openocd/tree/mspm0-dev).

    Hi, Could you use the the master branch of the repo, and try again.

  • Hi, Yes, i have tried with the master branch.but I'm getting the same Error

    Debug launch file setting.

    Error:

    Flash launch file setting.

    Error:

  • Hello,

    This error is usually indicative that there were errors in the paths provided. I would recommend checking the paths set again to confirm they are correct.

    Try addingthe following launch configuation property:

    ...
    "overrideLaunchCommands": [
        "file /full/path/to/my_executable.out"
    ],
    ...
    

    Note that my_executable.out is the same file specified under the executable property.

    Here is an example you could refer to as well.

    {
        ...
        "launch": {
            ...
            "configurations": [
                ...
                {
                    "cwd": "C:/Users/username/workspace/my_project/Debug",
                    "executable": "my_executable.out",
                    "name": "Debug with TI Embedded Debug for VS Code",
                    "request": "launch",
                    "type": "cortex-debug",
                    "servertype": "openocd",
                    "configFiles": [
                        "./interface/xds110.cfg",
                        "./board/ti_mspm0_launchpad.cfg"
                    ],
                    "searchDir": [
                        "C:/Users/username/openocd_win/openocd/scripts"
                    ],
                    "runToEntryPoint": "main",
                    "showDevDebugOutput": "none"
                }
                ...
            ]
            ...
        },
        ...
    }
  • Hi, have added correct path, and changes done accordingly.

    --> (launch.json file)

    {
        "configurations": [
            {
                "name": "Debug with TI Embedded Debug for VS Code",
                "cwd": "C:/openOCD_04_04_2025/openOCD/THB/thb/build/gcc/debug",
                "executable": "my_executable.out",
                "request": "launch",
                "type": "cortex-debug",
                "servertype": "openocd",
                "gdbTarget": "localhost:50000",
                "runToEntryPoint": "main",
                "showDevDebugOutput": "none",

                "configFiles": [
                    "interface/xds110.cfg",
                    "target/ti_mspm0.cfg"
                ],
                "searchDir": [
                    "C:/openOCD_04_04_2025/openOCD/openocd/tcl"
                ],

                "overrideLaunchCommands": [
                    "file my_executable.out",
                    "target remote localhost:50000"
                ],

                "serverArgs": [
                    "-c", "adapter speed 5000",
                    "-d",
                    "-c", "gdb port 50000",
                    "-c", "tcl port 50001",
                    "-c", "telnet port 50002",
                    "-c","program C:/openOCD_04_04_2025/openOCD/THB/thb/build/gcc/debug/my_executable.out",
                    "-c", "reset init"

                ]
            }
        ]
    }
    --> (settings.json file)
    {
        "cortex-debug.gdbPath": "C:/arm-gnu-toolchain-13.3.rel1-mingw-w64-i686-arm-none-eabi/arm-gnu-toolchain-13.3.rel1-mingw-w64-i686-arm-none- eabi/bin/arm-none-eabi-gdb.exe",
        "cortex-debug.openocdPath": "C:/msys64/usr/bin/openocd.exe"
    }

    i have added ("-c","program C:/openOCD_04_04_2025/openOCD/THB/thb/build/gcc/debug/my_executable.out",)

    also enable (-d) debug.

    Debug: 118972 44517 target.c:2563 target_read_u32(): address: 0x400ce3d0, value: 0x00000003
    Debug: 118973 44517 target.c:2651 target_write_u32(): address: 0x400ce104, value: 0x00000001
    Debug: 118974 44518 target.c:2651 target_write_u32(): address: 0x400ce124, value: 0x000001ff
    Debug: 118975 44518 target.c:2651 target_write_u32(): address: 0x400ce120, value: 0x41c00150
    Debug: 118976 44519 target.c:2651 target_write_u32(): address: 0x400ce210, value: 0xfffffffe
    Debug: 118977 44519 target.c:2345 target_write_buffer(): writing buffer of 8 byte at 0x400ce130
    Debug: 118978 44520 target.c:2651 target_write_u32(): address: 0x400ce100, value: 0x00000001
    Debug: 118979 44521 target.c:2563 target_read_u32(): address: 0x400ce3d0, value: 0x00000004
    Debug: 118980 44522 target.c:2563 target_read_u32(): address: 0x400ce3d0, value: 0x00000003
    Debug: 118981 44522 target.c:2651 target_write_u32(): address: 0x400ce210, value: 0x00000001
    Debug: 118982 44523 command.c:153 script_debug(): command - echo ** Programming Finished **
    Debug: 118983 44523 log.c:419 gdb_timeout_warning(): keep_alive() was not invoked in the 1000 ms timelimit (44523 ms). This may cause trouble with GDB connections.
    User : 118984 44524 command.c:678 handle_echo(): ** Programming Finished **
    Debug: 118985 44524 command.c:153 script_debug(): command - reset init
    Debug: 118986 44524 target.c:1794 target_call_reset_callbacks(): target reset 3 (init)
    Debug: 118987 44524 command.c:153 script_debug(): command - target names
    Debug: 118988 44524 command.c:153 script_debug(): command - mspm0x.cpu invoke-event reset-start
    Debug: 118989 44525 command.c:153 script_debug(): command - transport select
    Debug: 118990 44525 command.c:153 script_debug(): command - transport select
    Debug: 118991 44525 command.c:153 script_debug(): command - mspm0x.cpu invoke-event examine-start
    Debug: 118992 44525 target.c:4681 target_handle_event(): target: mspm0x.cpu (cortex_m) event: 19 (examine-start) action: _mspm0_enable_low_power_mode
    Debug: 118993 44525 command.c:153 script_debug(): command - mspm0x.dap apreg 4 0x00 0x104008
    Debug: 118994 44525 arm_adi_v5.c:1193 dap_get_ap(): refcount AP#0x4 get 1
    Debug: 118995 44526 arm_adi_v5.c:1218 dap_put_ap(): refcount AP#0x4 put 0
    Debug: 118996 44526 command.c:153 script_debug(): command - mspm0x.dap apreg 4 0xF0 0x01
    Debug: 118997 44526 arm_adi_v5.c:1193 dap_get_ap(): refcount AP#0x4 get 1
    Debug: 118998 44527 arm_adi_v5.c:1218 dap_put_ap(): refcount AP#0x4 put 0
    Debug: 118999 44527 command.c:153 script_debug(): command - mspm0x.dap apreg 4 0x00 0x100008
    Debug: 119000 44527 arm_adi_v5.c:1193 dap_get_ap(): refcount AP#0x4 get 1
    Debug: 119001 44528 arm_adi_v5.c:1218 dap_put_ap(): refcount AP#0x4 put 0
    Debug: 119002 44528 command.c:153 script_debug(): command - mspm0x.cpu arp_examine allow-defer
    Debug: 119003 44529 arm_adi_v5.c:934 mem_ap_init(): MEM_AP CFG: large data 0, long address 0, big-endian 0
    Debug: 119004 44529 command.c:153 script_debug(): command - mspm0x.cpu invoke-event examine-end
    Debug: 119005 44529 command.c:153 script_debug(): command - mspm0x.cpu invoke-event reset-assert-pre
    Debug: 119006 44529 command.c:153 script_debug(): command - transport select
    Debug: 119007 44530 command.c:153 script_debug(): command - mspm0x.cpu arp_reset assert 1
    Debug: 119008 44530 target.c:2131 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 119009 44530 cortex_m.c:1691 cortex_m_assert_reset(): [mspm0x.cpu] target->state: halted, examined
    Debug: 119010 44531 cortex_m.c:1806 cortex_m_assert_reset(): [mspm0x.cpu] Using Cortex-M SYSRESETREQ
    Debug: 119011 44532 arm_adi_v5.c:859 dap_dp_init_or_reconnect(): mspm0x.dap
    Debug: 119012 44532 arm_adi_v5.c:783 dap_dp_init(): mspm0x.dap
    Debug: 119013 44533 arm_adi_v5.c:816 dap_dp_init(): DAP: wait CDBGPWRUPACK
    Debug: 119014 44533 arm_adi_v5.h:682 dap_dp_poll_register(): DAP: poll 4, mask 0x20000000, value 0x20000000
    Debug: 119015 44533 arm_adi_v5.c:824 dap_dp_init(): DAP: wait CSYSPWRUPACK
    Debug: 119016 44534 arm_adi_v5.h:682 dap_dp_poll_register(): DAP: poll 4, mask 0x80000000, value 0x80000000
    Debug: 119017 44534 xds110.c:1333 xds110_swd_queue_cmd(): XDS110: refusing to enable sticky overrun detection
    Debug: 119018 44588 command.c:153 script_debug(): command - mspm0x.cpu invoke-event reset-assert-post
    Debug: 119019 44589 command.c:153 script_debug(): command - mspm0x.cpu invoke-event reset-deassert-pre
    Debug: 119020 44589 command.c:153 script_debug(): command - transport select
    Debug: 119021 44589 command.c:153 script_debug(): command - mspm0x.cpu arp_reset deassert 1
    Debug: 119022 44589 target.c:2131 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 119023 44589 cortex_m.c:1849 cortex_m_deassert_reset(): [mspm0x.cpu] target->state: reset, examined
    Debug: 119024 44590 command.c:153 script_debug(): command - mspm0x.cpu invoke-event reset-deassert-post
    Debug: 119025 44590 command.c:153 script_debug(): command - transport select
    Debug: 119026 44590 command.c:153 script_debug(): command - mspm0x.cpu was_examined
    Debug: 119027 44590 command.c:153 script_debug(): command - mspm0x.cpu arp_waitstate halted 1000
    Debug: 119028 44592 cortex_m.c:1012 cortex_m_poll_one(): [mspm0x.cpu] Exit from reset with dcb_dhcsr 0x30003
    Debug: 119029 44594 cortex_m.c:619 cortex_m_endreset_event(): [mspm0x.cpu] DCB_DEMCR = 0x01000401
    Debug: 119030 44595 target.c:2651 target_write_u32(): address: 0xe0002000, value: 0x00000003
    Debug: 119031 44597 target.c:2563 target_read_u32(): address: 0xe0002000, value: 0x00000041
    Debug: 119032 44597 target.c:2651 target_write_u32(): address: 0xe0002008, value: 0x00000000
    Debug: 119033 44598 target.c:2651 target_write_u32(): address: 0xe000200c, value: 0x00000000
    Debug: 119034 44600 target.c:2651 target_write_u32(): address: 0xe0002010, value: 0x00000000
    Debug: 119035 44601 target.c:2651 target_write_u32(): address: 0xe0002014, value: 0x00000000
    Debug: 119036 44603 target.c:2651 target_write_u32(): address: 0xe0001020, value: 0x00000000
    Debug: 119037 44604 target.c:2651 target_write_u32(): address: 0xe0001024, value: 0x00000000
    Debug: 119038 44605 target.c:2651 target_write_u32(): address: 0xe0001028, value: 0x00000000
    Debug: 119039 44606 target.c:2651 target_write_u32(): address: 0xe0001030, value: 0x00000000
    Debug: 119040 44607 target.c:2651 target_write_u32(): address: 0xe0001034, value: 0x00000000
    Debug: 119041 44608 target.c:2651 target_write_u32(): address: 0xe0001038, value: 0x00000000
    Debug: 119042 44609 cortex_m.c:852 cortex_m_debug_entry(): [mspm0x.cpu]
    Debug: 119043 44611 cortex_m.c:557 cortex_m_clear_halt(): [mspm0x.cpu] NVIC_DFSR 0x9
    Debug: 119044 44614 cortex_m.c:359 cortex_m_fast_read_all_regs(): [mspm0x.cpu] read 20 32-bit registers
    Debug: 119045 44614 cortex_m.c:922 cortex_m_debug_entry(): [mspm0x.cpu] entered debug state in core mode: Thread at PC 0x3ea8, cpu in Non-Secure state, target->state: halted
    Debug: 119046 44614 target.c:1775 target_call_event_callbacks(): target event 0 (gdb-halt) for core mspm0x.cpu
    Debug: 119047 44614 target.c:1775 target_call_event_callbacks(): target event 1 (halted) for core mspm0x.cpu
    User : 119048 44615 armv7m.c:771 armv7m_arch_state(): [mspm0x.cpu] halted due to breakpoint, current mode: Thread
    xPSR: 0xf1000000 pc: 0x00003ea8 msp: 0x20208000
    Debug: 119049 44615 command.c:153 script_debug(): command - mspm0x.cpu curstate
    Debug: 119050 44615 command.c:153 script_debug(): command - transport select
    Debug: 119051 44615 command.c:153 script_debug(): command - mspm0x.cpu was_examined
    Debug: 119052 44615 command.c:153 script_debug(): command - mspm0x.cpu arp_waitstate halted 5000
    Debug: 119053 44616 command.c:153 script_debug(): command - mspm0x.cpu invoke-event reset-init
    Debug: 119054 44617 command.c:153 script_debug(): command - mspm0x.cpu invoke-event reset-end
    Info : 119055 44618 server.c:298 add_service(): Listening on port 50001 for tcl connections
    Info : 119056 44619 server.c:298 add_service(): Listening on port 50002 for telnet connections
    Debug: 119057 44619 command.c:153 script_debug(): command - init
    Error: 119058 44619 server.c:504 server_loop(): error during select: Bad file descriptor
    [2025-04-09T06:25:00.604Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
    GDB server session ended. This terminal will be reused, waiting for next session to start...

    after this popup comes saying that : (failed to launch GDB:Remote communication error, target disconnected (undocumented error 10061)).

    what might cause this error.?

    when i have removed ("-c","program C:/openOCD_04_04_2025/openOCD/THB/thb/build/gcc/debug/my_executable.out",)

    i am getting in debug as

    [2025-04-09T06:44:30.408Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
    "C:/msys64/usr/bin/openocd.exe" -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s "C:/openOCD_04_04_2025/openOCD/openocd/tcl" -f "c:/Users/prajesh.karmalkar/.vscode/extensions/marus25.cortex-debug-1.12.1/support/openocd-helpers.tcl" -f interface/xds110.cfg -f target/ti_mspm0.cfg -c "adapter speed 5000" -d -c "gdb port 50000" -c "tcl port 50001" -c "telnet port 50002" -c "reset init"
    Open On-Chip Debugger 0.12.0+dev-03474-gf5dd564a7 (2025-04-08-09:48)
    Licensed under GNU GPL v2
    For bug reports, read
    openocd.org/.../bugs.html
    User : 3 4 options.c:52 configuration_output_handler(): debug_level: 3User : 4 4 options.c:52 configuration_output_handler():
    Debug: 5 4 options.c:348 parse_cmdline_args(): ARGV[0] = "/usr/bin/openocd"
    Debug: 6 5 options.c:348 parse_cmdline_args(): ARGV[1] = "-c"
    Debug: 7 5 options.c:348 parse_cmdline_args(): ARGV[2] = "gdb_port 50000"
    Debug: 8 5 options.c:348 parse_cmdline_args(): ARGV[3] = "-c"
    Debug: 9 5 options.c:348 parse_cmdline_args(): ARGV[4] = "tcl_port 50001"
    Debug: 10 5 options.c:348 parse_cmdline_args(): ARGV[5] = "-c"
    Debug: 11 5 options.c:348 parse_cmdline_args(): ARGV[6] = "telnet_port 50002"
    Debug: 12 5 options.c:348 parse_cmdline_args(): ARGV[7] = "-s"
    Debug: 13 5 options.c:348 parse_cmdline_args(): ARGV[8] = "C:/openOCD_04_04_2025/openOCD/openocd/tcl"
    Debug: 14 5 options.c:348 parse_cmdline_args(): ARGV[9] = "-f"
    Debug: 15 5 options.c:348 parse_cmdline_args(): ARGV[10] = "c:/Users/prajesh.karmalkar/.vscode/extensions/marus25.cortex-debug-1.12.1/support/openocd-helpers.tcl"
    Debug: 16 5 options.c:348 parse_cmdline_args(): ARGV[11] = "-f"
    Debug: 17 5 options.c:348 parse_cmdline_args(): ARGV[12] = "interface/xds110.cfg"
    Debug: 18 5 options.c:348 parse_cmdline_args(): ARGV[13] = "-f"
    Debug: 19 5 options.c:348 parse_cmdline_args(): ARGV[14] = "target/ti_mspm0.cfg"
    Debug: 20 5 options.c:348 parse_cmdline_args(): ARGV[15] = "-c"
    Debug: 21 6 options.c:348 parse_cmdline_args(): ARGV[16] = "adapter speed 5000"
    Debug: 22 6 options.c:348 parse_cmdline_args(): ARGV[17] = "-d"
    Debug: 23 6 options.c:348 parse_cmdline_args(): ARGV[18] = "-c"
    Debug: 24 6 options.c:348 parse_cmdline_args(): ARGV[19] = "gdb port 50000"
    Debug: 25 6 options.c:348 parse_cmdline_args(): ARGV[20] = "-c"
    Debug: 26 6 options.c:348 parse_cmdline_args(): ARGV[21] = "tcl port 50001"
    Debug: 27 6 options.c:348 parse_cmdline_args(): ARGV[22] = "-c"
    Debug: 28 6 options.c:348 parse_cmdline_args(): ARGV[23] = "telnet port 50002"
    Debug: 29 6 options.c:348 parse_cmdline_args(): ARGV[24] = "-c"
    Debug: 30 6 options.c:348 parse_cmdline_args(): ARGV[25] = "reset init"
    Debug: 31 6 options.c:233 add_default_dirs(): bindir=/usr/bin
    Debug: 32 6 options.c:234 add_default_dirs(): pkgdatadir=/usr/share/openocd
    Debug: 33 6 options.c:235 add_default_dirs(): exepath=C:/msys64/usr/bin
    Debug: 34 6 options.c:236 add_default_dirs(): bin2data=../share/openocd
    Debug: 35 6 configuration.c:33 add_script_search_dir(): adding C:/Users/prajesh.karmalkar/AppData/Roaming/OpenOCD
    Debug: 36 6 configuration.c:33 add_script_search_dir(): adding /home/Prajesh.Karmalkar/.config/openocd
    Debug: 37 7 configuration.c:33 add_script_search_dir(): adding /home/Prajesh.Karmalkar/.openocd
    Debug: 38 7 configuration.c:33 add_script_search_dir(): adding C:/msys64/usr/bin/../share/openocd/site
    Debug: 39 7 configuration.c:33 add_script_search_dir(): adding C:/msys64/usr/bin/../share/openocd/scripts
    Debug: 40 7 command.c:153 script_debug(): command - echo DEPRECATED! use 'gdb port', not 'gdb_port'
    User : 41 7 command.c:678 handle_echo(): DEPRECATED! use 'gdb port', not 'gdb_port'
    Debug: 42 7 command.c:153 script_debug(): command - gdb port 50000
    Debug: 43 7 command.c:153 script_debug(): command - echo DEPRECATED! use 'tcl port' not 'tcl_port'
    User : 44 7 command.c:678 handle_echo(): DEPRECATED! use 'tcl port' not 'tcl_port'
    Debug: 45 7 command.c:153 script_debug(): command - tcl port 50001
    Debug: 46 7 command.c:153 script_debug(): command - echo DEPRECATED! use 'telnet port', not 'telnet_port'
    User : 47 7 command.c:678 handle_echo(): DEPRECATED! use 'telnet port', not 'telnet_port'
    Debug: 48 7 command.c:153 script_debug(): command - telnet port 50002
    Debug: 49 8 command.c:153 script_debug(): command - ocd_find c:/Users/prajesh.karmalkar/.vscode/extensions/marus25.cortex-debug-1.12.1/support/openocd-helpers.tcl
    Debug: 50 8 configuration.c:88 find_file(): found c:/Users/prajesh.karmalkar/.vscode/extensions/marus25.cortex-debug-1.12.1/support/openocd-helpers.tcl
    User : 51 10 options.c:52 configuration_output_handler(): CDLiveWatchSetupUser : 52 10 options.c:52 configuration_output_handler():
    Debug: 53 10 command.c:153 script_debug(): command - ocd_find interface/xds110.cfg
    Debug: 54 12 configuration.c:88 find_file(): found C:/openOCD_04_04_2025/openOCD/openocd/tcl/interface/xds110.cfg
    Debug: 55 13 command.c:153 script_debug(): command - adapter driver xds110
    Debug: 56 13 command.c:153 script_debug(): command - ocd_find target/ti_mspm0.cfg
    Debug: 57 14 configuration.c:88 find_file(): found C:/openOCD_04_04_2025/openOCD/openocd/tcl/target/ti_mspm0.cfg
    Debug: 58 15 command.c:153 script_debug(): command - ocd_find bitsbytes.tcl
    Debug: 59 15 configuration.c:88 find_file(): found C:/openOCD_04_04_2025/openOCD/openocd/tcl/bitsbytes.tcl
    Debug: 60 17 command.c:153 script_debug(): command - ocd_find target/swj-dp.tcl
    Debug: 61 18 configuration.c:88 find_file(): found C:/openOCD_04_04_2025/openOCD/openocd/tcl/target/swj-dp.tcl
    Debug: 62 18 command.c:153 script_debug(): command - transport select
    Info : 63 18 transport.c:267 handle_transport_select(): auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
    Debug: 64 19 command.c:153 script_debug(): command - transport select swd
    Warn : 65 19 transport.c:280 handle_transport_select(): Transport "swd" was already selected
    Debug: 66 19 command.c:153 script_debug(): command - transport select
    Debug: 67 19 command.c:153 script_debug(): command - transport select
    Debug: 68 19 command.c:153 script_debug(): command - swd newdap mspm0x cpu -irlen 4 -expected-id 0x2ba01477
    Debug: 69 19 tcl.c:404 handle_jtag_newtap_args(): Creating New Tap, Chip: mspm0x, Tap: cpu, Dotted: mspm0x.cpu, 4 params
    Debug: 70 19 core.c:1488 jtag_tap_init(): Created Tap: mspm0x.cpu @ abs position 0, irlen 4, capture: 0x1 mask: 0x3
    Debug: 71 19 command.c:153 script_debug(): command - dap create mspm0x.dap -chain-position mspm0x.cpu
    Debug: 72 19 command.c:153 script_debug(): command - target create mspm0x.cpu cortex_m -dap mspm0x.dap
    Debug: 73 19 command.c:259 register_command(): command 'tpiu' is already registered
    Debug: 74 19 command.c:259 register_command(): command 'rtt' is already registered
    Debug: 75 20 command.c:153 script_debug(): command - add_help_text mspm0_factory_reset Force Factory reset to recover 'bricked' board
    Debug: 76 20 command.c:153 script_debug(): command - add_help_text mspm0_mass_erase Mass erase flash
    Debug: 77 20 command.c:153 script_debug(): command - add_help_text mspm0_start_bootloader Ask explicitly for bootloader startup
    Debug: 78 20 command.c:153 script_debug(): command - add_help_text mspm0_board_reset Request a board level reset
    Debug: 79 20 command.c:153 script_debug(): command - mspm0x.cpu configure -event examine-start _mspm0_enable_low_power_mode
    Debug: 80 20 command.c:153 script_debug(): command - mspm0x.cpu configure -work-area-phys 0x20000000 -work-area-size 0x400 -work-area-backup 0
    Debug: 81 20 target.c:2131 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 82 20 target.c:2131 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 83 20 target.c:2131 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 84 20 command.c:153 script_debug(): command - flash bank mspm0x.flash.main mspm0 0 0 0 0 mspm0x.cpu
    Debug: 85 20 tcl.c:1307 handle_flash_bank_command(): 'mspm0' driver usage field missing
    Debug: 86 20 command.c:153 script_debug(): command - flash bank mspm0x.flash.nonmain mspm0 0x41c00000 0 0 0 mspm0x.cpu
    Debug: 87 20 tcl.c:1307 handle_flash_bank_command(): 'mspm0' driver usage field missing
    Debug: 88 20 command.c:153 script_debug(): command - flash bank mspm0x.flash.data mspm0 0x41d00000 0 0 0 mspm0x.cpu
    Debug: 89 20 tcl.c:1307 handle_flash_bank_command(): 'mspm0' driver usage field missing
    Debug: 90 20 command.c:153 script_debug(): command - cortex_m reset_config sysresetreq
    User : 91 21 options.c:52 configuration_output_handler(): cortex_m reset_config sysresetreqUser : 92 21 options.c:52 configuration_output_handler():
    Debug: 93 21 command.c:153 script_debug(): command - adapter speed 5000
    Debug: 94 21 adapter.c:253 adapter_config_khz(): handle adapter khz
    Debug: 95 21 adapter.c:216 adapter_khz_to_speed(): convert khz to adapter specific speed value
    Debug: 96 21 adapter.c:216 adapter_khz_to_speed(): convert khz to adapter specific speed value
    User : 97 21 options.c:52 configuration_output_handler(): adapter speed: 5000 kHzUser : 98 21 options.c:52 configuration_output_handler():
    Debug: 99 21 command.c:153 script_debug(): command - gdb port 50000
    Debug: 100 21 command.c:153 script_debug(): command - tcl port 50001
    Debug: 101 21 command.c:153 script_debug(): command - telnet port 50002
    User : 102 21 command.c:601 command_run_line(): invalid command name "reset"
    Debug: 103 21 breakpoints.c:328 breakpoint_remove_all_internal(): [mspm0x.cpu] Delete all breakpoints
    Debug: 104 21 target.c:2131 target_free_all_working_areas_restore(): freeing all working areas
    [2025-04-09T06:44:32.056Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
    GDB server session ended. This terminal will be reused, waiting for next session to start...

    Debug is not working what may the cause.

  • i used arm-gnu-toolchain-13.3.rel1-mingw-w64-i686-arm-none-eabi for to build .out file and for cortex debug gdb path, and for openocd build using gcc(13.3)

  • You're not building it with xds. Add this line  --enable-xds110

  • added --enable-xds110 

    --host=x86_64-w64-mingw32 --enable-ftdi --enable-swd --disable-werror  --enable-xds110

    Debug: 124973 44966 target.c:2651 target_write_u32(): address: 0x400ce210, value: 0xfffffffe
    Debug: 124974 44966 target.c:2345 target_write_buffer(): writing buffer of 8 byte at 0x400ce130
    Debug: 124975 44967 target.c:2651 target_write_u32(): address: 0x400ce100, value: 0x00000001
    Debug: 124976 44967 target.c:2563 target_read_u32(): address: 0x400ce3d0, value: 0x00000004
    Debug: 124977 44968 target.c:2563 target_read_u32(): address: 0x400ce3d0, value: 0x00000003
    Debug: 124978 44968 target.c:2651 target_write_u32(): address: 0x400ce210, value: 0x00000001
    Debug: 124979 44968 command.c:153 script_debug(): command - echo ** Programming Finished **
    Debug: 124980 44968 log.c:419 gdb_timeout_warning(): keep_alive() was not invoked in the 1000 ms timelimit (44968 ms). This may cause trouble with GDB connections.
    User : 124981 44969 command.c:678 handle_echo(): ** Programming Finished **
    Debug: 124982 44969 command.c:153 script_debug(): command - reset init
    Debug: 124983 44969 target.c:1794 target_call_reset_callbacks(): target reset 3 (init)
    Debug: 124984 44969 command.c:153 script_debug(): command - target names
    Debug: 124985 44969 command.c:153 script_debug(): command - mspm0x.cpu invoke-event reset-start
    Debug: 124986 44969 command.c:153 script_debug(): command - transport select
    Debug: 124987 44969 command.c:153 script_debug(): command - transport select
    Debug: 124988 44969 command.c:153 script_debug(): command - mspm0x.cpu invoke-event examine-start
    Debug: 124989 44969 target.c:4681 target_handle_event(): target: mspm0x.cpu (cortex_m) event: 19 (examine-start) action: _mspm0_enable_low_power_mode
    Debug: 124990 44969 command.c:153 script_debug(): command - mspm0x.dap apreg 4 0x00 0x104008
    Debug: 124991 44969 arm_adi_v5.c:1193 dap_get_ap(): refcount AP#0x4 get 1
    Debug: 124992 44970 arm_adi_v5.c:1218 dap_put_ap(): refcount AP#0x4 put 0
    Debug: 124993 44970 command.c:153 script_debug(): command - mspm0x.dap apreg 4 0xF0 0x01
    Debug: 124994 44970 arm_adi_v5.c:1193 dap_get_ap(): refcount AP#0x4 get 1
    Debug: 124995 44970 arm_adi_v5.c:1218 dap_put_ap(): refcount AP#0x4 put 0
    Debug: 124996 44970 command.c:153 script_debug(): command - mspm0x.dap apreg 4 0x00 0x100008
    Debug: 124997 44970 arm_adi_v5.c:1193 dap_get_ap(): refcount AP#0x4 get 1
    Debug: 124998 44971 arm_adi_v5.c:1218 dap_put_ap(): refcount AP#0x4 put 0
    Debug: 124999 44971 command.c:153 script_debug(): command - mspm0x.cpu arp_examine allow-defer
    Debug: 125000 44971 arm_adi_v5.c:934 mem_ap_init(): MEM_AP CFG: large data 0, long address 0, big-endian 0
    Debug: 125001 44972 command.c:153 script_debug(): command - mspm0x.cpu invoke-event examine-end
    Debug: 125002 44972 command.c:153 script_debug(): command - mspm0x.cpu invoke-event reset-assert-pre
    Debug: 125003 44972 command.c:153 script_debug(): command - transport select
    Debug: 125004 44972 command.c:153 script_debug(): command - mspm0x.cpu arp_reset assert 1
    Debug: 125005 44972 target.c:2131 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 125006 44972 cortex_m.c:1691 cortex_m_assert_reset(): [mspm0x.cpu] target->state: halted, examined
    Debug: 125007 44973 cortex_m.c:1806 cortex_m_assert_reset(): [mspm0x.cpu] Using Cortex-M SYSRESETREQ
    Debug: 125008 44973 arm_adi_v5.c:859 dap_dp_init_or_reconnect(): mspm0x.dap
    Debug: 125009 44974 arm_adi_v5.c:783 dap_dp_init(): mspm0x.dap
    Debug: 125010 44974 arm_adi_v5.c:816 dap_dp_init(): DAP: wait CDBGPWRUPACK
    Debug: 125011 44974 arm_adi_v5.h:682 dap_dp_poll_register(): DAP: poll 4, mask 0x20000000, value 0x20000000
    Debug: 125012 44974 arm_adi_v5.c:824 dap_dp_init(): DAP: wait CSYSPWRUPACK
    Debug: 125013 44974 arm_adi_v5.h:682 dap_dp_poll_register(): DAP: poll 4, mask 0x80000000, value 0x80000000
    Debug: 125014 44974 xds110.c:1333 xds110_swd_queue_cmd(): XDS110: refusing to enable sticky overrun detection
    Debug: 125015 45027 command.c:153 script_debug(): command - mspm0x.cpu invoke-event reset-assert-post
    Debug: 125016 45027 command.c:153 script_debug(): command - mspm0x.cpu invoke-event reset-deassert-pre
    Debug: 125017 45027 command.c:153 script_debug(): command - transport select
    Debug: 125018 45027 command.c:153 script_debug(): command - mspm0x.cpu arp_reset deassert 1
    Debug: 125019 45027 target.c:2131 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 125020 45027 cortex_m.c:1849 cortex_m_deassert_reset(): [mspm0x.cpu] target->state: reset, examined
    Debug: 125021 45027 command.c:153 script_debug(): command - mspm0x.cpu invoke-event reset-deassert-post
    Debug: 125022 45027 command.c:153 script_debug(): command - transport select
    Debug: 125023 45027 command.c:153 script_debug(): command - mspm0x.cpu was_examined
    Debug: 125024 45027 command.c:153 script_debug(): command - mspm0x.cpu arp_waitstate halted 1000
    Debug: 125025 45028 cortex_m.c:1012 cortex_m_poll_one(): [mspm0x.cpu] Exit from reset with dcb_dhcsr 0x30003
    Debug: 125026 45028 cortex_m.c:619 cortex_m_endreset_event(): [mspm0x.cpu] DCB_DEMCR = 0x01000401
    Debug: 125027 45028 target.c:2651 target_write_u32(): address: 0xe0002000, value: 0x00000003
    Debug: 125028 45029 target.c:2563 target_read_u32(): address: 0xe0002000, value: 0x00000041
    Debug: 125029 45029 target.c:2651 target_write_u32(): address: 0xe0002008, value: 0x00000000
    Debug: 125030 45029 target.c:2651 target_write_u32(): address: 0xe000200c, value: 0x00000000
    Debug: 125031 45030 target.c:2651 target_write_u32(): address: 0xe0002010, value: 0x00000000
    Debug: 125032 45030 target.c:2651 target_write_u32(): address: 0xe0002014, value: 0x00000000
    Debug: 125033 45031 target.c:2651 target_write_u32(): address: 0xe0001020, value: 0x00000000
    Debug: 125034 45031 target.c:2651 target_write_u32(): address: 0xe0001024, value: 0x00000000
    Debug: 125035 45031 target.c:2651 target_write_u32(): address: 0xe0001028, value: 0x00000000
    Debug: 125036 45032 target.c:2651 target_write_u32(): address: 0xe0001030, value: 0x00000000
    Debug: 125037 45032 target.c:2651 target_write_u32(): address: 0xe0001034, value: 0x00000000
    Debug: 125038 45032 target.c:2651 target_write_u32(): address: 0xe0001038, value: 0x00000000
    Debug: 125039 45033 cortex_m.c:852 cortex_m_debug_entry(): [mspm0x.cpu]
    Debug: 125040 45034 cortex_m.c:557 cortex_m_clear_halt(): [mspm0x.cpu] NVIC_DFSR 0x9
    Debug: 125041 45036 cortex_m.c:359 cortex_m_fast_read_all_regs(): [mspm0x.cpu] read 20 32-bit registers
    Debug: 125042 45036 cortex_m.c:922 cortex_m_debug_entry(): [mspm0x.cpu] entered debug state in core mode: Thread at PC 0x3f98, cpu in Non-Secure state, target->state: halted
    Debug: 125043 45036 target.c:1775 target_call_event_callbacks(): target event 0 (gdb-halt) for core mspm0x.cpu
    Debug: 125044 45036 target.c:1775 target_call_event_callbacks(): target event 1 (halted) for core mspm0x.cpu
    User : 125045 45036 armv7m.c:771 armv7m_arch_state(): [mspm0x.cpu] halted due to breakpoint, current mode: Thread
    xPSR: 0xf1000000 pc: 0x00003f98 msp: 0x20208000
    Debug: 125046 45036 command.c:153 script_debug(): command - mspm0x.cpu curstate
    Debug: 125047 45037 command.c:153 script_debug(): command - transport select
    Debug: 125048 45037 command.c:153 script_debug(): command - mspm0x.cpu was_examined
    Debug: 125049 45037 command.c:153 script_debug(): command - mspm0x.cpu arp_waitstate halted 5000
    Debug: 125050 45037 command.c:153 script_debug(): command - mspm0x.cpu invoke-event reset-init
    Debug: 125051 45037 command.c:153 script_debug(): command - mspm0x.cpu invoke-event reset-end
    Info : 125052 45038 server.c:298 add_service(): Listening on port 50001 for tcl connections
    Info : 125053 45038 server.c:298 add_service(): Listening on port 50002 for telnet connections
    Debug: 125054 45038 command.c:153 script_debug(): command - init
    Error: 125055 45039 server.c:504 server_loop(): error during select: Bad file descriptor
    Debug: 125056 45039 breakpoints.c:328 breakpoint_remove_all_internal(): [mspm0x.cpu] Delete all breakpoints
    Debug: 125057 45039 arm_adi_v5.c:1218 dap_put_ap(): refcount AP#0x0 put 0
    Debug: 125058 45039 target.c:2131 target_free_all_working_areas_restore(): freeing all working areas
    Debug: 125059 45039 xds110.c:1118 xds110_swd_switch_seq(): SWD-to-JTAG
    Info : 125060 45142 xds110.c:451 usb_disconnect(): XDS110: disconnected
    [2025-04-09T15:32:47.046Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
    GDB server session ended. This terminal will be reused, waiting for next session to start...

  • Could you remove tcl and telnet from your argument list and see if it changes the behavior. You're utilizing GDB to debug so there is no purpose for the other two, I wonder if it's causing the bad file descriptor you're seeing.

  • I have removed tcl and telnet from argument.

    and below is my launch json file .

    {
        "configurations": [
            {
                "name": "Debug with TI Embedded Debug for VS Code",
                "cwd": "C:/openOCD_09_04_2025/THB/thb/build/gcc/debug",
                "executable": "thb.out",
                "request": "launch",
                "type": "cortex-debug",
                "servertype": "openocd",
                "gdbTarget": "localhost:50000",
                "runToEntryPoint": "main",
                "showDevDebugOutput": "none",

                "configFiles": [
                    "interface/xds110.cfg",
                    "target/ti_mspm0.cfg"
                ],
                "searchDir": [
                    "C:/openOCD_09_04_2025/openocd/openocd/tcl"
                ],

                "overrideLaunchCommands": [
                    "file thb.out",
                    "target remote localhost:50000"
                ],

                "serverArgs": [
                    "-c", "adapter speed 5000",
                    "-d",
                    "-c", "gdb port 50000",
                    "-c","program C:/openOCD_09_04_2025/THB/thb/build/gcc/debug/thb.out",
                    "-c", "reset init"
                ]
            }
        ]
    }
    Error:
    target still getting disconnecting,

      

    Below is my openocd configuration summary. anything looks missing or need to disable?

    Currently i am using Mspm0g3507 launch pad debugger section to communicate with target (i.e Target is my project board. Having MSPM0G3507 controller)

    If possible, can you share me the openocd build steps and launch json and settings files , using which programing and debugging works from your end?

  • Hi,

    You said you use debugger in the launchpad for debugging your self application board. Which pins are you using for connecting?

  • Hi Xie

    I am using xdx110 out connector 

     

    CONNECTOR PINS

  • Hi,

    Here is a general OpenOCD setup guidance, could you check whether it works for you.

    OpenOCD Setup Guidance.pdf

  • Hi 

    I followed the OpenOCD Setup guidance i got the below result .

    --> Also, i have tried to debug code using VScode 

    -> launch.json file 

    ->settings.json file

    --> 

    The debug session is not starting from the main.c, it says file not found. Any suggestions on this?

    With the disabling of the debug flag

    [2025-04-21T06:56:36.452Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
    "C:/cygwin64/home/Prajesh.Karmalkar/openocd-0.12.0/src/openocd.exe" -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s "C:\\openOCD_tisag_18_04_25\\thb" -f "c:/Users/prajesh.karmalkar/.vscode/extensions/marus25.cortex-debug-1.12.1/support/openocd-helpers.tcl" -f "C:/cygwin64/home/Prajesh.Karmalkar/openocd-0.12.0/tcl/interface/xds110.cfg" -f "C:/cygwin64/home/Prajesh.Karmalkar/openocd-0.12.0/tcl/target/ti_msp432.cfg" -c "adapter speed 5000"
    Open On-Chip Debugger 0.12.0
    Licensed under GNU GPL v2
    For bug reports, read
    openocd.org/.../bugs.html
    CDLiveWatchSetup
    Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
    cortex_m reset_config sysresetreq

    adapter speed: 5000 kHz

    Info : Listening on port 50001 for tcl connections
    Info : Listening on port 50002 for telnet connections
    Info : XDS110: connected
    Info : XDS110: vid/pid = 0451/bef3
    Info : XDS110: firmware version = 3.0.0.32
    Info : XDS110: hardware version = 0x0028
    Info : XDS110: connected to target via SWD
    Info : XDS110: SWCLK set to 2500 kHz
    Info : clock speed 5000 kHz
    Info : SWD DPIDR 0x6ba02477
    Info : [msp432.cpu] Cortex-M0+ r0p1 processor detected
    Info : [msp432.cpu] target has 4 breakpoints, 2 watchpoints
    Info : starting gdb server for msp432.cpu on 50000
    Info : Listening on port 50000 for gdb connections
    Info : accepting 'gdb' connection on tcp/50000
    undefined debug reason 8 - target needs reset
    [msp432.cpu] halted due to debug-request, current mode: Thread
    xPSR: 0xf1000000 pc: 0x00003f98 msp: 0x20208000

  • Hello,

    The example provided by Pengfei above shows how it can be done for MSP432, the same method can be applied to MSPM0 as well. Please switch the configuration to use MSPM0 instead of MSP432 as you are using it for the MSPM0 device.

  • Hi 

    Yes, But there is no configuration file related to mspm0 in the openocd target folder, as shown below. What to do in this case ?

  • Please clone the master branch of the project. You are not on the master branch.

    The example provided by Pengfei showed the steps on how to compile it but it points to a different version of the OpenOCD project.

    These are the steps you will need to follow.

    1) Clone the master branch of the OpenOCD project

    2) Build using the steps provided

    Thanks

  • Hi Henry, As per your suggestion, i have done the above steps. but 

    debug session not able to find main.c file as shown above image.

    launch .json

            {
                "cwd": "${workspaceRoot}",
                "executable": "C:/openOCD_tisag_18_04_25/thb/build/gcc/debug/thb.out",
                "name": "Debug",
                "request": "attach",
                //"request": "launch",
                "type": "cortex-debug",
                "servertype": "openocd",
                "configFiles": [
                    "C:/cygwin64/home/user_name/openocd/tcl/interface/xds110.cfg",
                    "C:/cygwin64/home/user_name/openocd/tcl/target/ti_mspm0.cfg"
                ],
                "searchDir": [],
                "runToEntryPoint": "main",
                "showDevDebugOutput": "raw",
                "serverArgs": [
                    "-c", "adapter speed 1000",
                    //"-d",
                    //"-c", "gdb port 50000",
                    //"-c","program C:/openOCD_tisag_18_04_25/thb/build/gcc/debug/thb.out",
                    // "-c", "reset init"

                ]
            },
    settings.json
       "cortex-debug.gdbPath": "C:/cygwin64/bin/gdb-multiarch.exe",
        "cortex-debug.openocdPath": "C:/cygwin64/home/user_name/openocd/src/openocd.exe"