PROCESSOR-SDK-J784S4: Debugging with OpenOCD and GDB in an R5F application

Part Number: PROCESSOR-SDK-J784S4

Tool/software:

Hello everyone,

I am using a default image for the J784S4 and want to debug a default application running on mcu2_0 for testing.
I only have the mcu2_0 core running.
I am running OpenOCD and GDB by using the following commands:

openocd -c 'bindto 0.0.0.0' -f /usr/share/openocd/scripts/board/ti_j784s4_swd_native.cfg


gdb /usr/lib/firmware/ti-ipc/j784s4/ipc_echo_test_mcu2_0_release_strip.xer5f

> target extended-remote localhost:3338

When I try to connect GDB to the mcu2 core by using "target extended-remote", I get this error:

Info : accepting 'gdb' connection on tcp/3344
[  204.032521] SError Interrupt on CPU0, code 0x00000000bf000002 -- SError
[  204.032536] CPU: 0 UID: 0 PID: 809 Comm: openocd Tainted: G           O       6.12.35-ti-00946-g72f48d59b8f0-dirty #1
[  204.032543] Tainted: [O]=OOT_MODULE
[  204.032545] Hardware name: Texas Instruments J784S4 EVM (DT)
[  204.032548] pstate: 60000000 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[  204.032552] pc : 0000000000456a64
[  204.032554] lr : 0000000000457c58
[  204.032555] sp : 0000ffffe12862b0
[  204.032557] x29: 0000ffffe12862b0 x28: 00000000162438d0 x27: 0000000000000008
[  204.032564] x26: 0000000016246350 x25: 0000000016243be8 x24: 000000001614f300
[  204.032568] x23: 00000000007be000 x22: 0000ffffe1286364 x21: 000000009d410d00
[  204.032573] x20: 00000000a2000002 x19: 00000000161a96a0 x18: 0000000000000007
[  204.032578] x17: 0000ffff9ca90fe0 x16: 000000000041b270 x15: 0000000000000001
[  204.032582] x14: 0000000000000000 x13: 0000000000000035 x12: 0000ffff9cba0ad0
[  204.032587] x11: 0000001177a720f8 x10: 00ffffffffffffff x9 : 003ae3af00000000
[  204.032592] x8 : 0000000000000018 x7 : 0000000000000001 x6 : 0000000000000000
[  204.032596] x5 : 0000000000010000 x4 : 0000ffff7f200000 x3 : 00000000007cd8c8
[  204.032601] x2 : 0000ffffe1286364 x1 : 000000009d410d00 x0 : 00000000161a96a0
[  204.032608] Kernel panic - not syncing: Asynchronous SError Interrupt
[  204.032610] CPU: 0 UID: 0 PID: 809 Comm: openocd Tainted: G           O       6.12.35-ti-00946-g72f48d59b8f0-dirty #1
[  204.032615] Tainted: [O]=OOT_MODULE
[  204.032617] Hardware name: Texas Instruments J784S4 EVM (DT)
[  204.032619] Call trace:
[  204.032621]  dump_backtrace+0x90/0xe8
[  204.032636]  show_stack+0x18/0x24
[  204.032641]  dump_stack_lvl+0x34/0x8c
[  204.032647]  dump_stack+0x18/0x24
[  204.032650]  panic+0x390/0x3a4
[  204.032659]  nmi_panic+0x40/0x8c
[  204.032663]  arm64_serror_panic+0x64/0x70
[  204.032669]  do_serror+0x74/0x7c
[  204.032673]  __el0_error_handler_common+0x3c/0x9c
[  204.032678]  el0t_64_error_handler+0x10/0x1c
[  204.032682]  el0t_64_error+0x190/0x194
[  204.032685] SMP: stopping secondary CPUs
[  204.032700] Kernel Offset: disabled
[  204.032702] CPU features: 0x08,00002002,80200000,4200420b
[  204.032706] Memory Limit: none
[  204.235002] ---[ end Kernel panic - not syncing: Asynchronous SError Interrupt ]---


I repeated the same process for the am64x board and was able to connect to the core via gdb without any problems. 

However, I need that gdb works on Jacinto as well.

Any insight about this behavior on j784s4?



Thank you.

