ARM Cortex MX

From ErikaWiki

(Difference between revisions)
Jump to: navigation, search
(KEIL uVision and RT-Druid Eclipse)
(Libraries)
 
(113 intermediate revisions not shown)
Line 5: Line 5:
The Cortex M0 support includes:  
The Cortex M0 support includes:  
-
# support for IAR and Keil ARM Compilers;
+
# support for [http://www.iar.com/ IAR] and [http://www.keil.com/ ARM KEIL] compiler toolchains;
# support for single and multi stack configurations;
# support for single and multi stack configurations;
# ISR Type 1 and Type 2 supported;
# ISR Type 1 and Type 2 supported;
-
# support for IAR J-Link and Keil ULINK2 Debuggers.
+
# support for [http://www.arm.com/community/partners/display_product/rw/ProductId/2653/ IAR J-Link] and [http://www.keil.com/ulink2/ ARM KEIL ULINK2] Debuggers.
The Cortex M4 support includes:
The Cortex M4 support includes:
-
# support for Texas Instruments TMS470 and Keil ARM Compilers;
+
# support for [http://www.ti.com/ Texas Instruments] and [http://www.keil.com/ ARM KEIL] compiler toolchains;
# support for single and multi stack configurations;
# support for single and multi stack configurations;
# ISR Type 1 and Type 2 supported;
# ISR Type 1 and Type 2 supported;
-
# support for Texas Instruments Stellaris ICDI and Keil ULINK2 Debuggers.
+
# support for [http://www.ti.com/tool/stellaris_icdi_drivers Texas Instruments Stellaris ICDI] and [http://www.keil.com/ulink2/ ARM KEIL ULINK2] Debuggers.
* Supported IDEs:
* Supported IDEs:
-
** IAR Embedded Workbench. (Cortex M0)
+
** [http://www.iar.com/en/Products/IAR-Embedded-Workbench/ IAR Embedded Workbench] (Cortex M0)
-
** Texas Instruments Code Composer Studio. (Cortex M4)
+
** [http://www.ti.com/tool/ccstudio Texas Instruments Code Composer Studio] (Cortex M4)
-
** Keil uVision. (Cortex M0 and Cortex M4)
+
** [http://www.keil.com/uvision/ ARM KEIL uVision] (Cortex M0 and Cortex M4)
* Mode of operation:
* 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.
+
** ''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.
+
** ''Multi-stack'': Every task can have its private stack, or it can share it with other tasks.
-
= MCUs =
+
=== MCUs ===
* The MCUs currently supported are the following:
* The MCUs currently supported are the following:
-
** NXP LPC12xx. (Cortex M0)
+
** [http://www.nxp.com/products/microcontrollers/cortex_m0/lpc1200/ NXP LPCXpresso LPC12xx] (Cortex M0)
-
** Texas Instruments Stellaris LM4F232xxxx. (Cortex M4)
+
** [http://www.ti.com/product/lm4f232h5qd Texas Instruments Stellaris LM4F232xxxx] (Cortex M4)
 +
** [http://www.st.com/internet/mcu/subclass/1521.jsp STMicroelectronics STM32F4xx] (Cortex M4)
-
= Boards =
+
=== Boards ===
* The boards currently supported are the following:
* The boards currently supported are the following:
-
** NXP LPCXpresso LPC1227 demo board. (Cortex M0)
+
** [http://www.nxp.com/demoboard/OM13008.html NXP LPCXpresso LPC1227 Demo Board] (Cortex M0)
-
** Texas Instruments Stellaris LM4F232H5QD evaluation board. (Cortex M4)
+
** [http://www.ti.com/tool/ek-lm4f232 Texas Instruments Stellaris LM4F232H5QD Evaluation Board] (Cortex M4)
 +
** [http://www.st.com/internet/evalboard/product/252419.jsp STMicroelectronics STM32F4DISCOVERY Evaluation Board] (Cortex M4)
* List of functions:
* List of functions:
-
** Currently the NXP LPCXpresso demo board (Cortex M0) is supported through the CMSIS library.
+
** Currently the [http://www.nxp.com/demoboard/OM13008.html NXP LPCXpresso LPC1227 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.
+
** Currently the [http://www.ti.com/tool/ek-lm4f232 Texas Instruments Stellaris LM4F232H5QD Evaluation Board] (Cortex M4) is supported through StellarisWare Libraries or AUTOSAR "Like" Drivers Library.
 +
** Currently the [http://www.st.com/internet/evalboard/product/252419.jsp STMicroelectronics STM32F4DISCOVERY Evaluation Board] (Cortex M4) is supported through the SPD Library.
= Download and install =
= 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:
+
RT-Druid and ERIKA Enterprise RTOS can be freely downloaded from the following web address:
-
* [http://download.tuxfamily.org/erika/webdownload/eeb_gpl/EE_160_Win.zip EE_160_Win.zip]
+
* http://erika.tuxfamily.org/drupal/download.html
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\).
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\).
Line 54: Line 57:
Note:  
Note:  
-
Cygwin can be downloaded from this web site: http://www.cygwin.com/  
+
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.
-
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.
The Cortex MX plug-in for Eclipse is part of the official distribution of RT-Druid.
* The procedure to update Erika and RT-Druid plugins is described at [[Tutorial: Update ERIKA and RT-Druid]].
* The procedure to update Erika and RT-Druid plugins is described at [[Tutorial: Update ERIKA and RT-Druid]].
-
= Choosing compiler =
+
= Target Configuration and Programming =
 +
 
 +
ERIKA Enterprise is configured through [[Tutorial: RT-Druid and OIL basics | RT-Druid and an OIL file]]
 +
 
 +
== Compiler Path ==
It is possible to choose the path of the compiler in three different ways:
It is possible to choose the path of the compiler in three different ways:
* environment var:
* environment var:
-
** IAR compiler: the IAR_CCDIR variable is able to override the path compiler set in RT-Druid during the build progress.
+
** IAR compiler toolchain: 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.
+
** Texas Instruments compiler toolchain: 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.
+
** ARM KEIL compiler toolchain: ARM_ROOT variable is able to override the path compiler set in RT-Druid during the build progress.
* configuration file:
* configuration file:
-
** command line versions of RT-Druid accept a configuration file, usually located at ''configuration/common_oil.pref''.<br>This file is in the java properties format (i.e. each line is composed by ''keyword=value'').<br>The keyword '''preference_cortex_m0__path_for_cc_compiler''' can be used to set the compiler path for Cortex MX.
+
** see [[RT-Druid configuration#Compiler paths]]
* gui:
* gui:
-
**inside eclipse preferences, it is possible to set the path of Cortex MX complier
+
**inside eclipse preferences, it is possible to set the paths of above compilers.
-
= Libraries =
+
== Compiler Legacy ==
-
* The software libraries currently supported are:
+
Limited to Texas Instruments (Cortex-M4) and ARM KEIL (Cortex-M0 and Cortex-M4) compiler toolchains, it's possible to select the legacy support by followings <code>EE_OPT</code>s in the <code>OS</code> object of the OSEK/VDX configuration OIL file.
-
** [http://www.arm.com/products/processors/cortex-m/cortex-microcontroller-software-interface-standard.php Cortex Microcontroller Software Interface Standard (CMSIS) Version 2.1]. (Cortex M0 ONLY)
+
-
=== CMSIS OIL file configuration ===
+
* Texas Instruments CCSv4 4.2.4.00033 TMS470 Code Composer Tools 4.9.0 and older:
 +
  EE_OPT = "__CCS_4_2_4_00033_OLDER__";
 +
* Texas Instruments CCSv4 4.2.4.00005 TMS470 Code Composer Tools 4.9.3:
 +
  EE_OPT = "__CCS_4_2_5_00005_TMS470_4_9_3__";
 +
* ARM KEIL uVision 4.53.00 and older:
 +
  EE_OPT = "__KEIL_4_54_OLDER__";
-
To enable CMSIS Library with NPX LPCXpresso LPC1227 demo board, the following code is needed in the <code>OS</code> object of the OSEK/VDX configuration:
+
== CPU ==
-
   EE_OPT = "__ADD_LIBS__";
+
<code>CPU_DATA</code> must be set to <code>CORTEX_MX</code>.<br>
-
  LIB = ENABLE {
+
The exact model is specified with the <code>MODEL</code> item (supported values are <code>M0</code> for Cortex M0 and <code>M4</code> for Cortex M4).<br>
-
     NAME = "CMSIS";
+
The compiler is specificed with the <code>COMPILER_TYPE</code> item (supported values are <code>IAR</code> and <code>KEIL</code> for <code>M0</code> model and <code>CCS</code> and <code>KEIL</code> for <code>M4</code>).<br>
 +
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;
 +
      };
 +
    };
   };
   };
-
  EE_OPT = "__USE_LPC12XX_CMSIS_V2__";
 
-
It's possible to include all library functions by <code>EE_OPT</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
+
== MCU ==
-
  EE_OPT = "__USE_CMSIS_ALL__";
+
<code>MCU_DATA</code> must be set to <code>LPCXPRESSO</code> for NXP LPCXpresso LPC12xx, to <code>STM32</code> for STMicroelectronics STM32F4xx or to <code>STELLARIS</code> for Texas Instruments Stellaris LM4F232xxxx.<br>
 +
The only item supported is <code>MODEL</code>, which can be either <code>LPC12xx</code> for <code>LPCXPRESSO</code>, <code>STM32F4xx</code> for <code>STM32</code> or <code>LM4F232xxxx</code> for <code>STELLARIS</code>.<br>
 +
Example of a MCU_DATA section:
-
It's possibile to include ONLY selected library modules functions by <code>EE_OPT</code> attributes in the <code>OS</code> object of the OSEK/VDX configuration:
+
  MCU_DATA = STELLARIS {
 +
    MODEL = LM4F232xxxx;
 +
  };
-
  EE_OPT = "__USE_CMSIS_SYSCTRL__";
+
== Interrupt Handling ==
-
  EE_OPT = "__USE_CMSIS_GPIO__";
+
-
  EE_OPT = "__USE_CMSIS_IOCON__";
+
-
  ...
+
-
= AUTOSAR Drivers =
+
Interrupts in ERIKA are handled in different manner between NXP LPCXpresso LPC12xx MCU (Cortex M0) and Texas Instruments Stellaris LM4F232xxxx or STMicroelectronics STM32F4xx MCUs (Cortex M4).
-
To enable AUTOSAR Drivers for Texas Instruments Stellaris LM4F232H5QD evaluation board and Keil ARM compiler, the following <code>EE_OPT</code> attribute is needed in the <code>OS</code> object of the OSEK/VDX configuration:
+
=== NXP LPCXpresso LPC12xx MCU (Cortex M0) ===
-
  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.<br>Template of these file can be found in [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/contrib/as/arch/stellaris/keil/config/ contrib/as/arch/stellaris/config/].
+
NXP LPC12xx MCU is configured to have a fixed Interrupt Vector Table specified in [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/pkg/mcu/nxp_lpcxpresso_lpc12xx/src/iar/startup_LPC12xx.s pkg/mcu/nxp_lpcxpresso_lpc12xx/src/iar/startup_LPC12xx.s] assembly file. Each entry has a fixed symbol that must be the parameter of <code>ISR1()</code> or <code>ISR2()</code> ISR signature.
-
The configuration C header compiler file inclusion is done by <code>CFLAGS</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
+
This scheme of ISR handling can be changed by rewriting the startup_LPC12xx.s changing the Interrupt Vector Table.
-
  CFLAGS = "-I<PATH>";
+
=== Texas Instruments Stellaris LM4F232xxxx and STMicroelectronics STM32F4xx MCUs (Cortex M4 )===
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C header compiler file is stored.
+
Texas Instruments Stellaris LM4F232xxxx and STMicroelectronics STM32F4xx MCUs (Cortex M4) are configured to have a flexible Interrupt Vector Table specified in [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/pkg/mcu/ti_stellaris_lm4f232xxxx/src/ee_startup_keil.s pkg/mcu/ti_stellaris_lm4f232xxxx/src/ee_startup_keil.s] and in [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/pkg/mcu/st_stm32_stm32f4xx/src/startup_stm32f4xx_keil.s pkg/mcu/st_stm32_stm32f4xx/src/startup_stm42f4xx_keil.s] for ARM KEIL compiler toolchain and in [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/pkg/mcu/ti_stellaris_lm4f232xxxx/src/ee_vtable_ccs.c pkg/mcu/ti_stellaris_lm4f232xxxx/src/ee_vtable_ccs.c] for Texas Instruments compiler toolchain. Each entry is specified by the following macro:
-
<b>Note:</b> Each AUTOSAR Driver must be enabled individually.
+
  EE_<ARCH>_<ENTRY>_ISR
-
=== AUTOSAR MCU Driver ===
+
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 enable AUTOSAR MCU Driver for Texas Instruments Stellaris LM4F232H5QD evaluation board and Keil ARM compiler, the following <code>EE_OPT</code> attribute is needed in the <code>OS</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:
-
   EE_OPT = "__AS_MCU_DRIVER__";
+
   ISR <SYMBOL> {
 +
    CATEGORY = <ISR_TYPE>;
 +
    ENTRY = "<ENTRY>";
 +
  };
-
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.<br>Templates of these files can be found in [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/contrib/as/arch/stellaris/keil/config/ contrib/as/arch/stellaris/config/].
+
Where <code><ISR_TYPE></code> is the type of the ISR (1 or 2), <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.
-
The configuration C header file inclusion is done by <code>CFLAGS</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
+
= OSEK/VDX Extensions =
-
  CFLAGS = "-I<PATH>";
+
This Section contains information about the OSEK/VDX Extensions (or optional features) that have been implemented for the ARM Cortex MX support. All of these features are not yet implemented in Cortex M0 (NXP LPCXpresso LPC12xx MCU) porting of ERIKA Enterprise.
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C header file is stored.
+
== Resource Managament at ISR level ==
-
Instead the configurations C source file is added to the compilation process by <code>APP_SRC</code> attribute in the <code>CPU_DATA</code> object of the OSEK/VDX configuration:
+
This feauture is automatically enabled by RT-Druid during the configuration generation step. To specify that a Resource is used by both a Task and a ISR you need to add that respource to the corrisponding ISR object as follows:
-
   APP_SRC = "<PATH>/Mcu_Cfg.c";
+
   TASK Task1 {
 +
    ...
 +
    RESOURCE = "ResourceA";
 +
  };
 +
 
 +
  ISR <SYMBOL> {
 +
    PRIORITY = <PRIORITY_LEVEL>;
 +
    CATEGORY = <ISR_TYPE>;
 +
    ENTRY = "<ENTRY>";
 +
    RESOURCE = "ResourceA";
 +
  };
 +
 
 +
  RESOURCE ResourceA { RESOURCEPROPERTY = STANDARD; };
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C source file is stored.
+
== System Timer ==
-
=== AUTOSAR PORT Driver ===
+
The OSEK/VDX standard provides support for a '''System Counter''' (a counter that is automatically linked to hardware timers). The System Timer is used to give a coherent timing reference across the entire application.
-
To enable AUTOSAR PORT Driver for Texas Instruments Stellaris LM4F232H5QD evaluation board and Keil ARM compiler, the following <code>EE_OPT</code> attribute is needed in the <code>OS</code> object of the OSEK/VDX configuration:
+
In ERIKA Enterprise, this special counter has been named '''System Timer'''. To use it, you need to set a specific attribute in a Counter definition. Please note that only one counter can be the System Timer.
-
  EE_OPT = "__AS_PORT_DRIVER__";
+
A Counter which is not a System Counter must be incremented manually using the primitive IncrementCounter.
-
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.<br>Templates of these files can be found in [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/contrib/as/arch/stellaris/keil/config/ contrib/as/arch/stellaris/config/].
+
The following is an example OIL definition for a System Counter:
-
The configuration C header file inclusion is done by <code>CFLAGS</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
+
  CPU_DATA = CORTEX_MX {
 +
    CPU_CLOCK = 16.0;
 +
    ...
 +
  };
 +
 
 +
  COUNTER SystemTimer {
 +
    MINCYCLE = 1;
 +
    MAXALLOWEDVALUE = 2147483647;
 +
    TICKSPERBASE = 1;
 +
    TYPE = HARDWARE {
 +
      DEVICE = "SYSTICK";
 +
      SYSTEM_TIMER = TRUE;
 +
    };
 +
    SECONDSPERTICK = 0.001;
 +
  };
-
  CFLAGS = "-I<PATH>";
+
The meaning of the various attributes is as follows:
 +
* CPU_DATA/CPU_CLOCK is used to declare the clock frequency (in MHZ)
 +
* COUNTER/TYPE must be set to "HARDWARE", and SYSTEM_TIMER must be set to true.
 +
* COUNTER/TYPE/DEVICE must be a valid device that can be used for a system timer. Currently, for Cortex ARM MX only "SYSTICK" is a valid device for system timer.
 +
* SECONDSPERTICK is used to declare the wanted time duration of one hardware tick in seconds.
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C header file is stored.
+
The System Timer can be attached to ALARMs as usual, as in the following example:
-
Instead the configurations C source file is added to the compilation process by <code>APP_SRC</code> attribute in the <code>CPU_DATA</code> object of the OSEK/VDX configuration:
+
  ALARM AlarmExample {
 +
    COUNTER = SystemTimer;
 +
    ACTION  = ACTIVATETASK{
 +
      TASK = TaskExample;
 +
    };
 +
  };
-
  APP_SRC = "<PATH>/Port_Cfg.c";
+
= Libraries =
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C source file is stored.
+
* The software libraries currently supported are:
 +
** [http://www.arm.com/products/processors/cortex-m/cortex-microcontroller-software-interface-standard.php Cortex Microcontroller Software Interface Standard (CMSIS) Version 2.1]. NPX LPCXpresso LPC1227 Demo Board (Cortex M0) ONLY
 +
** [http://www.ti.com/tool/sw-lm3s Texas Instruments StellarisWare Libraries Revision 8028]. Texas Instruments Stellaris LM4F232H5QD Evaluation Board (Cortex M4) ONLY
 +
** [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/contrib/st/STM32F4xx_StdPeriph_Driver/Release_Notes.html STM32F4xx Standard Peripherals Library Drivers (SPD) Version 1.0.0]. STMicroelectronics STM32F4DISCOVERY Evaluation Board (Cortex M4) ONLY
-
=== AUTOSAR DIO Driver ===
+
== CMSIS OIL file configuration ==
-
To enable AUTOSAR DIO Driver for Texas Instruments Stellaris LM4F232H5QD evaluation board and Keil ARM compiler, the following <code>EE_OPT</code> attribute is needed in the <code>OS</code> object of the OSEK/VDX configuration:
+
To enable CMSIS Library for NPX LPCXpresso LPC1227 demo board, the following code is needed in the <code>OS</code> object of the OSEK/VDX configuration:
-
   EE_OPT = "__AS_DIO_DRIVER__";
+
   EE_OPT = "__ADD_LIBS__";
 +
  LIB = ENABLE { NAME = "CMSIS"; };
 +
  EE_OPT = "__USE_LPC12XX_CMSIS_V2__";
-
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.<br>Templates of these files can be found in [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/contrib/as/arch/stellaris/keil/config/ contrib/as/arch/stellaris/config/].
+
It's possible to include all library functions by <code>EE_OPT</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
-
The configuration C header file inclusion is done by <code>CFLAGS</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
+
  EE_OPT = "__USE_CMSIS_ALL__";
-
  CFLAGS = "-I<PATH>";
+
It's possibile to include ONLY selected library modules functions by <code>EE_OPT</code> attributes in the <code>OS</code> object of the OSEK/VDX configuration:
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C header file is stored.
+
  EE_OPT = "__USE_CMSIS_SYSCTRL__";
 +
  EE_OPT = "__USE_CMSIS_GPIO__";
 +
  EE_OPT = "__USE_CMSIS_IOCON__";
 +
  ...
-
Instead the configurations C source file is added to the compilation process by <code>APP_SRC</code> attribute in the <code>CPU_DATA</code> object of the OSEK/VDX configuration:
+
== SPD OIL file configuration ==
-
  APP_SRC = "<PATH>/Dio_Cfg.c";
+
To enable SPD Libraries for STMicroelectronics STM32F4DISCOVERY Evaluation board, the following code is needed in the <code>OS</code> object of the OSEK/VDX configuration:
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C source file is stored.
+
  EE_OPT = "__ADD_LIBS__";
 +
  LIB = ENABLE { NAME = "CMSIS"; };
 +
  LIB = ENABLE { NAME = "EVAL"; };
 +
  LIB = ENABLE { NAME = "SPD"; };
 +
  EE_OPT = "__USE_STM32F4XX_CMSIS__";
 +
  EE_OPT = "__USE_STM32F4XX_EVAL__";
 +
  EE_OPT = "__USE_STM32F4XX_SPD__";
 +
 
 +
It's possible to include all libraries functions by <code>EE_OPT</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
 +
 
 +
  EE_OPT = "__USE_SPD_ALL__";
 +
 
 +
It's possibile to include ONLY selected library modules functions by <code>EE_OPT</code> attributes in the <code>OS</code> object of the OSEK/VDX configuration:
 +
 
 +
  EE_OPT = "__USE_SPD_ADC__";
 +
  EE_OPT = "__USE_SPD_SPI__";
 +
  EE_OPT = "__USE_SPD_TIM__";
 +
  ...
 +
 
 +
== StellarisWare OIL file configuration ==
 +
 
 +
To enable StellarisWare Libraries for Texas Instruments Stellaris LM4F232H5QD Evaluation Board, the following code is needed in the <code>OS</code> object of the OSEK/VDX configuration:
 +
 
 +
  EE_OPT = "__ADD_LIBS__";
 +
  LIB = ENABLE { NAME = "STELLARISWARE"; };
 +
  EE_OPT = "__STELLARISWARE_EK_LM4F232__";
 +
  EE_OPT = "__STELLARISWARE_DRIVER_LIB__";
 +
  EE_OPT = "__STELLARISWARE_GRAPHICS_LIB__";
 +
 
 +
It's possible to include all libraries functions by <code>EE_OPT</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
 +
 
 +
  EE_OPT = "__USE_STELLARISWARE_ALL__";
 +
 
 +
It's possibile to include ONLY selected library modules functions by <code>EE_OPT</code> attributes in the <code>OS</code> object of the OSEK/VDX configuration:
 +
 
 +
  EE_OPT = "__USE_STELLARISWARE_ADC__";
 +
  EE_OPT = "__USE_STELLARISWARE_SSI__";
 +
  EE_OPT = "__USE_STELLARISWARE_TIMER__";
 +
  ...
 +
 
 +
= AUTOSAR "Like" Drivers =
 +
 
 +
Texas Instruments Stellaris LM4F232H5QD Evaluation Board (Cortex M4) is supported through AUTOSAR "Like" Drivers too. Documentation can be found at [[Stellaris AUTOSAR Drivers]].
= Examples =
= Examples =
* The examples and tests are available in this folders:
* The examples and tests are available in this folders:
-
** [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/examples/cortex_mx/lpc12xx examples/cortex_mx/lpc12xx]: NXP LPCXpresso LPC1227 demo board examples (Cortex M0)
+
** [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/examples/cortex_mx/lpc12xx examples/cortex_mx/lpc12xx]: NXP LPCXpresso LPC1227 Demo Board (Cortex M0) examples.
-
** [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/examples/cortex_mx/lm4f232xxxx  examples/cortex_mx/lm4f232xxxx]: Texas Instruments Stellaris LM4F232H5QD evaluation board examples (Cortex M4)
+
** [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/examples/cortex_mx/lm4f232xxxx  examples/cortex_mx/lm4f232xxxx]: Texas Instruments Stellaris LM4F232H5QD Evaluation Board (Cortex M4) examples.
 +
** [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/examples/cortex_mx/STM32F4xx  examples/cortex_mx/STM32F4xx]: STMicroelectronics STM32F4DISCOVERY Evaluation Board (Cortex M4) examples.
 +
 
 +
Inside lm4f232xxxx examples folder you can find a [[Erika Benchmark|benchmark project]] too.
= KEIL uVision and RT-Druid Eclipse =
= KEIL uVision and RT-Druid Eclipse =
-
KEIL uVision sopport an Eclipse plu-in called MDK-ARM Plug-in.
+
=== MDK-ARM Plug-in Configuration ===
-
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.  
+
 
 +
KEIL uVision sopport an Eclipse plu-in called MDK-ARM Plug-in.<br>
 +
The MDK-ARM Plug-in components have the default installation path C:\Keil\Eclipse.<br>
 +
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).  
* Launch Eclipse and define a workspace (default workspace can be accepted).  
-
[[File:workspace.png|center|thumb|800px|Eclipse Workspace Selection.]]
+
[[File:workspace.png|center|thumb|650px|Eclipse Workspace Selection Dialog.]]
* Open the menu Help - Install New Software.
* Open the menu Help - Install New Software.
-
[[File:software.png|center|thumb|1024px|Eclipse New Software Installation.]]
+
[[File:software.png|center|thumb|1100px|Eclipse New Software Installation.]]
-
* Click Add.
+
* Click Add...
-
+
[[File:add.png|center|thumb|800px|Eclipse Software Repository Install Dialog.]]
-
Name: Keil MDK-ARM.  
+
* Click Local...
-
Location: file:/C:/Keil/Eclipse/ (the default installation folder).  
+
[[File:local.png|center|thumb|500px|Eclipse Local Software Repository Selection Dialog.]]
 +
* Select Disco locale (C:) -> Keil -> Eclipse and Click OK.
 +
[[File:folder.png|center|thumb|800px|Eclipse Local Software Repository Folder Selection Dialog.]]
 +
* Fill "Name:" (Keil MDK-ARM) and Click OK.
 +
[[File:name.png|center|thumb|500px|Eclipse Local Software Repository Selection Dialog.]]
 +
* Enable "Keil MDK-ARM", Disable "Contact all update sites during install to find required software" and Click Next.
 +
[[File:next.png|center|thumb|800px|Eclipse Software Repository Install Dialog.]]
 +
* On the next screen, Click Finish.
 +
[[File:finish.png|center|thumb|800px|Eclipse Software Installation Details Dialog.]]
 +
* And finally Click Restart Now.
 +
[[File:restart.png|center|thumb|600px|Eclipse Software Installation Details Dialog.]]
 +
* On a successful installation, Eclipse displays a menu µVision and µVision icons in the toolbar.
 +
[[File:install.png|center|thumb|1100px|Eclipse New Software Installation.]]
 +
To Debug an application see "MDK-ARM Plugin for Eclipse" in Keil uVision Help.
-
In the Install dialog:
+
=== Building stand-alone libee.a using RT-Druid Eclipse ===
-
Enable Keil MDK-ARM.
+
-
Disable Contact all update sites during install to find required software.
+
-
Click Next.  
+
 +
* Launch Eclipse and define a workspace (default workspace can be accepted).
 +
[[File:Workspace_Launcher.png|center|thumb|650px|Eclipse Workspace Selection Dialog.]]
 +
* Open the menu File - New - RT-Druid Oil and C/C++ Project.
 +
[[File:RT-Druid_Oil_Project.png|center|thumb|800px|RT-Druid Oil and C/C++ Project Menu Selection.]]
 +
* Fill "Project name:" (EEApp) and Click Finish.
 +
[[File:C_Project.png|center|thumb|750px|C Project Setting-up.]]
 +
* Write conf.oil file with <code>EE_OPT = "__NO_APP__"</code> attibute in <code>OS</code> object and <b>NO</b> <code>APP_SRC</code> attibutes in <code>CPU_DATA</code> object.
 +
* conf.oil file used here can be found in [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/examples/cortex_mx/lm4f232xxxx/EElib0/conf.oil examples/cortex_mx/lm4f232xxxx/EElib0/conf.oil]
 +
[[File:EEApp_conf_oil.png|center|thumb|800px|Application Oil file writing.]]
 +
* Open the menu Project, check that "Build Automatically" is not selected and press "Build Project".
 +
[[File:EEApp_build_project.png|center|thumb|800px|Application Building.]]
 +
* Finally stand-alone libee.a is built in Debug directory.
 +
[[File:EEApp_build_finished.png|center|thumb|800px|Application Build Finished.]]
-
On the next screen, click Finish. On a successful installation, Eclipse displays a menu µVision and µVision icons in the toolbar.
+
=== Building ERIKA based application using KEIL uVision ===
 +
To build an ERIKA based application using KEIL uVision, it needs that a stand-alone libee.a was built previously. See [[ARM Cortex MX#Building stand-alone libee.a using RT-Druid Eclipse]] above.
 +
* Launch Keil uVision.
 +
[[File:Keil.png|center|thumb|1000px|Keil uVision Main Window.]]
 +
* Open the menu Project - New uVision Project...
 +
[[File:Keil_New_project.png|center|thumb|1000px|Keil uVision New Project Selection.]]
 +
* Select project folder, fill "File name:" (KEEApp) then Click Save.
 +
[[File:KEEApp.png|center|thumb|750px|Keil uVision New Project Creation.]]
 +
* Select Device (Texas Instruments LM4F232H5DQ) and Click OK.
 +
[[File:KEEApp_LM4F232H5QD.png|center|thumb|850px|Keil uVision Device Selection.]]
 +
* In the next dialog click No because Erika provides its own startup code.
 +
[[File:KEEApp_Startup_s.png|center|thumb|450px|Keil uVision Device Selection.]]
 +
* Rename the target (TI Stellaris LM4F232H5QD) and sources group (EE).
 +
[[File:KEEApp_Renamed.png|center|thumb|1000px|Keil uVision Device Selection.]]
 +
* Right Click on source group EE and select "Add Files to Group 'EE'".
 +
* Select libee.a built previously, Click Add and then Close.
 +
[[File:KEEApp_Add_Files_Group_EE.png|center|thumb|750px|Keil uVision "Add Files to Group 'EE'".]]
 +
* Click on added libee.a.
 +
* Open the menu Project - Options for File 'libee.a'...
 +
[[File:KEEApp_Options_for_File_libee_a.png|center|thumb|1000px|Keil uVision "Options for File 'libee.a'...".]]
 +
* Change "File Type:" from "Assembly language file" to "Library file" and Click OK.
 +
[[File:KEEApp_libee_a_library.png|center|thumb|850px|Keil uVision "Options for File 'libee.a'...".]]
 +
* Right Click on "TI Stellaris LM4F232H5QD" target and select "Add Group...".
 +
* Rename the added group to "src".
 +
* Add in the group 'src' the startup assembly file for TI Stellaris LM4F232H5QD provided with Erika Enterprise [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/pkg/mcu/ti_stellaris_lm4f232xxxx/src/ee_startup_keil.s pkg/mcu/ti_stellaris_lm4f232xxxx/src/ee_startup_keil.s]
 +
[[File:KEEApp_ee_startup_keil_s.png|center|thumb|1000px|Keil uVision Startup File.]]
 +
* Add in the gourp 'src' the application source file (E.g. main.c).
 +
* main.c file used here can be found in [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/examples/cortex_mx/lm4f232xxxx/EElib0/main.c examples/cortex_mx/lm4f232xxxx/EElib0/main.c]
 +
[[File:KEEApp_main.png|center|thumb|1000px|Keil uVision Application Source File.]]
 +
* Right Click on "TI Stellaris LM4F232H5QD" target and select "Options for Target 'TI Stellaris LM4F232H5QD'..."
 +
* In the Target tab change "Floating Point Hardware:" from "Use FPU" to "Not Used".
 +
[[File:KEEApp_Option_No_FPU.png|center|thumb|850px|Keil uVision Taget Setup.]]
 +
* In the C/C++ tab Click "Include Paths" button "...".
 +
[[File:KEEApp_Options_C_tab.png|center|thumb|850px|Keil uVision C/C++ Setup.]]
 +
* Adds Erika Enterprise and eecfg include paths for the application and click OK.
 +
[[File:KEEApp_compiler_inludes.png|center|thumb|650px|Keil uVision Include Path Folder Setup.]]
 +
* In the Asm tab adds Erika Enterprise and eecfg include paths for the application (see above) and adds "--cpreproc" in "Misc Controls" input box.
 +
[[File:KEEApp_asm.png|center|thumb|850px|Keil uVision Assembly Setup.]]
 +
* In the Linker tab adds "--entry EE_cortex_mx_default_reset_ISR --first EE_cortex_mx_vtable" in "Misc Controls" input box.
 +
[[File:KEEApp_link.png|center|thumb|850px|Keil uVision Linker Setup.]]
 +
* Open the menu Project - Build target
 +
[[File:KEEApp_build.png|center|thumb|1000px|Keil uVision Build Target.]]
 +
* Open the menu Debug - Start/Stop Debug Session
 +
[[File:KEEApp_debug.png|center|thumb|1000px|Keil uVision Debug Session.]]
 +
= Benchmarks =
-
Copyright © Keil, An ARM Company. All rights reserved.
+
We run a limited set of benchmarks for the kernel, which are available at the page [[Erika Enterprise Benchmark for Cortex M4]]. Other benchmarks are available on the [[:Category:Benchmarks]].
= See also =
= See also =

Latest revision as of 07:31, 23 June 2015

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 ARM KEIL compiler toolchains;
  2. support for single and multi stack configurations;
  3. ISR Type 1 and Type 2 supported;
  4. support for IAR J-Link and ARM KEIL ULINK2 Debuggers.

The Cortex M4 support includes:

  1. support for Texas Instruments and ARM KEIL compiler toolchains;
  2. support for single and multi stack configurations;
  3. ISR Type 1 and Type 2 supported;
  4. support for Texas Instruments Stellaris ICDI and ARM KEIL ULINK2 Debuggers.
  • 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: Every task can have its private stack, or it can share it with other tasks.

MCUs

Boards

Download and install

RT-Druid and ERIKA Enterprise RTOS 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 Enterprise 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 toolchain: the IAR_CCDIR variable is able to override the path compiler set in RT-Druid during the build progress.
    • Texas Instruments compiler toolchain: CCS_INSTALL_ROOT variable is able to override the path compiler set in RT-Druid during the build progress.
    • ARM KEIL compiler toolchain: 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 paths of above compilers.

Compiler Legacy

Limited to Texas Instruments (Cortex-M4) and ARM KEIL (Cortex-M0 and Cortex-M4) compiler toolchains, it's possible to select the legacy support by followings EE_OPTs in the OS object of the OSEK/VDX configuration OIL file.

  • Texas Instruments CCSv4 4.2.4.00033 TMS470 Code Composer Tools 4.9.0 and older:
 EE_OPT = "__CCS_4_2_4_00033_OLDER__";
  • Texas Instruments CCSv4 4.2.4.00005 TMS470 Code Composer Tools 4.9.3:
 EE_OPT = "__CCS_4_2_5_00005_TMS470_4_9_3__";
  • ARM KEIL uVision 4.53.00 and older:
 EE_OPT = "__KEIL_4_54_OLDER__";

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, to STM32 for STMicroelectronics STM32F4xx or to STELLARIS for Texas Instruments Stellaris LM4F232xxxx.
The only item supported is MODEL, which can be either LPC12xx for LPCXPRESSO, STM32F4xx for STM32 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 LPCXpresso LPC12xx MCU (Cortex M0) and Texas Instruments Stellaris LM4F232xxxx or STMicroelectronics STM32F4xx MCUs (Cortex M4).

NXP LPCXpresso 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 and STMicroelectronics STM32F4xx MCUs (Cortex M4 )

Texas Instruments Stellaris LM4F232xxxx and STMicroelectronics STM32F4xx MCUs (Cortex M4) are configured to have a flexible Interrupt Vector Table specified in pkg/mcu/ti_stellaris_lm4f232xxxx/src/ee_startup_keil.s and in pkg/mcu/st_stm32_stm32f4xx/src/startup_stm42f4xx_keil.s for ARM KEIL compiler toolchain and in pkg/mcu/ti_stellaris_lm4f232xxxx/src/ee_vtable_ccs.c for Texas Instruments compiler toolchain. 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.

OSEK/VDX Extensions

This Section contains information about the OSEK/VDX Extensions (or optional features) that have been implemented for the ARM Cortex MX support. All of these features are not yet implemented in Cortex M0 (NXP LPCXpresso LPC12xx MCU) porting of ERIKA Enterprise.

Resource Managament at ISR level

This feauture is automatically enabled by RT-Druid during the configuration generation step. To specify that a Resource is used by both a Task and a ISR you need to add that respource to the corrisponding ISR object as follows:

 TASK Task1 {
   ...
   RESOURCE = "ResourceA";
 };
 
 ISR <SYMBOL> {
   PRIORITY = <PRIORITY_LEVEL>;
   CATEGORY = <ISR_TYPE>;
   ENTRY = "<ENTRY>";
   RESOURCE = "ResourceA";
 };
 
 RESOURCE ResourceA { RESOURCEPROPERTY = STANDARD; };

System Timer

The OSEK/VDX standard provides support for a System Counter (a counter that is automatically linked to hardware timers). The System Timer is used to give a coherent timing reference across the entire application.

In ERIKA Enterprise, this special counter has been named System Timer. To use it, you need to set a specific attribute in a Counter definition. Please note that only one counter can be the System Timer.

A Counter which is not a System Counter must be incremented manually using the primitive IncrementCounter.

The following is an example OIL definition for a System Counter:

 CPU_DATA = CORTEX_MX {
   CPU_CLOCK = 16.0;
   ...
 };
 
  COUNTER SystemTimer {
   MINCYCLE = 1;
   MAXALLOWEDVALUE = 2147483647;
   TICKSPERBASE = 1;
   TYPE = HARDWARE {
     DEVICE = "SYSTICK";
     SYSTEM_TIMER = TRUE;
   };
   SECONDSPERTICK = 0.001;
 };

The meaning of the various attributes is as follows:

  • CPU_DATA/CPU_CLOCK is used to declare the clock frequency (in MHZ)
  • COUNTER/TYPE must be set to "HARDWARE", and SYSTEM_TIMER must be set to true.
  • COUNTER/TYPE/DEVICE must be a valid device that can be used for a system timer. Currently, for Cortex ARM MX only "SYSTICK" is a valid device for system timer.
  • SECONDSPERTICK is used to declare the wanted time duration of one hardware tick in seconds.

The System Timer can be attached to ALARMs as usual, as in the following example:

 ALARM AlarmExample {
   COUNTER = SystemTimer;
   ACTION  = ACTIVATETASK{
      TASK = TaskExample;
   };
 };

Libraries

CMSIS OIL file configuration

To enable CMSIS Library for 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__";
 ...

SPD OIL file configuration

To enable SPD Libraries for STMicroelectronics STM32F4DISCOVERY Evaluation board, the following code is needed in the OS object of the OSEK/VDX configuration:

 EE_OPT = "__ADD_LIBS__";
 LIB = ENABLE { NAME = "CMSIS"; };
 LIB = ENABLE { NAME = "EVAL"; };
 LIB = ENABLE { NAME = "SPD"; };
 EE_OPT = "__USE_STM32F4XX_CMSIS__";
 EE_OPT = "__USE_STM32F4XX_EVAL__";
 EE_OPT = "__USE_STM32F4XX_SPD__";

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

 EE_OPT = "__USE_SPD_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_SPD_ADC__";
 EE_OPT = "__USE_SPD_SPI__";
 EE_OPT = "__USE_SPD_TIM__";
 ...

StellarisWare OIL file configuration

To enable StellarisWare Libraries for Texas Instruments Stellaris LM4F232H5QD Evaluation Board, the following code is needed in the OS object of the OSEK/VDX configuration:

 EE_OPT = "__ADD_LIBS__";
 LIB = ENABLE { NAME = "STELLARISWARE"; };
 EE_OPT = "__STELLARISWARE_EK_LM4F232__";
 EE_OPT = "__STELLARISWARE_DRIVER_LIB__";
 EE_OPT = "__STELLARISWARE_GRAPHICS_LIB__";

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

 EE_OPT = "__USE_STELLARISWARE_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_STELLARISWARE_ADC__";
 EE_OPT = "__USE_STELLARISWARE_SSI__";
 EE_OPT = "__USE_STELLARISWARE_TIMER__";
 ...

AUTOSAR "Like" Drivers

Texas Instruments Stellaris LM4F232H5QD Evaluation Board (Cortex M4) is supported through AUTOSAR "Like" Drivers too. Documentation can be found at Stellaris AUTOSAR Drivers.

Examples

Inside lm4f232xxxx examples folder you can find a benchmark project too.

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.

Building stand-alone libee.a using RT-Druid Eclipse

  • Launch Eclipse and define a workspace (default workspace can be accepted).
Eclipse Workspace Selection Dialog.
  • Open the menu File - New - RT-Druid Oil and C/C++ Project.
RT-Druid Oil and C/C++ Project Menu Selection.
  • Fill "Project name:" (EEApp) and Click Finish.
C Project Setting-up.
Application Oil file writing.
  • Open the menu Project, check that "Build Automatically" is not selected and press "Build Project".
Application Building.
  • Finally stand-alone libee.a is built in Debug directory.
Application Build Finished.

Building ERIKA based application using KEIL uVision

To build an ERIKA based application using KEIL uVision, it needs that a stand-alone libee.a was built previously. See ARM Cortex MX#Building stand-alone libee.a using RT-Druid Eclipse above.

  • Launch Keil uVision.
Keil uVision Main Window.
  • Open the menu Project - New uVision Project...
Keil uVision New Project Selection.
  • Select project folder, fill "File name:" (KEEApp) then Click Save.
Keil uVision New Project Creation.
  • Select Device (Texas Instruments LM4F232H5DQ) and Click OK.
Keil uVision Device Selection.
  • In the next dialog click No because Erika provides its own startup code.
Keil uVision Device Selection.
  • Rename the target (TI Stellaris LM4F232H5QD) and sources group (EE).
Keil uVision Device Selection.
  • Right Click on source group EE and select "Add Files to Group 'EE'".
  • Select libee.a built previously, Click Add and then Close.
Keil uVision "Add Files to Group 'EE'".
  • Click on added libee.a.
  • Open the menu Project - Options for File 'libee.a'...
Keil uVision "Options for File 'libee.a'...".
  • Change "File Type:" from "Assembly language file" to "Library file" and Click OK.
Keil uVision "Options for File 'libee.a'...".
  • Right Click on "TI Stellaris LM4F232H5QD" target and select "Add Group...".
  • Rename the added group to "src".
  • Add in the group 'src' the startup assembly file for TI Stellaris LM4F232H5QD provided with Erika Enterprise pkg/mcu/ti_stellaris_lm4f232xxxx/src/ee_startup_keil.s
Keil uVision Startup File.
Keil uVision Application Source File.
  • Right Click on "TI Stellaris LM4F232H5QD" target and select "Options for Target 'TI Stellaris LM4F232H5QD'..."
  • In the Target tab change "Floating Point Hardware:" from "Use FPU" to "Not Used".
Keil uVision Taget Setup.
  • In the C/C++ tab Click "Include Paths" button "...".
Keil uVision C/C++ Setup.
  • Adds Erika Enterprise and eecfg include paths for the application and click OK.
Keil uVision Include Path Folder Setup.
  • In the Asm tab adds Erika Enterprise and eecfg include paths for the application (see above) and adds "--cpreproc" in "Misc Controls" input box.
Keil uVision Assembly Setup.
  • In the Linker tab adds "--entry EE_cortex_mx_default_reset_ISR --first EE_cortex_mx_vtable" in "Misc Controls" input box.
Keil uVision Linker Setup.
  • Open the menu Project - Build target
Keil uVision Build Target.
  • Open the menu Debug - Start/Stop Debug Session
Keil uVision Debug Session.

Benchmarks

We run a limited set of benchmarks for the kernel, which are available at the page Erika Enterprise Benchmark for Cortex M4. Other benchmarks are available on the Category:Benchmarks.

See also

Personal tools