Enable KGDB over console in VIM3 with android

Which Khadas SBC do you use?

VIM3

Which system do you use? Android, Ubuntu, OOWOW or others?

`Android 9

Which version of system do you use? Khadas official images, self built images, or others?

self built images from khadas github. (khadas-vim3-p64)

Please describe your issue below:

I am trying to enable KGDB in my VIM3. I have done the following steps.

  1. I tried to enable KGDB in the kernel config and compiled the kernel
  2. Connected serial connection (17,18,19 PIN)

After flashing, then I checked kgdboc and it failed
it says “no polling driver” (as my logs I added in the kgdboc.c)

So I tried to pick this patch to add polling support to the amlogic uart [PATCH v3] tty: serial: meson_uart: Add support for kernel debugger - Julien Masson

Again same error.

Then I came to know there is one more extra uart port (uart3 , 14,15,16 PIN) in VIM3
I tried to enable it in the kvim3.dts.

&uart_C {
        status = "okay";
 };

I compiled and flashed the kernel.
but somehow it’s not enabled. I checked by
ls /dev/ttyS*

ttyS0 ttyS1 only available. so it’s not enabled.

Please tell what I am missing to enable KGDB in VIM3 android

@goenjoy @xiong.zhang Please check if possible. Thanks

Hello, I am verifying that uart_C is added on VIM3

1 Like

Hello, you can add it according to the code below, /dev/ttyS3 can appear normally

xiong@server:/users/xiong/work/amlogic/vim3/vim3_64bit/common$ git show 
commit 20cb5e4d80125250f91151bdd5de2e1808a32e4f (HEAD -> khadas-vim3-p-64bit)
Author: Xiong Zhang <xiong.zhang@wesion.com>
Date:   2023-07-20 09:25:32 +0800

    VIM3:dts:enable uart_C
    
    Signed-off-by: Xiong Zhang <xiong.zhang@wesion.com>

diff --git a/arch/arm64/boot/dts/amlogic/kvim3.dts b/arch/arm64/boot/dts/amlogic/kvim3.dts
index dfd90492f54d..7712b8ef942d 100755
--- a/arch/arm64/boot/dts/amlogic/kvim3.dts
+++ b/arch/arm64/boot/dts/amlogic/kvim3.dts
@@ -1496,6 +1496,10 @@
        status = "okay";
 };
 
+&uart_C {
+    status = "okay";
+};
+
 &pcie_A {
        reset-gpio = <&gpio GPIOA_8 GPIO_ACTIVE_HIGH>;
        status = "disable";

image

1 Like

Yeah I didn’t notice VIM3 has separate dt partition. Works
.
Reason for my KGDB not working: because cmdline option of kgdboc is not worked.
have to manually set parameters in runtime (/sys/module/kgdboc/parameteres/kgdboc)

echo "ttyS0,115200" > /sys/module/kgdboc/parameters/kgdboc

I think I can set them via uboot params as well.

1 Like