Best regards,
Joao Lima



  • Hi ,

    I have not tested running with only the MCU2_0 (j784s4.cpu.main0_r5.0) running, but I've verified that it's possible to connect to the core when everything is running.

    You may be connecting to the wrong core.

    Connecting OpenOCD:

    openocd/tcl$ ../src/openocd -f ./board/ti_j784s4evm.cfg 
    Open On-Chip Debugger 0.12.0+dev-01139-g68b6d3ad4 (2025-08-18-20:28)
    Licensed under GNU GPL v2
    For bug reports, read
    	http://openocd.org/doc/doxygen/bugs.html
    adapter speed: 2500 kHz
    Info : Listening on port 6666 for tcl connections
    Info : Listening on port 4444 for telnet connections
    Info : XDS110: vid/pid = 0451/bef3
    Info : XDS110: firmware version = 3.0.0.32
    Info : XDS110: hardware version = 0x002f
    Info : XDS110: connected to target via JTAG
    Info : XDS110: TCK set to 2500 kHz
    Info : clock speed 2500 kHz
    Info : JTAG tap: j784s4.cpu tap/device found: 0x0bb8002f (mfg: 0x017 (Texas Instruments), part: 0xbb80, ver: 0x0)
    Info : [j784s4.axi_ap] Examination succeed
    Info : [j784s4.cpu.sysctrl] starting gdb server on 3333
    Info : Listening on port 3333 for gdb connections
    Info : [j784s4.cpu.a72.0] starting gdb server on 3334
    Info : Listening on port 3334 for gdb connections
    Info : [j784s4.cpu.a72.1] starting gdb server on 3335
    Info : Listening on port 3335 for gdb connections
    Info : [j784s4.cpu.a72.2] starting gdb server on 3336
    Info : Listening on port 3336 for gdb connections
    Info : [j784s4.cpu.a72.3] starting gdb server on 3337
    Info : Listening on port 3337 for gdb connections
    Info : [j784s4.cpu.a72.4] starting gdb server on 3338
    Info : Listening on port 3338 for gdb connections
    Info : [j784s4.cpu.a72.5] starting gdb server on 3339
    Info : Listening on port 3339 for gdb connections
    Info : [j784s4.cpu.a72.6] starting gdb server on 3340
    Info : Listening on port 3340 for gdb connections
    Info : [j784s4.cpu.a72.7] starting gdb server on 3341
    Info : Listening on port 3341 for gdb connections
    Info : [j784s4.cpu.mcu_r5.0] starting gdb server on 3342
    Info : Listening on port 3342 for gdb connections
    Info : [j784s4.cpu.mcu_r5.1] starting gdb server on 3343
    Info : Listening on port 3343 for gdb connections
    Info : [j784s4.cpu.main0_r5.0] starting gdb server on 3344
    Info : Listening on port 3344 for gdb connections
    Info : [j784s4.cpu.main0_r5.1] starting gdb server on 3345
    Info : Listening on port 3345 for gdb connections
    Info : [j784s4.cpu.main1_r5.0] starting gdb server on 3346
    Info : Listening on port 3346 for gdb connections
    Info : [j784s4.cpu.main1_r5.1] starting gdb server on 3347
    Info : Listening on port 3347 for gdb connections
    Info : [j784s4.cpu.main2_r5.0] starting gdb server on 3348
    Info : Listening on port 3348 for gdb connections
    Info : [j784s4.cpu.main2_r5.1] starting gdb server on 3349
    Info : Listening on port 3349 for gdb connections
    Info : [j784s4.axi_ap] gdb port disabled

    Connecting to the core:

    $ gdb-multiarch
    >>> target extended-remote localhost:3344
    Remote debugging using localhost:3344
    warning: No executable has been specified and target does not support
    determining executable automatically.  Try using the "file" command.


    I do have an FAQ for debugging U-Boot with OpenOCD which may be helpful:  [FAQ] TDA4VH-Q1: How Do I Use OpenOCD to Debug U-Boot?  

    Best,
    Jared

  • Hello Jared,

    Thanks for your reply.

    I am trying to connect to the correct core.
    Otherwise, I wouldn't get a kernel panic, but rather a connection failure alert (and confirmed the sequence and results repeatedly).

    Furthermore, the same process that I perform for j784s4, which is failing, is being passed to am64x.

    Could you please run a test on your side with a J784S4 setup so we can cross information? I just want to use the mcu2_0 core.

    Best regard,
    Joao Lima

  • Hi ,

    I've verified running the sbl_boot_test_j784s4_evm_mcu2_0TestApp_release.appimage. There are no issues on my side.

    Once again, are you sure that you are connecting to the correct core?

    Please try the steps that I've run.

    Creating the test SD card image:

    $ cp ./pdk_j784s4_11_00_00_21/packages/ti/boot/sbl/binary/j784s4_evm/mmcsd/bin/sbl_mmcsd_img_mcu1_0_release.tiimage /media/`whoami`/boot/tiboot3.bin
    $ cp ./pdk_j784s4_11_00_00_21/packages/ti/boot/sbl/example/k3MulticoreApp/binary/j784s4/sbl_boot_test_j784s4_evm_mcu2_0TestApp_release.appimage /media/`whoami`/boot/app
    $ cp ./pdk_j784s4_11_00_00_21/packages/ti/drv/sciclient/soc/V6/tifs.bin /media/`whoami`/boot/tifs.bin

    Running OpenOCD:

    $ ../src/openocd -f ./board/ti_j784s4evm.cfg
    Open On-Chip Debugger 0.12.0+dev-01139-g68b6d3ad4 (2025-08-18-20:28)
    Licensed under GNU GPL v2
    For bug reports, read
    	http://openocd.org/doc/doxygen/bugs.html
    adapter speed: 2500 kHz
    Info : Listening on port 6666 for tcl connections
    Info : Listening on port 4444 for telnet connections
    Info : XDS110: vid/pid = 0451/bef3
    Info : XDS110: firmware version = 3.0.0.32
    Info : XDS110: hardware version = 0x002f
    Info : XDS110: connected to target via JTAG
    Info : XDS110: TCK set to 2500 kHz
    Info : clock speed 2500 kHz
    Info : JTAG tap: j784s4.cpu tap/device found: 0x0bb8002f (mfg: 0x017 (Texas Instruments), part: 0xbb80, ver: 0x0)
    Info : [j784s4.axi_ap] Examination succeed
    Info : [j784s4.cpu.sysctrl] starting gdb server on 3333
    Info : Listening on port 3333 for gdb connections
    Info : [j784s4.cpu.a72.0] starting gdb server on 3334
    Info : Listening on port 3334 for gdb connections
    Info : [j784s4.cpu.a72.1] starting gdb server on 3335
    Info : Listening on port 3335 for gdb connections
    Info : [j784s4.cpu.a72.2] starting gdb server on 3336
    Info : Listening on port 3336 for gdb connections
    Info : [j784s4.cpu.a72.3] starting gdb server on 3337
    Info : Listening on port 3337 for gdb connections
    Info : [j784s4.cpu.a72.4] starting gdb server on 3338
    Info : Listening on port 3338 for gdb connections
    Info : [j784s4.cpu.a72.5] starting gdb server on 3339
    Info : Listening on port 3339 for gdb connections
    Info : [j784s4.cpu.a72.6] starting gdb server on 3340
    Info : Listening on port 3340 for gdb connections
    Info : [j784s4.cpu.a72.7] starting gdb server on 3341
    Info : Listening on port 3341 for gdb connections
    Info : [j784s4.cpu.mcu_r5.0] starting gdb server on 3342
    Info : Listening on port 3342 for gdb connections
    Info : [j784s4.cpu.mcu_r5.1] starting gdb server on 3343
    Info : Listening on port 3343 for gdb connections
    Info : [j784s4.cpu.main0_r5.0] starting gdb server on 3344
    Info : Listening on port 3344 for gdb connections
    Info : [j784s4.cpu.main0_r5.1] starting gdb server on 3345
    Info : Listening on port 3345 for gdb connections
    Info : [j784s4.cpu.main1_r5.0] starting gdb server on 3346
    Info : Listening on port 3346 for gdb connections
    Info : [j784s4.cpu.main1_r5.1] starting gdb server on 3347
    Info : Listening on port 3347 for gdb connections
    Info : [j784s4.cpu.main2_r5.0] starting gdb server on 3348
    Info : Listening on port 3348 for gdb connections
    Info : [j784s4.cpu.main2_r5.1] starting gdb server on 3349
    Info : Listening on port 3349 for gdb connections
    Info : [j784s4.axi_ap] gdb port disabled

    Running GDB:

    $ gdb-multiarch
    >>> target extended-remote localhost:3344
    Remote debugging using localhost:3344
    warning: No executable has been specified and target does not support
    determining executable automatically.  Try using the "file" command.

    Best,
    Jared

  • Hello Jared,

    I accidentally considered it resolved.

    I already know what our delta is.

    I'm using SWD (Serial Wired Debug) instead of JTAG, like you are.

    I had to implement a custom SWD file for the J784S4 and AM642. For the latter board, everything is working fine, as I previously mentioned.
    You can find the configuration file ti_j784s4_swd_native.cfg
    below:

    # SPDX-License-Identifier: GPL-2.0-or-later
    # Copyright (C) 2022-2023 Texas Instruments Incorporated - http://www.ti.com/
    #
    # Texas Instruments TDA4VM/J721E
    # Link: https://www.ti.com/product/TDA4VM
    #
    # This configuration file is used as a self hosted debug configuration that
    # works on every TDA4VM platform based on firewall configuration permitted
    # in the system.
    #
    # In this system openOCD runs on one of the CPUs inside TDA4VM and provides
    # network ports that can then be used to debug the microcontrollers on the
    # SoC - either self hosted IDE OR remotely.
    
    # We are using dmem, which uses dapdirect_swd transport
    adapter driver dmem
    transport select swd
    
    if { ![info exists SOC] } {
            set SOC j784s4
    }
    source [find target/ti_k3.cfg]


    And the ti_k3.cfg with the j784s4 entry:

     j784s4 {
                    set _K3_DAP_TAPID 0x0bb8002f
    
                    # j784s4 has 2 cluster of 4 A72 cores each.
                    set _armv8_cpu_name a72
                    set _armv8_cores 8
                    set ARMV8_DBGBASE {0x90410000 0x90510000 0x90610000 0x90710000
                               0x90810000 0x90910000 0x90a10000 0x90b10000}
                    set ARMV8_CTIBASE {0x90420000 0x90520000 0x90620000 0x90720000
                               0x90820000 0x90920000 0x90a20000 0x90b20000}
    
                    # J784s4 has 4 clusters of 2 R5 cores each.
                    set _r5_cores 8
                    set R5_DBGBASE {0x9d010000 0x9d012000
                            0x9d410000 0x9d412000
                            0x9d510000 0x9d512000
                            0x9d610000 0x9d612000}
                    set R5_CTIBASE {0x9d018000 0x9d019000
                            0x9d418000 0x9d419000
                            0x9d518000 0x9d519000
                            0x9d618000 0x9d619000}
                    set R5_NAMES {mcu_r5.0 mcu_r5.1
                          main0_r5.0 main0_r5.1
                          main1_r5.0 main1_r5.1
                          main2_r5.0 main2_r5.1}
    
                    # Setup DMEM access descriptions
                    # DAPBUS (Debugger) description
                    set _dmem_base_address 0x4c40002000
                    set _dmem_ap_address_offset 0x100
                    set _dmem_max_aps 8
                    # Emulated AP description
                    set _dmem_emu_base_address 0x4c60000000
                    set _dmem_emu_base_address_map_to 0x1d600000
                    set _dmem_emu_ap_list 1
    
                    # sysctrl CTI base
                    set CM3_CTIBASE {0x20001000}
                    # Sysctrl power-ap unlock offsets
                    set _sysctrl_ap_unlock_offsets {0xf0 0x78}


    Any insight on this?

    Thank you.

    Best regards,
    Joao Lima

  • Hi ,

    I'm currently building an image with openocd installed, and I will test this tomorrow.

    Best,
    Jared

  • Hi ,

    What were your steps for cross-compiling for the A72s? I've been seeing 'configure: error: jimtcl is required but not found via pkg-config and system includes' issues.

    Additionally, I'll ask again, are you connecting to the correct port? 3338 should connect to an A72, which would likely cause problems.

    Best,
    Jared

  • Hello  

    You are right. Thanks. I shared the wrong logo regarding to the port usage.

    To be clear, I'm sharing a screenshot with my entire setup correctly.


    As you can see, when I try to connect to 3344, the connection is refused.


    In the following link, I share the openocd recipe:
    ti-j784s4-pcie-r5f/openocd at master · joaorl/ti-j784s4-pcie-r5f

    Best regards,
    Joao Lima