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.

Linux causing CCS/JTAG to disconnect

Hello all,


I am able to use CCSv6/BlackHawkUSB560v2 to debug both MLO and U-Boot. From U-Boot, I want to debug the kernel boot process. However after I start my kennel, I lose my connection to the target with the error:

CortxA8: Error: (Error -1204 @ 0x3D5B) Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 5.1.450.0)

Based on my research, I believe my kernel may not be configured to allow JTAG debugging, possibly to conserve power. I have read the following document:

http://processors.wiki.ti.com/index.php/Linux_Debug_in_CCSv5#Compiling_the_Linux_kernel_with_debug_information

which states that I must use menuconfig to enable the following:

  • Kernel Hacking ---> Enable JTAG clock for debugger connectivity

however my kernel (3.12) does not seem to have this option. The following post seems to detail the exact same problem, but with no resolution on how to modify the kernel to allow JTAG:

http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/338494/1187802.aspx#1187802

If anyone could please possibly provide some info on how to properly configure my kernel, it would be greatly appreciated. Thank you! - Anthony

  • Hi Anthony,

    Please refer to the following TI wiki which helps to debug the kernel.

    http://processors.wiki.ti.com/index.php/Sitara_Linux_Training:_uboot_linux_debug_with_ccsv5#Perform_Linux_Kernel_Debug

    Have you loaded the "vmlinux" through CCS ?

  • Titus,

    Thank you for the link. Although the procedure outlined basically matched what I was already doing, I went ahead and followed again step by step to make sure any subtle differences were not causing my problems. Results are the same... I can connect to target fine before any code is run, with SPL running, and with U-Boot running. However once I run the kernel I get disconnected from the target with the above mentioned error. The kernel continues to boot, and if I try reconnecting to the target I get the same error. Something in the kernel is preventing the debugger from connecting to the target.

    An important note is I am not running the SDK kernel, I am running a 3.12 kernel that I downloaded as follows:

    git clone git://github.com/beagleboard/kernel.git
    cd kernel
    git checkout 3.12
    ./patch.sh

    I did try using the SDK (v7.00) kernel but the kernel would not boot on our custom hardware (based on BeagleBoneBlack). I did not investigate why it was hanging.

    To answer your question in case it wasnt clear, yes I loaded vmlinux (symbols) through CCS.

    Thanks for your attention to this, please let me know if you might know what I can try. - Anthony

  • Hi Anthony,

    I have already debugged the kernel through CCS.

    You can put one "Breakpoint" in kernel board file and check whether the kernel hits ?

    Here are the steps that I have followed to debug the kernel.

    1) Boot the board through SD card (MLO and u-boot)

    2) Connect target through CCS

    3) Use "Load  Symbols" option to load "vmlinux" with out mentioning the "Code offset" and "Data offset" the check boxes.

    4) Put one "Break point" in linux kernel board file.

    5) Click "Run" option in CCS.

  • Titus,

    Thanks for your response. Did more testing today, and decided to go back to my BeagleBoneBlack so I have known good hardware. These are the steps I am taking to download and build the kernel:

    git clone git://github.com/beagleboard/kernel.git
    cd kernel
    git checkout 3.12
    ./patch.sh
    cp configs/beaglebone kernel/arch/arm/configs/beaglebone_defconfig
    wget http://arago-project.org/git/projects/?p=am33x-cm3.git\;a=blob_plain\;f=bin/am335x-pm-firmware.bin\;hb=HEAD -O kernel/firmware/am335x-pm-firmware.bin
    cd kernel
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- beaglebone_defconfig -j4
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage dtbs LOADADDR=0x80008000 -j4

    When I boot the resulting uImage on my beagleboneblack, my JTAG debugger is disconnected. If I run the exact same download/build steps, but checkout 3.8 instead of 3.12, the resulting uImage does allow my JTAG to stay connected.


    Is it possible something changed between 3.8 and 3.12 that might be giving me problems?

  • Hi Anthony,

    Have you set any break point in board file and able to hit the break point ?

  • Titus,


    Sorry I forgot to address this question in your previous post. I am able to set a breakpoint at the kernel entry point, and step through the initial code. However after I hit run and let the kernel complete booting, at some point the debugger is disconnected. - Anthony

  • Hi Titus,

    Went back to our custom hardware, I am able to successfully debug the 3.8 kernel.


    So based on my testing, if I build 3.12 kernel, on both our custom hardware and the BeagleBoneBlack, the kernel causes the jtag debugger to disconnect with error "Unable to access DAP...". If I run through the exact same build steps, but get 3.8 kernel instead of 3.12, the debugger stays connected on both our custom hardware and BeagleBoneBlack.

    So seems that something changed in 3.12 that is causing a problem with jtag debugging. We will continue development with 3.8 for now, but if you have any ideas on why 3.12 isnt working properly we would prefer to use a more current kernel.

    Thanks for your help on this - Anthony

  • It sounds like the debug subsystem clock is getting disabled. Doing a quick diff between 3.8 and 3.12, I saw in arch/arm/mach-omap2/cclock33xx_data.c:

    5801 @@ -431,15 +435,11 @@
     5802   *  - Driver code is not yet migrated to use hwmod/runtime pm
     5803   *  - Modules outside kernel access (to disable them by default)
     5804   *
     5805 - *     - debugss
     5806   *     - mmu (gfx domain)
     5807   *     - cefuse
     5808   *     - usbotg_fck (its additional clock and not really a modulemode)
     5809   *     - ieee5000
     5810   */
     5811 -DEFINE_CLK_GATE(debugss_ick, "dpll_core_m4_ck", &dpll_core_m4_ck, ENABLE_      ON_INIT,
     5812 -               AM33XX_CM_WKUP_DEBUGSS_CLKCTRL, AM33XX_MODULEMODE_SWCTRL_S      HIFT,
     5813 -               0x0, NULL);

    This might be the culprit.

    Steve K.

  • I was able to get this working, and will document here for anyone with the same problem. It seems this version of the kernel is disabling the DEBUGSS module clock. I have resolved this by adding the ".flags" member to the following structure:

    static struct omap_hwmod am33xx_debugss_hwmod = {
        .name        = "debugss",
        .class        = &am33xx_debugss_hwmod_class,
        .clkdm_name    = "l3_aon_clkdm",
        .flags        = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),/*Added this line*/
        .main_clk    = "trace_clk_div_ck",
        .prcm        = {
            .omap4    = {
                .clkctrl_offs    = AM33XX_CM_WKUP_DEBUGSS_CLKCTRL_OFFSET,
                .modulemode    = MODULEMODE_SWCTRL,
            },
        },
        .opt_clks    = debugss_opt_clks,
        .opt_clks_cnt    = ARRAY_SIZE(debugss_opt_clks),
    };

  • Hi Steve,

    Yes you are right. As Anthony stated, DEBUGSS clock seems to be disabled.

    Thanks.

    Hi Anthony,

    Sound good.

    We were glad that you able to solve the problem.

    Thanks for your update.

  • FYI, a quick and easy way to achieve this without rebuilding the kernel is to execute "devmem2 0x44e00414 w 0x12500002" from the Linux console. Once you've done that you can connect. Or another option I have found is that you can still connect to the DAP_M3 while in this state, and the DAP_M3 has access to that same location (e.g. if you didn't have devmem2 for some reason).
  • Had same issue on 3.18 kernel. This post helped me out. Thanks Anthony!