ARM Cortex MX

From ErikaWiki

(Difference between revisions)
Jump to: navigation, search
(Texas Instruments Stellaris LM4F232XXXX MCU (Cortex M4))
(Texas Instruments Stellaris LM4F232XXXX MCU (Cortex M4))
Line 89: Line 89:
   EE_<ARCH>_<ENTRY>_ISR
   EE_<ARCH>_<ENTRY>_ISR
-
Where <code><ARCH></code> is the architecture depended identifier (E.g. <code>CORTEX_MX</code>) and <code><ENTRY></code> is the fixed Interrupt Vector Table Entry identifier (E.g. <code>GPIO_A</code>).
+
Where <code><ARCH></code> is the architecture depended identifier (E.g. <code>CORTEX_MX</code>), and <code><ENTRY></code> is the fixed Interrupt Vector Table Entry identifier (E.g. <code>GPIO_A</code>).
To define each ISR an <code>ISR</code> object is needed to be added in the <code>CPU</code> object of the OSEK/VDX configuration:
To define each ISR an <code>ISR</code> object is needed to be added in the <code>CPU</code> object of the OSEK/VDX configuration:
Line 98: Line 98:
   };
   };
-
Where <code><SYMBOL></code> is the symbol that must be the parameter of <code>ISR<ISR_TYPE>()</code> ISR signature and <code><ENTRY></code> is the fixed Interrupt Vector Table Entry identifier.
+
Where <code><SYMBOL></code> is the symbol that must be the parameter of <code>ISR<ISR_TYPE>()</code> ISR signature, and <code><ENTRY></code> is the fixed Interrupt Vector Table Entry identifier.
= Libraries =
= Libraries =

Revision as of 10:32, 27 January 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.

Choosing compiler

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:
    • command line versions of RT-Druid accept a configuration file, usually located at configuration/common_oil.pref.
      This file is in the java properties format (i.e. each line is composed by keyword=value).
      The keyword preference_cortex_m0__path_for_cc_compiler can be used to set the compiler path for Cortex MX.
  • gui:
    • inside eclipse preferences, it is possible to set the path of Cortex MX complier

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 Texs 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 <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

To enable AUTOSAR Drivers for Texas Instruments Stellaris LM4F232H5QD evaluation board and Keil ARM compiler, the following EE_OPT attribute is needed in the OS object of the OSEK/VDX configuration:

 EE_OPT = "__AUTOSAR_R4_0__";

AUTOSAR Drivers need to be configured by C header compiler file (Compiler_Cfg.h). These file (for now) needs to be manually written.
Template of these file can be found in contrib/as/arch/stellaris/config/.

The configuration C header compiler file inclusion is done by CFLAGS attribute in the OS object of the OSEK/VDX configuration:

 CFLAGS = "-I<PATH>";

Where <PATH> is the absolute or relative directory path which configuration C header compiler file is stored.

Note: Each AUTOSAR Driver must be enabled individually.

AUTOSAR MCU Driver

To enable AUTOSAR MCU Driver for Texas Instruments Stellaris LM4F232H5QD evaluation board and Keil ARM compiler, the following EE_OPT attribute is needed in the OS object of the OSEK/VDX configuration:

 EE_OPT = "__AS_MCU_DRIVER__";

The AUTOSAR MCU Driver needs to be configured by C header and source files (Mcu_Cfg.h and Mcu_Cfg.c). These files (for now) need to be manually written.
Templates of these files can be found in contrib/as/arch/stellaris/config/.

The configuration C header file inclusion is done by CFLAGS attribute in the OS object of the OSEK/VDX configuration:

 CFLAGS = "-I<PATH>";

Where <PATH> is the absolute or relative directory path which configuration C header file is stored.

Instead the configurations C source file is added to the compilation process by APP_SRC attribute in the CPU_DATA object of the OSEK/VDX configuration:

 APP_SRC = "<PATH>/Mcu_Cfg.c";

Where <PATH> is the absolute or relative directory path which configuration C source file is stored.

AUTOSAR PORT Driver

To enable AUTOSAR PORT Driver for Texas Instruments Stellaris LM4F232H5QD evaluation board and Keil ARM compiler, the following EE_OPT attribute is needed in the OS object of the OSEK/VDX configuration:

 EE_OPT = "__AS_PORT_DRIVER__";

The AUTOSAR PORT Driver needs to be configured by C header and source files (Port_Cfg.h and Port_Cfg.c). These files (for now) need to be manually written.
Templates of these files can be found in contrib/as/arch/stellaris/config/.

The configuration C header file inclusion is done by CFLAGS attribute in the OS object of the OSEK/VDX configuration:

 CFLAGS = "-I<PATH>";

Where <PATH> is the absolute or relative directory path which configuration C header file is stored.

Instead the configurations C source file is added to the compilation process by APP_SRC attribute in the CPU_DATA object of the OSEK/VDX configuration:

 APP_SRC = "<PATH>/Port_Cfg.c";

Where <PATH> is the absolute or relative directory path which configuration C source file is stored.

AUTOSAR DIO Driver

To enable AUTOSAR DIO Driver for Texas Instruments Stellaris LM4F232H5QD evaluation board and Keil ARM compiler, the following EE_OPT attribute is needed in the OS object of the OSEK/VDX configuration:

 EE_OPT = "__AS_DIO_DRIVER__";

The AUTOSAR DIO Driver needs to be configured by C header and source files (Dio_Cfg.h and Dio_Cfg.c). These files (for now) need to be manually written.
Templates of these files can be found in contrib/as/arch/stellaris/config/.

The configuration C header file inclusion is done by CFLAGS attribute in the OS object of the OSEK/VDX configuration:

 CFLAGS = "-I<PATH>";

Where <PATH> is the absolute or relative directory path which configuration C header file is stored.

Instead the configurations C source file is added to the compilation process by APP_SRC attribute in the CPU_DATA object of the OSEK/VDX configuration:

 APP_SRC = "<PATH>/Dio_Cfg.c";

Where <PATH> is the absolute or relative directory path which configuration C source file is stored.

Examples

KEIL uVision and RT-Druid Eclipse

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.

Plugin Configuration

  • 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.

See also

Personal tools