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.

TDA4VM: TDA4VM use KGDB to debug kernel

Part Number: TDA4VM

Hi all,

       We want to debug kernel using KGDB on TDA4VM, the linux version is 5.4.74, how can we configure to use KGDB.

       I try to modify file arch/arm64/configs/tisdk_j7-evm_defconfig like this:

+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_VM=y

+CONFIG_KGDB=y
+CONFIG_KGDB_KDB=y
+CONFIG_KDB_KEYBOARD=y

     and modify arch/arm64/boot/dts/ti/k3-j721e-common-proc-board.dts file like this:

    chosen {
        stdout-path = "serial2:115200n8";
        bootargs = "console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 kgdboc=ttyS0,115200 kgdbwait";
    };

     and make,make install, but the linux can't stop waitting for device to connect with ttyS0, but start normal as usual.

     How can I use the KGDB to debug my TDA4VM board?

Regards,

Jason

  • Hi Jason,

    kgdboc=ttyS0,115200 kgdbwait

    Any particular reason why you use ttyS0. The default Linux logs are coming on ttyS2.

    Can you ttyS2?

    Best Regards,
    Keerthy

  • Hi Keerthy J,

            Thanks for you reply, you mean we need to modify arch/arm64/boot/dts/ti/k3-j721e-common-proc-board.dts file like this:

        chosen {
            stdout-path = "serial2:115200n8";
            bootargs = "console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 kgdboc=ttyS2,115200 kgdbwait";
        };

    Regards,

    Jason

  • Yes. That is correct.

  • Hi Keerthy J,

          I am sorry, it seems unuseful for kgdboc=ttyS2,115200 kgdbwait, the kernel still start normal as usual, it can't stop wait for device to connect with ttys2, something miss?

    Regards,

    Jason

  • Hi Keerthy J,

           Where is the manual to use kgdb debugging, I can't found it in useguide.

    Regards,

    Jason

  • Hi Jason,

    That is correct we do not have KGDB on our SDK. So something you will have to debug & test on your side.
    Enabling it should not have any dependency on the hardware. So you could probably reach out to linux mailing lists.

    Best Regards,
    Keerthy

  • Hi Keerthy J,

           I found we can use ccs to debug the kernel, but our kernel version was 5.4.74, we can't find related configuration which mentioned by "Stop Mode Debug" as follow when we do "make menuconfig":     

     
    Kernel hacking —> Enable stack unwinding support

    General Setup —> Prompt for development and/or incomplete code/drivers

    Kernel Hacking —> Enable JTAG clock for debugger connectivity
    Kernel Features —> Use the ARM EABI to compile the kernel

    Kernel hacking —> Kernel Debugging

    and finally, when we start Stop Mode Debug, to debug the mmc init when the kernel start,we specially modified the function "mmc_attach_mmc" to break the point(as follow shown), which is in the file driver/mmc/core/mmc.c line 2198, but it can't be stop when the kernel is running.

    the kernel only stop at here:

    I don't know why the kernel keeps stopping here, not the breakpoint we set in the function "mmc_attach_mmc"  line 2241, but the console is still output the debug info like this:

    so we are sure the kernel is running here, but it can't be stop even we set the breakpoint.

    our configuration about CCS is shown as follow:

    All these configurations are based on the requirements of the mode "Stop Mode Debug" .But we still can't stop the kernel where we want to debug the mmc init. How can we do?

    Regards,

    Jason

  • Hi Jason,

    Is the intent here to debug the kernel boot failure? If yes can you share the boot logs?
    KGDB is never supported on the J721e SDK.

    What is the board you have? Custom board or standard TI EVM?

    - Keerthy