ARM Cortex MX

From ErikaWiki

(Difference between revisions)
Jump to: navigation, search
(KEIL uVision and RT-Druid Eclipse)
(KEIL uVision and RT-Druid Eclipse)
Line 198: Line 198:
To Debug an application see "MDK-ARM Plugin for Eclipse" in Keil uVision Help.
To Debug an application see "MDK-ARM Plugin for Eclipse" in Keil uVision Help.
 +
 +
=== Stand-Alone libee.a building using RT-Druid Eclipse ===
 +
 +
* Launch Eclipse and define a workspace (default workspace can be accepted).
 +
[[File:Workspace_Launcher.png|center|thumb|650px|Eclipse Workspace Selection Dialog.]]
= See also =
= See also =

Revision as of 12:02, 1 February 2012

Contents

ARM Cortex MX support

ERIKA Enterprise supports ARM Cortex MX microcontrollers. The support for RT-Druid is now available.

The Cortex M0 support includes:

  1. support for IAR and Keil ARM Compilers;
  2. support for single and multi stack configurations;
  3. ISR Type 1 and Type 2 supported;
  4. support for IAR J-Link and Keil ULINK2 Debuggers.

The Cortex M4 support includes:

  1. support for Texas Instruments TMS470 and Keil ARM Compilers;
  2. support for single and multi stack configurations;
  3. ISR Type 1 and Type 2 supported;
  4. support for Texas Instruments Stellaris ICDI and Keil ULINK2 Debuggers.
  • Supported IDEs:
    • IAR Embedded Workbench. (Cortex M0)
    • Texas Instruments Code Composer Studio. (Cortex M4)
    • Keil uVision. (Cortex M0 and Cortex M4)
  • Mode of operation:
    • Mono-stack: The Monostack configuration of the ERIKA Kernel models the fact that all tasks and ISRs in the system share the same stack.
    • Multi-stack HAL: Every task can have its private stack, or it can share it with other tasks.

MCUs

  • The MCUs currently supported are the following:
    • NXP LPC12xx. (Cortex M0)
    • Texas Instruments Stellaris LM4F232xxxx. (Cortex M4)

Boards

  • The boards currently supported are the following:
    • NXP LPCXpresso LPC1227 demo board. (Cortex M0)
    • Texas Instruments Stellaris LM4F232H5QD evaluation board. (Cortex M4)
  • List of functions:
    • Currently the NXP LPCXpresso demo board (Cortex M0) is supported through the CMSIS library.
    • Currently the Texas Instruments Stellaris LM4F232H5QD (Cortex M4) evaluation board is supported through AUTOSAR Drivers.

Download and install

RT-Druid and Erika Enterprise RTOS (version 1.6.0), for Microsoft Windows, can be freely downloaded from the following web address:

Once downloaded, extract all the files contained in it and copy the folder named eclipse in your preferred directory on your PC (a recommended path is: C:\Evidence\). Now, launch the program by double-clicking on the executable eclipse.exeinside the C:\Evidence\eclipse folder and choose the path of your workspace. The workspace is the default working directory in which the projects will be created.

If you want to download only a selected revision of the kernel, open the Cygwin shell and get an anonymous SVN checkout typing this command:

 svn co svn://svn.tuxfamily.org/svnroot/erika/erikae/repos/ee/trunk/ee -r number_of_revision

Note: Cygwin can be downloaded from this web site: http://www.cygwin.com/ To use SVN, the Cygwin SVN package must to be installed using the Cygwin Setup utility.

The Cortex MX plug-in for Eclipse is part of the official distribution of RT-Druid.

Target Configuration and Programming

ERIKA is configured through RT-Druid and an OIL file

Compiler Path

It is possible to choose the path of the compiler in three different ways:

  • environment var:
    • IAR compiler: the IAR_CCDIR variable is able to override the path compiler set in RT-Druid during the build progress.
    • Texas Instruments TMS40 compiler: CCS_INSTALL_ROOT variable is able to override the path compiler set in RT-Druid during the build progress.
    • Keil ARM compiler: ARM_ROOT variable is able to override the path compiler set in RT-Druid during the build progress.
  • configuration file:
  • gui:
    • inside eclipse preferences, it is possible to set the path of IAR complier ONLY.

CPU

CPU_DATA must be set to CORTEX_MX.
The exact model is specified with the MODEL item (supported values are M0 for Cortex M0 and M4 for Cortex M4).
The compiler is specificed with the COMPILER_TYPE item (supported values are IAR and KEIL for M0 model and CCS and KEIL for M4).
Example of a CPU_DATA section:

 CPU_DATA = CORTEX_MX {
   MODEL = M4;
   APP_SRC = "code.c";
   COMPILER_TYPE = KEIL;
   MULTI_STACK = TRUE {
     IRQ_STACK = TRUE {
       SYS_SIZE=512;
     };
   };
 };

MCU

