Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


LPC488(Cortext MR) FreeRTOS Port Under Crossworks for ARM

Posted by paulromero on April 6, 2015

Hi Folks:

I suceeded in creating a functional, but incomplete, FreeRTOS port for the LPC4088 in the Crossworks for ARM environment, which was tested on the Embedded Artists LPC4088-32 Developer's Kit board.

Most of the incomplete aspects are related to Crossworks system components. The details follow. Please let me know if you see something which is wrong, can be automated, or done in a better way. (i.e. Look for TBD for comments on the incomplete aspects.)

Best Regards,

Paul R.


Embedded Artists LPC4088-32 Developer's Kit (Eval. Board.)

Major Component Versions

FreeRTOS: V8.01 Crossworks for ARM: V3.2 LPC Open Library: V2.10 (Xpresso version)

Prerequisite Crossworks Packages

The following are important Crossworks packages and should be downloaded. Note that this list is not definitive or necessarily complete.

  • Crossworks: ARM CPU Support Package, CMSIS 3 Support Package, Tasking Library Package, FreeRTOS Library Package.
  • Embedded Artists: LPC4088 OEM Board Support Package.
  • NXP: LPC1000 CPU Support Package, NXP4300 CPU Support Package.
  • STM: STM32 CPU Support Package, STM32 Discovery Board Support Package.

TBD: Currently, it appears Rowley does not recommend or require a Cortex M4 specific or floating point support package. The STM packages should be replaced by equivalent NXP packages--but such packages with the requisite FreeRTOS components may not be currently available. It is believed the LPC1000 CPU package contains the correct LPC4088 components.

Crossworks Project Properties Configuration

Use the Crossworks GUI to create a project a starting point by selecting "File->New Project->Executable for LPC OEM EA". Be sure to select a sensible project name and project directory. (i.e. For example, $(HomeFreeRTOS)/FreeRTOSLPC4088)

The following project attributes must be configured as follows:

  • Preprocessor Definitions: CORE_M4
  • ARM FPU Type: FPv4-SP-D16
  • ARM FP ABI Type: Softfp or Hard.
Suggested Overall Code Organization
           $(Home_FreeRTOS_LPC4088)          $(HomeCrossworks)
               |               |                    |
             FreeRTOS       LPC_Open             Packages
FreeRTOS Source Code Organization

The overall FreeRTOS directory structure will be something like this. (i.e. The names used are generally suggestions.)

                            |        |
                         Example  Source
                                  |    |
                             include  portable
                                |         |
                               GCC     MemMang

Obtain the FreeRTOS V8.01 source code from the FreeRTOS website or download it from Crossworks and put it in the "Source" subdirectory. The organization of the FreeRTOS code should already be the same or very close to directory structure shown above.

TBD: It is believed that threads_CMF4.js script is needed under Crossworks and not supplied with the generic FreeRTOS source code. Rowley must be consulted to determine the origin of the file and how to install it.

Put the attached versions of main.c and main_blinky.c in the "Example" subdirectory. They are slightly modified versions of the source code from the generic FreeRTOS V8.01 and NXP LPC Open V2.10 blinky example for the LPC4088.

In the Crossworks GUI and project, the "Example" directory is labeled as "Source Files" by default. Make sure it exists and is pointing at "Example" and includes main.c and main_blinky.c.

Add a "Source" directory to the project with the Crossworks GUI. You should do this recursively.

Rowley Source Code Organization

The overall directory structure of the Crossworks system software is as follows. (i.e. These are the currently available generic Crossworks components and should automatically be installed under the project "System Files" subdirectory in the Crossworks GUI.)

   |                  |                  |                  |
CMSIS_3           EA_LPC4088_OEM        LPC1000             STM32
                     |                  |
                   _____            _________
                  |     |          |         |
                 inc   src      include   LPC407x_8x

The following items should be put in EALPC4088OEM. (i.e. There is a directory named "Systems Files/lpc4088 open bsp" directory in the Crossworks project GUI. Verify that it points at EALPC4088OEM.)

  • FreeRTOSConfig.h
  • FreeRTOS_board.c

Also, confirm the following definitions in FreeRTOSConfig.h.

define configMINIMALSTACKSIZE ( ( unsigned short ) 256 )
define configTOTALHEAPSIZE ( ( size_t ) ( 10 * 1024 ) )

For timer functionality, add the following definitions.

// // This must be done to enable timers. // The timer task should be highest or close to the highest // priority task. The queue size may need to be configured. //

define configUSE_TIMERS 1
define configTIMERQUEUELENGTH 10

TBD: These files are very close to the versions in the STM32F4DISCOVERY subdirectory supplied by Rowley. It is't believed currently Rowley has LPC4088 specific versions of these files. It is likely the generic FreeRTOS release has almost identical versions for LPC17xx family member or an actual LPC4088 version.

Note that following files under LPC1000 are particularly important.

LPC1000: LPC4078* and LPC407x8x* LPC1000/include: LPC4088.h LPC1000/include/CMSIS: system407x8x177x8x.* and LPC407x8x177x8x.*

TBD: The LPC1000 and LPC100/CMSIS directories contain as least partially compatible LPC4088 system files. It is believed that they are completely compatible with some LPC17xx family member. It isn't known if this is the final or official Rowley solution for LPC4088 functionality.

TBD: STM32 contains the memory map and interrupt vector definition files. As an interim measure, the STM32F4 versions for the STMF4DISCOVERY board are being used as they are almost identical to how they are used for for the Cortex M4 on the LPC4088 board. However, there is probably another more appropriate Rowley directory.

NXP LPC Open Source Code Organization

The overall directory structure of the LPC Open Library is as follows.

                         |                      |
              lpc_board_ea_devkit_4088     lpc_chip_40xx
                  |              |           |    |    |
                 inc            src         inc  libs  src

The entire lpcboardeadevkit4088 and lpcchip40xx subdirectories should be put under $(HomeLPCOpen).

In the file lpcchip40xx/src/chip17xx40xx.c the variable declaration for SystemCoreClock and the routine SystemCoreClockUpdate() must be commented out as they are supplied by the generic Crossworks system files.

Crossworks Configuration

The following paths need to be included in the Crosworks GUI project "User Include Directories".

$(TargetsDir)/LPC1000/include/CMSIS $(TargetsDir)/CMSIS3/CMSIS/Include $(TargetsDir)/LPC1000/include $(TargetsDir)/EALPC4088OEM $(ProjectDir)/FreeRTOS/Source/include $(ProjectDir)/FreeRTOS/Source/portable/GCC/ARMCM4F $(ProjectDir)/LPCOpen/lpcchip40xx/inc $(ProjectDir)/LPCOpen/lpcboardeadevkit4088/inc

TBD: Verify configuration of $(ProjectDir) with Rowley.

The following minimum sizes are recommended:

Heap Size: 8192 Main Stack Size: 512

LPC488(Cortext MR) FreeRTOS Port Under Crossworks for ARM

Posted by rtel on April 7, 2015

Hi - this is quite a long post - does it contain a question? If not, but it is instead posting a port, I would suggest posting to the FreeRTOS Interactive site instead: http://interactive.freertos.org



main.c (10066 bytes)
main_blinky.c (4141 bytes)

[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists