How to debug a C program using SDK on xilinx?

∥☆過路亽.° 提交于 2019-12-13 04:13:32

问题


I'm using an Atlys spartan 6 xc6slx45,I have to debug this code :

1-#include "stdio.h"
2-int main (void)
3-{
4-// Initialization of the necessary variables
5-int i,j,k;
6-// Initialization of source A and B 4x4 matrices and result C matrix
7-int a[4][4]={ {1,2,3,4},
8-{1,2,3,4},
9-{1,2,3,4},
10-{1,2,3,4}};

11-int b[8][8]={ {1,2,3,4},
12-{1,2,3,4},
13-{1,2,3,4},
14-{1,2,3,4}};

15-int c[8][8]={ {0,0,0,0},
16-{0,0,0,0},
17-{0,0,0,0},
18-{0,0,0,0}};

19-xil_printf("‐‐ Entering main() ‐‐\r\n");
20-for (i=0; i<4; i++ )
21-{
22-for (j=0; j<4; j++)
23-{
24-for(k=0; k<4; k++)
25-{
26-c[i][j]=c[i][j]+a[i][k]*b[k][j];
27-}
28-}
29-}
30-for (i=0; i<4; i++ )
31-{
32-for (j=0; j<4; j++)
33-{
34-xil_printf("%d ",c[i][j]);
35-}
36-xil_printf("\n\r");
37-}
38-return 0;
39-}

I add a toggle to the 5,7,11,15,26. I went to Run-->Debug Configurations --> Xilinx C/C++ application(GDB) ---> Build configurations:Debug then I pressed Debug button. I got this error :

No source available for "_start()".
Target failed:Target is not responding(timeout).

回答1:


Unfortunately this is one of those truly annoying SDK bugs that has been around for a long time, if you read the document here: SDK Limitations FAQ

You will find a section that describes one of the limitations of the SDK:

Xilinx C/C++ Debugger (GDB) debugger hangs when the Disassembly view is open.

Close all your disassembly windows and try again.

One other thing that can cause problem is that you have too many breakpoints, try to remove them and reset the CPU before starting a new debug session.

Hope it helps!



来源:https://stackoverflow.com/questions/29727078/how-to-debug-a-c-program-using-sdk-on-xilinx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!