ARM: Application Builds Without Error, But Does Not Run
Information in this knowledgebase article applies to:
I have built my application with the ARMCC toolchain and the standard runtime library. I can load the application, and set breakpoints. When I try to run it on my target, it does not work. It seems that the program does not even reach the main() function. The build process gave no error message or warning, that could explain this behavior.
Among many other possible individual reasons for this behavior, there are some common reasons that could explain this. They are:
This article briefly describes ways to resolve the issue's common causes so the code can execute. For more information on semihosting, please consult the runtime library guide.
The standard runtime library links in certain low-level debugging routines, i.e. semihosting functions. Legacy ARM emulators supported semihosting by responding to the SWIs and BKPTs events. For the non-debug (released) version of the application, a programmer would retarget these semihosting functions to non-semihosting equivalents. The Keil debugger does not support semihosting - so these functions must be retargeted with a file.
RESOLUTION FOR HEAP ISSUE
Configure more heap in the startup file so the project will not fault before main(). Heap size is application dependent. Try allocating too much heap, and experiment with shrinking the size down. The functions __heapstats and __heapvalid may help in troubleshooting heap issues.
RESOLUTION FOR SEMIHOSTING ISSUE
To remove low-level debugging functions, do one of the following: use the 'Compiler' Software Pack, Turn on Microlib, or add a retarget.c file.
RESOLUTION FOR RESET ISSUE
If a hardware reset is required, then connect the RESET line from a standard interface to the reset pin of the device. Review the schematics of a similar evaluation board to verify the design.
MORE INFORMATION ON HEAP
MORE INFORMATION ON SEMIHOSTING
Request the files attached to this knowledgebase article.
The following Discussion Forum threads may provide information related to this topic.
Last Reviewed: Wednesday, April 11, 2018
of your data.