TI E2E Community
Strange problem in programming ARM under Linux
I am using DM3730 SDK in Linux.
In a single C file, the main function is at the bottom of the file.
Above the main function, there are many C functions called by the main function.
In every C function, there is a printf to show which function is being called.
There is no compilation error for the ARM program.
But when I run the program in Linux prompt, the printfs show only the first few functions are being called.
What could be the problem ?
could it be the problem of stack size or heap size ?
How to change the stack size or heap size in a Linux makefile ?
The usual approach is to insert more printfs to determine which is the last function that successfully returned from being called.
Then to insert printfs inside the next function, to determine again which point in the function is successful, and at which point things seem to stop working.
Incidentally, to ensure that your printfs do not just add their text to an output buffer, you should make sure that each one ends with a "\n" end-of-line - this should make sure the buffer is output to the console before the 'crash' or whatever the problem is.
Mike had a good point: don't forget the \n.
For the long run, it's worth installing gdb on your target platform, I found it extremely useful.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.