MCU_DATA must be set to LPCXPRESSO for NXP LPCXpresso LPC12xx or to STELLARIS for Texas Instruments Stellaris LM4F232xxxx.
The only item supported is MODEL, which can be either LPC12xx for LPCXPRESSO or LM4F232xxxx for STELLARIS.
Example of a MCU_DATA section:

 MCU_DATA = STELLARIS {
   MODEL = LM4F232xxxx;
 };

Interrupt Handling

Interrupts in ERIKA are handled in different manner between NXP LPC12xx MCU (Cortex M0) and Texas Instruments Stellaris LM4F232xxxx MCU (Cortex M4).

NXP LPC12xx MCU (Cortex M0)

NXP LPC12xx MCU is configured to have a fixed Interrupt Vector Table specified in pkg/mcu/nxp_lpcxpresso_lpc12xx/src/iar/startup_LPC12xx.s assembly file. Each entry has a fixed symbol that must be the parameter of ISR1() or ISR2() ISR signature.

This scheme of ISR handling can be changed by rewriting the startup_LPC12xx.s changing the Interrupt Vector Table.

Texas Instruments Stellaris LM4F232XXXX MCU (Cortex M4 )

Texas Instruments Stellaris LM4F232XXXX MCU (Cortex M4) is configured to have a flexible Interrupt Vector Table specified in pkg/mcu/ti_stellaris_lm4f232xxxx/src/ee_startup_keil.s for Keil/uVision compiler and in pkg/mcu/ti_stellaris_lm4f232xxxx/src/ee_vtable_ccs.c for Texas Instruments TMS470 compiler. Each entry is specified by the following macro:

 EE_<ARCH>_<ENTRY>_ISR

Where <ARCH> is the architecture depended identifier (E.g. CORTEX_MX), and <ENTRY> is the fixed Interrupt Vector Table Entry identifier (E.g. GPIO_A).

To define each ISR an ISR object is needed to be added in the CPU object of the OSEK/VDX configuration:

 ISR <SYMBOL> {
   CATEGORY = <ISR_TYPE>;
   ENTRY = "<ENTRY>";
 };

Where <ISR_TYPE> is the type of the ISR (1 or 2), <SYMBOL> is the symbol that must be the parameter of ISR<ISR_TYPE>() ISR signature, and <ENTRY> is the fixed Interrupt Vector Table Entry identifier.

Libraries

CMSIS OIL file configuration

To enable CMSIS Library with NPX LPCXpresso LPC1227 demo board, the following code is needed in the OS object of the OSEK/VDX configuration:

 EE_OPT = "__ADD_LIBS__";
 LIB = ENABLE {
   NAME = "CMSIS";
 };
 EE_OPT = "__USE_LPC12XX_CMSIS_V2__";

It's possible to include all library functions by EE_OPT attribute in the OS object of the OSEK/VDX configuration:

 EE_OPT = "__USE_CMSIS_ALL__";

It's possibile to include ONLY selected library modules functions by EE_OPT attributes in the OS object of the OSEK/VDX configuration:

 EE_OPT = "__USE_CMSIS_SYSCTRL__";
 EE_OPT = "__USE_CMSIS_GPIO__";
 EE_OPT = "__USE_CMSIS_IOCON__";
 ...

AUTOSAR Drivers

Texas Instruments Stellaris LM4F232H5QD evaluation board is supported through AUTOSAR Drivers. Documentation can be found at Stellaris AUTOSAR Drivers.

Examples

KEIL uVision and RT-Druid Eclipse

MDK-ARM Plug-in Configuration

KEIL uVision sopport an Eclipse plu-in called MDK-ARM Plug-in.
The MDK-ARM Plug-in components have the default installation path C:\Keil\Eclipse.
No additional software is required. However, the MDK-ARM Plug-in must be configured for the Eclipse environment.

  • Launch Eclipse and define a workspace (default workspace can be accepted).
Eclipse Workspace Selection Dialog.
  • Open the menu Help - Install New Software.
Eclipse New Software Installation.
  • Click Add...
Eclipse Software Repository Install Dialog.
  • Click Local...
Eclipse Local Software Repository Selection Dialog.
  • Select Disco locale (C:) -> Keil -> Eclipse and Click OK.
Eclipse Local Software Repository Folder Selection Dialog.
  • Fill "Name:" (Keil MDK-ARM) and Click OK.
Eclipse Local Software Repository Selection Dialog.
  • Enable "Keil MDK-ARM", Disable "Contact all update sites during install to find required software" and Click Next.
Eclipse Software Repository Install Dialog.
  • On the next screen, Click Finish.
Eclipse Software Installation Details Dialog.
  • And finally Click Restart Now.
Eclipse Software Installation Details Dialog.
  • On a successful installation, Eclipse displays a menu µVision and µVision icons in the toolbar.
Eclipse New Software Installation.

To Debug an application see "MDK-ARM Plugin for Eclipse" in Keil uVision Help.

Stand-Alone libee.a building using RT-Druid Eclipse

  • Launch Eclipse and define a workspace (default workspace can be accepted).
Eclipse Workspace Selection Dialog.

See also

Personal tools