
Technical discussions about the TI C6000 DSPs (including the c62x, c64x and c67x DSPs).
|
I fail at using the standard c io functions (printf etc.) the debugging tool (code composer or TI debugger tried them both) simply hangs when reaching the printf function tried a simple print to stdio program and it simply failed already went through what the manual (optimizing c compiler) but came up empty handed here is the most simple prog I came up with : include <stdio.h> void main(void) { printf("hello/n"); while(1); } any ideas ? thanx in advance Eran Knaz |
|
|
|
Eran, I asked the same question to TI and here is what they answered: There are two most obvious causes of this problem, but rest assured that Code Composer with the EVM does support C I/O. The first cause is in linking. The C compiler creates sections that you may not have allocated specifically in the linker command file. If so, these sections that are needed for C I/O may be placed into memory that is not conducive to data, such as internal program ram. Use the -m option in the linker to create a map file. In the map file, look at the section allocation to see if there are any sections that you did not explicitly take care of in the linker command file. If so, go back and allocate them in the linker command file. Remember, only code sections (.text as created by the compiler, you may have others if you write in assembly or use the #pragma) can go into internal program ram. The second thing is the size of the heap. If you use the default size (about 1K), it may not be large enough. There is a third thing, but you probably have taken care of this. If you do not #include <stdio.h>, the code will build okay, but the printf will not work. I hope this help Stephane Boucher ______________________________________________ Eran Knaz wrote: I fail at using the standard c io functions (printf etc.) the debugging too= l (code composer or TI debugger tried them both) simply hangs when reaching = the printf function tried a simple print to stdio program and it simply fail= ed already went through what the manual (optimizing c compiler) but came up = empty handed here is the most simple prog I came up with : include <stdio.h void main(void) { printf("hello/n"); while(1); } any ideas ? thanx in advance Eran Knaz |
|
|
|
> here is the most simple prog I came up with : > > include <stdio.h> > > void main(void) > { > printf("hello/n"); > while(1); > } To Eran Knaz Hi I am a new mwmber of the group. Maybe my e-mail id is a give-away. I work at TI. I certainly dont have answers to all your questions. But to this one I do. I was bitten by the same bug. First of all you need a .cmd file that the linker uses and you need to set adequate heap and stack space. Remember that C i/O relies heavily on heap as malloc in rts6201.lib uses this to dynamically allocate memory. From the cmd file provided along with tools use memory map 1 for the simulator and EVM on the PC. Also under code composer, go to options and use Linkeroptions to ROM Autoinitialization model. This runs the autoinit routine before you get to main. This will set the linker flag to -c Hopefully this should fix your problem Regards Jagadeesh Sankaran |