PRELIMINARY
by Martin Thomas, Kaiserslautern, Germany <mthomas(at)rhrk(dot)uni-kl(dot>de> http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects
This text has been made because I have got some questions from people who want do create code with the GNU-Toolchain (gcc et al) but also want to participate in the Stellaris-Contest 2006. The contest-rules demand that the project's code must compile/link with the RealView tools.
Don't get me wrong: the Keil debugger and simulator are useful tools and I have used them sometimes during a "first contact" with a new device. The RealView compiler is known to be rather good. But for hobbyists and even for some (most?) "Part-time professionals" the full license is simply too expensive.
I do not use the RealView-Tools and do not know much about Keil's MDK-ARM, so take the following for what it's worth.
The described method has been tested with the evaluation- version of MDK-ARM 3.03beta as on the LMI Stellaris CD 1.01. (I have had the opportunity to use a licensed version too, but only for a few days.)
(If I find time to create a contest-project I will use this method too.)
At first I've tried to find out about the limitations of the evaluation-version. From the uVision online-help:
The Evaluation Version Restrictions are:
Restriction 1 is rather obvious and the most important one. O.K. Keil/ARM wants to earn money with the product. With 16kB a lot can be done but for a larger project esp. when using arrays for fonts or bitmaps the ROM-Image can easily extend 16kB even if the size of the program- code is rather small.
Because of restriction 2 one can not simply replace the linker-script by a scatter-file. (This has been my initial plan.)
I suppose the restrictions 3 and 4 are just there to ensure that no one can use "tricks" to circumvent restriction 1.
I do not understand restriction 5. If one wants to evaluate the quality of a toolchain and can not look into the listings to see how well (or bad) the compiler works an evaluation-version misses it's purpose ... off topic here.
The reason for restriction 6 is obvious. And the reason why I use the GNU-Toolchain even for projects which would "fit" into 16kB. (Yes, sometimes I can sell software and designs or work on contract-basis. The web-pages do not show everything I have done...)
I will show the needed steps by the "interrupts"-example. O.k., I know the Keil MDK already includes a version of this example for the RV-toolchain and the example fits into 16kB too - But hey, it's just an example: You should get the idea how to convert your own project from this.
Starting point is my GNU-port of the interrupts-example which consists of the following files:
In addition the projects uses the Stellaris Driver-Library compiled with the gcc (Codesourcery-release 2006-q1).
Keil uVision is an IDE so the Makefile will be replaced by project-settings. startup_gcc.c will be replaced by Startup.s and the linker-settings are also done in the IDE.
;******************************************************************************
; The vector table.
;******************************************************************************
Vectors
DCD StackMem + Stack ; Top of Stack
DCD Reset_Handler ; Reset Handler
[...]
DCD IntDefaultHandler ; SysTick Handler
DCD IntDefaultHandler ; GPIO Port A
DCD IntDefaultHandler ; GPIO Port B
DCD IntDefaultHandler ; GPIO Port C
DCD IntDefaultHandler ; GPIO Port D
DCD IntDefaultHandler ; GPIO Port E
DCD IntDefaultHandler ; UART0
[...]
to:
;******************************************************************************
; The vector table.
;******************************************************************************
EXTERN IntGPIOa
EXTERN IntGPIOb
EXTERN IntGPIOc
; more EXTERNs here if needed, remind the spaces before EXTERN
Vectors
DCD StackMem + Stack ; Top of Stack
DCD Reset_Handler ; Reset Handler
[...]
DCD IntDefaultHandler ; SysTick Handler
DCD IntGPIOa ; GPIO Port A ; project-specific handler
DCD IntGPIOb ; GPIO Port B ; project-specific handler
DCD IntGPIOc ; GPIO Port C ; project-specific handler
DCD IntDefaultHandler ; GPIO Port D
DCD IntDefaultHandler ; GPIO Port E
DCD IntDefaultHandler ; UART0
[...]
Futher information can be found from the examples included in the MDK-ARM (C:\Keil\ARM\RV30\Boards\...).
That's it for now. Feedback welcome.
To my ARMv7/Cortex M3-Projects page
Last mod.: