I'm a starter of CCS, and trying to write some simple programs. In following samples: kdebug.c void printdebug() { printf("Test debug!"); } main.c #include "kdebug.h" main() { printdebug(); } After building and run, when main() call printdebug() in kdebug.c, the error Can't Run Target CPU: Error number -2164 Error address 0 occurs. But if I wrote the printf in main(), it can print out the message. Can anyone tell me what's the problem? (Use ARM7TDMI-TMS470RXX Simulator in CCS)
Question of TI Code Composer Studio
Started by ●November 16, 2003
Reply by ●November 18, 20032003-11-18
Reply by ●November 19, 20032003-11-19
hello ... Your kdebug is a .c (kdebug.c) file. You are going to include it as a .h ("#include "kdebug.h") ??? I think the cross reference is wrong. I think the complier cannot find it also (in normal situation) ... If the complier did not give error, I think there might be some other libraries using the same name. Regards Hang Sun Tswen-chung Yang <tcyang@csie.nctu.edu.tw> wrote in message news:<bp9gl9$1b2e$1@netnews2.csie.nctu.edu.tw>...> I'm a starter of CCS, and trying to write some > simple programs. In following samples: > > kdebug.c > > void printdebug() > { > printf("Test debug!"); > } > > > > main.c > > #include "kdebug.h" > > main() > { > printdebug(); > } > > > After building and run, when main() call printdebug() > in kdebug.c, the error > > Can't Run Target CPU: Error number -2164 Error address 0 > > occurs. But if I wrote the printf in main(), it can > print out the message. Can anyone tell me what's the > problem? > > (Use ARM7TDMI-TMS470RXX Simulator in CCS)
Reply by ●November 19, 20032003-11-19
Make sure you write your linker command file properly. You can find a sample for arm in your CCS installation. Avoid using printf... instead, use a global variable and set its value to something. You can check the value in the watch window. "Tswen-chung Yang" <tcyang@csie.nctu.edu.tw> wrote in message news:bp9gl9$1b2e$1@netnews2.csie.nctu.edu.tw...> I'm a starter of CCS, and trying to write some > simple programs. In following samples: > > kdebug.c > > void printdebug() > { > printf("Test debug!"); > } > > > > main.c > > #include "kdebug.h" > > main() > { > printdebug(); > } > > > After building and run, when main() call printdebug() > in kdebug.c, the error > > Can't Run Target CPU: Error number -2164 Error address 0 > > occurs. But if I wrote the printf in main(), it can > print out the message. Can anyone tell me what's the > problem? > > (Use ARM7TDMI-TMS470RXX Simulator in CCS) > >