1、设置内核配置
CONFIG_KGDB=y, CONFIG_DEBUG_INFO = y, CONFIG_FRAME_POINTER=y,CONFIG_STRICT_KERNEL_RWX is not set 屏蔽掉该选型
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/554b62da61a1cae1f86dc3c941aa7527.png)
然后重新给板子烧录内核镜像
2、进入uboot,设置bootargs,添加kgdboc参数
setenv bootargs 'mem=512M console=ttyAMA0,115200n8 noinitrd ubi.mtd=4 root=ubi0:ubifs kgdboc=ttyAMA0,