|
Everyone who is working with AVR microcontrollers knows this powerful tool – WinAVR which is completely open source and does the job comparable to commercial. It already has many routine tasks included in package that you don't need to worry about. So when shifting to ARM7 microcontrollers it is logical to try WinARM as nice alternative to WinAVR. WinARM tools are collected by Martin Thomas and put in one distribution package ready to use under Windows platform. But in fact these tools are very different despite there is same GCC compiler used. First of all WinAVR is targeted to one manufacturer(ATMEL) AVR microcontrollers. One core allows to robust many routine tasks as RAM, ROM defining. WinARM targets various manufacturers who produce microcontrollers with ARM core which may vary in type.
The arm-gcc toolchain is also very different from avr-gcc because of different MCU core architecture, memory organisation. For example cede can be executed form ROM and RAM memory. These all flexibilities of course implies in complexity in tools. I think trickiest part of preparing project is initializing MCU. Defining has to be done before main program flow. In WinARM you have to do this by yourself – by writing startup program which initializes interrupt vectors, stacks, copies program/data from flash to RAM. During initialization you may do all necessary MCU preparation that maybe needed tobe done before main() routine. In WinARM this initialization file usually is called crt0.S. Following task would be writing liker scripts which defines for the linker memory layout. They describe accurate description of memory blocks. These linker scripts usually are called something like RAM.ld or ROM.ld. Usage of one of those files depends on where code is going to be executed. If from Flash memory, then linker will use ROM.ld. And last part of it is to put all in one piece in makefile. crt0.S is included as assembly source file along with C files. Linker script will be run during linking object files in order to prepare loadable image that fits in MCU memory. This may sound little scary but don't wary. For most of MCUs you may take necessary files from earlier examples that are provided withing package use them or modify. Also you can take and modify makefile and focus only in main C program writing. In WinAVR these things are done automatically as I mentioned tool is narrowed to one type of MCU that makes it easy to robust initialization. But if you need to make additional initializations before main program flow, you need to write your own startup code. I think it is good to understand how things work before you make it work. Sources: http://www.embeddedrelated.com, http://tech.groups.yahoo.com/group/lpc2000
Related Items:
|