|
|||||||||||
|
Technical Support Support Resources
Product Information |
Technical SupportCARM: CONVERTING PROGRAMS FROM GNUInformation in this article applies to:
QUESTIONI have written an ARM program using GNU GCC, but now I need the advanced features of the Keil CARM compiler. What steps need to be done to convert a GNU GCC program to the Keil CARM Compiler? ANSWERConverting a program from GNU GCC to the Keil CARM Compiler is straight-forward. Just follow these steps: Toolset ConfigurationThe tool configuration is changed for the Keil CARM Compiler within the µVision IDE by the following steps:
STARTUP.S and Other Assembler Source FilesThe assembler syntax of the GNU assembler is different. Therefore we recommend to replace the GNU specific STARTUP.S file with a pre-configured STARTUP.S file for the Keil CARM toolchain that can be found in the folder Keil\ARM\STARTUP. Make the required configurations for hardware and stack sizes. Other assembler source files of your project need syntax adaptions. For more information refer to the AARM User's Guide. C Run-Time Library ConfigurationThe Keil CARM Compiler is designed for embedded applications. The syscalls.c (system calls remapping) file is not required and should be deleted from your project. If malloc library functions are used, the memory space needs to be initialized with the init_mempool function. The Keil CARM printf does not delay character output. GNU GCC functions like fflush (stdout) are no longer required and can be removed. C Source Code ChangesThe Keil CARM compiler uses a different syntax for language extensions. You may just compile all C source files which creates syntax errors on the relevant statements. For example, interrupt functions are defined in Keil CARM with __irq whereas GNU uses the following syntax:
void timer_irq (void) __attribute__ ((interrupt));
void timer_irq (void) {
:
}
For Keil CARM just change the source code to:
void timer_irq (void) __irq {
:
}
MORE INFORMATION
SEE ALSO
FORUM THREADSThe following Discussion Forum threads may provide information related to this topic. Last Reviewed: Sunday, October 29, 2006 | ||||||||||
|
|||||||||||