NXP LPC1800 CPU Support Package
This package contains project templates and system files for the NXP LPC1800.
CrossWorks Version 3 Installation Instructions
- To install this support package
-
- Click the Tools > Package Manager menu option to open the package manager window.
- Right click on the NXP LPC1800 CPU Support Package entry and select Install Selected Packages.
- Click Next to take you to the summary page.
- Click Next to install the package.
- Click Finish to close the package manager window.
- Click the Tools > Show Installed Packages.
- Click on the NXP LPC1800 CPU Support Package link to view the package and its contents.
- To manually install this support package
-
- If you have not done so already, follow the CMSIS 3 Support Package and CrossWorks Tasking Library Package installation instructions.
- Download the file LPC1800.hzq using your web browser.
- Click the Tools > Manually Install Packages menu option.
- Select the file you have just downloaded to install the package.
- Click the Tools > Show Installed Packages.
- Click on the NXP LPC1800 CPU Support Package link to view the package and its contents.
- To install this support package using other versions
Release Notes
1.4
- Added ctl_sleep/ctl_woken/ctl_lowest_isr_priority/ctl_highest_isr_priority/ctl_adjust_isr_priority to LPC1800_ctl.c.
- Added test10.c to ctl tests.
- Rearranged System Control Space register groups in registers window.
- Added flash loader support for writing eeprom memory.
- Added SDRAM placement capability.
1.3
- New CTL projects now allocate a process stack. If you have an existing CTL project then you should do similar since this is required for the CTL supplied with CrossWorks for ARM version 2.3.1.
1.2
- Fixed IdentifyPart() script.
1.1
- Added support for LPC1853 and LPC1857 devices.
- Removed core CMSIS header files from this package. New projects will reference the include directory $(TargetsDir)/CMSIS_3/CMSIS/Include of the CMSIS-3 package. If you have an existing project then you will have to add $(TargetsDir)/CMSIS_3/CMSIS/Include to the User Include Directories project property.
- Renamed IRQHandler function names in the startup to match the latest user guide names:
- ETH_IRQHandler renamed to be ETHERNET_IRQHandler.
- RIT_IRQHandler renamed to be RITIMER_IRQHandler.
- UART0_IRQHandler renamed to be USART0_IRQHandler - same for 2 and 3.
- GPIO0_IRQHandler renamed to be PIN_INT0_IRQHandler - same for 1, 2, 3, 4, 5, 6 and 7.
- EVRT_IRQHandler renamed to be EVENTROUTER_IRQHandler.
- CAN1_IRQHandler renamed to be C_CAN1_IRQHandler.
- WDT_IRQHandler renamed to be WWDT_IRQHandler.
- CAN0_IRQHandler renamed to be C_CAN0_IRQHandler.
- The target script now identifies the device based on connect and enables the ETB.
- Provided sample project file for CMSIS-3 DSP Lib samples.
1.0
- Initial Release.
Documentation
Creating LPC1800 Projects
To create a new LPC1800 project
- Select the File > New > New Project menu item.
- Select the required Generic LPC1800 from the Project Type list.
- Select the LPC1800 Executable project template type from the Templates list.
- Set the required project name and location directory.
- Click OK .
To build, load and debug an application running in internal RAM
- Select the project to work on by using the Project | Set Active Project menu option.
- Select the RAM placement by clicking on the project node in the project explorer.
- Build the project by using the Build | Build Project menu option.
- Connect to the appropriate target in the target window.
- Download and start debugging the current project by using Debug | Start Debugging .
To build, load and debug an application running in internal Flash.
- Select the project to work on by using the Project | Set Active Project menu option.
- Select the Flash A placement by clicking on the project node in the project explorer.
- Build the project by using the Build | Build Project menu option.
- Connect to the appropriate target in the target window.
- Download and start debugging the current project by using Debug | Start Debugging .
To make the application startup from reset
- Right click on the project node in the project explorer and select Properties...
- In the properties window scroll down to the Preprocessor Options section.
- Type STARTUP_FROM_RESET into the Preprocessor Definitions property editor.
LPC1800 Project Specifics
CMSIS support
CMSIS header files are included as part of the new project setup.
- LPC18xx.h LPC18xx specific header file.
CTL support
The file LPC1800_ctl.c implements the CTL system timer using the SysTick timer. The timer is configured to interrupt at a 10 millisecond rate and increment the CTL system timer by 10 to give a millisecond timer. The implementation uses the CMSIS SystemFrequency global variable to determine the CPU clock frequency.
The file LPC1800_ctl_board.c provides the example board specific functions SystemInit together with CTL button and led support functions.
Memory Simulator
An memory simulator is provided that simulates the memories of the various LPC1800 devices. The memory simulation parameter specifies the device name and the sizes of the SPIFI and the 4 static memories as macro values that can be defined with the memory simulation parameter macros project property.
Project Templates
The following project templates are supplied.
- LPC1800 Executable - a project that is built for and loads and debugs on an LPC1800.
- LPC1800 Externally Built Executable - a project to load and debug an externally built program on an LPC1800.
- LPC1800 CTL Executable - a CrossWorks Tasking Library project that is built for and loads and debugs on an LPC1800.
Section Placement
CrossStudio for ARM supports LPC1800 projects running applications in a number of different memory configurations. You can select the memory configuration you require by right clicking on the project node in the project explorer and selecting the Placement entry.
For LPC1800 projects the set of placements are:
- EMC application runs in external memory.
- EMC Copy To RAM application boots from external memory into local SRAM.
- Flash A application runs in internal flash memory bank A.
- Flash A Copy to RAM application boots from internal flash memory bank A into local SRAM.
- Flash B application runs in internal flash memory bank B.
- Flash B Copy to RAM application boots from internal flash memory bank B into local SRAM.
- RAM application runs in local SRAM.
- SDRAM application runs in external SDRAM.
- SPIFI application runs in SPIFI memory.
- SPFI Copy To RAM application boots from SPIFI memory into local SRAM.
Stack and Heap Sizes
The stack and heap sizes are set to be 128 bytes by default when a project is created. It is likely that you will need to change these values.
Target Reset Script
The reset script LPC1800_Target.js is used by the debugger to reset the target board.
Target Startup Code
The startup code LPC1800_Startup.s is common to all LPC1800 processors. There are a set of preprocessor defines that configure the startup code and are documented in the startup file itself. The startup code calls out to a weak symbol SystemInit with the stack pointer set to the top of RAM. The SystemInit function can be used to set the CPU clock or configure any external memories prior to the C initialisation code as such it cannot access initialised static data.
LPC1800 Sample Projects
The following project files are supplied that can be used to run the standard CrossWorks shared samples.
- LPC1800 Shared Samples (click to load project)
- LPC1800 CTL Samples (click to load project)
- LPC1800 CMSIS-DSP Samples (click to load project)
The board specific file LPC1800_ctl_board.c is included in the samples that implements SystemInit() and the ctl board support functions to flash a led and handle a button press.