CMSIS2000
0.0.7
|
The problem description.
Today (2012) the modern MCU core is Cortex-M3 core. So there is many examples and libraries made for Cortex MCUs. Also NXP company has their LPC17xx series that is close to LPC23xx and 24xx series MCU. There are not so many differences in that microcontrollers. They have the same or close peripherals.
So this instructions is good in that two cases:
1. Get modified LPC17xx peripheral library sources CMSIS2000 project from http://sourceforge.net/projects/irtos/
2. Install cmake build system from cmake.org.
3. Copy CMAKE folder from CMSIS/Device/NXP/Drivers/Examples/Project_Template/CMAKE_CMSIS2000 with CMakeLists.txt file to main folder of you project.
4. Open CMakeLists.txt and add sources of your project to `exmpl_sources' list.
5. Create a project files by running cmake. (look *.bat files for example).
6. Modify your sources to some rules that described next.
The first you should know that THERE IS NOT 100 % compatibility with LPC1700 and LPC2000 MCU series. So there is a i_MCU_MODEL definition witch included automatically in LPC17xx.h file and mcu_id.h file .
DO NOT USE InterruptHandlers in manner of CMSIS!
It is a pity but LPC2000 interrupt routines must be marked with special keyword __attribute__((IRQ)) so there is a special macroses in CMSIS2000 project. You should write Interrupt code in this manner:
In case of MCU is LPC17xx the result of preprocessing the previous example will be:
In case of MCU is LPC2xxx the result of preprocessing the previous example will be: