Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Debugging 使用Jtag-[ARM9][AT91SAM9G25]-Amontec、openocd、gdb、eclipse调试Linux_Debugging_Linux Kernel_U Boot_Jtag_Openocd - Fatal编程技术网

Debugging 使用Jtag-[ARM9][AT91SAM9G25]-Amontec、openocd、gdb、eclipse调试Linux

Debugging 使用Jtag-[ARM9][AT91SAM9G25]-Amontec、openocd、gdb、eclipse调试Linux,debugging,linux-kernel,u-boot,jtag,openocd,Debugging,Linux Kernel,U Boot,Jtag,Openocd,我正在尝试使用此系统启动内核调试: Amontec JTAGkey2、openocd、gdb、eclipse 最后,我想调试内核和运行在中的应用程序。 我几乎没有问题,似乎我需要依次解决它们。 现在我有了CPU挂起/恢复、读/写RAM 缺少什么:单步执行、单步执行、C/C++级调试 我谨此陈辞: -连接JTAG,通电板,通过Uboot启动带有调试消息的uImage -启动openocd: # openocd -f /usr/share/openocd/scripts/interface/jtag

我正在尝试使用此系统启动内核调试: Amontec JTAGkey2、openocd、gdb、eclipse

最后,我想调试内核和运行在中的应用程序。 我几乎没有问题,似乎我需要依次解决它们。 现在我有了CPU挂起/恢复、读/写RAM 缺少什么:单步执行、单步执行、C/C++级调试

我谨此陈辞: -连接JTAG,通电板,通过Uboot启动带有调试消息的uImage -启动openocd:

# openocd -f /usr/share/openocd/scripts/interface/jtagkey2.cfg -f /usr/share/openocd/scripts/board/at91sam9g20-ek.cfg
输出:

jtag_nsrst_delay: 200
jtag_ntrst_delay: 200
RCLK - adaptive
     TapName            | Enabled |   IdCode      Expected    IrLen IrCap  IrMask Instr     
---|--------------------|---------|------------|------------|------|------|------|---------
 0 | at91sam9g20.cpu    |    Y    | 0x00000000 | 0x0792603f | 0x04 | 0x01 | 0x0f | 0x0f
Info : max TCK change to: 30000 kHz
Info : RCLK (adaptive clock speed)
Info : JTAG tap: at91sam9g20.cpu tap/device found: 0x0792603f (mfg: 0x01f, part: 0x7926, ver: 0x0)
Info : Embedded ICE version 6
问题从这里开始:

openocd:

Warn : acknowledgment received, but no packet pending
undefined debug reason 6 - target needs reset
Warn : target not halted
月食:

symbol-file /opt/Tixi_Repos/KiwiG6v2/buildroot-2011.05/package_tixi/linux-2.6.39/arch/arm/boot/compressed/vmlinux
target remote localhost:3333
start () at arch/arm/boot/compressed/head.S:108
108 kphex r5, 8 /* end of kernel */
JTAG似乎也在尝试将代码加载到0x0中,我认为这是不正确的:

更新1

在分析了ARM的一些在线教程之后:

eclipsereset和Halt命令并不完美。最好取消选中它们并写入命令窗口。还可以添加加载地址:

monitor halt
load arch/arm/boot/compressed/vmlinux 0x22000000
我不使用

monitor reset
我让Uboot启动并初始化RAM和其他外围设备。然后我通过进入外壳来阻止Uboot。然后我让eclipse将linux写入RAM,并启动它。这需要很长时间,但效果更好。内核在RPC初始化时启动和停止,而不返回控制台

  • 是否可以将内核加载到Uboot控制台内的RAM中,然后启动JTAG会话
  • [load…]和[monitor load…]命令之间的区别是什么
  • 为什么我需要加载/compressed/vmlinux而不是uImage
  • 在eclipse窗口中,我有两个加载字段:加载图像和加载符号。我禁用这两个选项,但只写加载arch/arm/boot/compressed/vmlinux 0x22000000。这可能是下一个问题的原因吗
更新2: 好啊谢谢你的提示

我取得了一些进展。你能给我一些建议吗,也许我还是做错了什么

现在我的内核在JTAG控制下运行,但我仍然无法在源代码级别进行调试

我的工作如下:

  • 接通电路板电源,进入uboot外壳
  • 启动openOCD会话
  • 在内核调用的bootm.c中设置Uboot断点:

    cleanup_before_linux ();
    theKernel (0, machid, bd->bi_boot_params);
    
  • 启动eclipse调试会话:

    • 监视器停止
    • 加载uboot-a而不偏移

      load u-boot-2010.06/u-boot 
      Loading section .text, size 0x349ec lma 0x26f00000
      
    • 启动uboot并让它运行

    • uboot在“内核”调用时停止
  • 我知道内核位于地址0x20008000上

  • 重新启动openOCD会话
  • 使用内核配置再次启动ecipse调试器:

    • 监视器停止
    • 在地址0x20008000上加载内核

      load arch/arm/boot/compressed/vmlinux 0x20008000
      Loading section .text, size 0x8bdc7c lma 0x20008000
      
    • 启动调试会话
  • 现在一切正常,内核也启动了,但我仍然无法在源代码级别进行调试

    “符号不可用” 内核的“调试”和“调试信息”处于启用状态

    vmlinux屏幕截图

    在这个文件中大约有50个函数符号,这对我来说似乎是一个开始


    您应该将您的“答案”作为原始问题的更新,并删除该“答案”。“是否有可能在Uboot控制台中将内核加载到RAM中”-是的,您必须让U-Boot(加载内核并)启动内核。IDE未正确设置内核执行,即内核命令行和ATAG。引导ARM Linux内核的要求如下: