ARM Cortex MX

From ErikaWiki

(Difference between revisions)
Jump to: navigation, search
(Boards)
(Libraries)
 
(41 intermediate revisions not shown)
Line 5: Line 5:
The Cortex M0 support includes:  
The Cortex M0 support includes:  
-
# support for IAR and ARM KEIL 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 ARM KEIL 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:
Line 28: Line 28:
* 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)
-
** STMicroelectronics STM32F4xx. (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)
-
** STMicroelectronics STM32F4DISCOVERY 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 Texas Instruments StellarisWare or AUTOSAR "Like" 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 STM32F4DISCOVERY Evaluation board (Cortex M4) is supported through the STM32F4-Discovery Board Drivers.
+
** 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 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://erika.tuxfamily.org/erika-for-multiple-devices.html
+
* 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 64: Line 64:
= Target Configuration and Programming =
= Target Configuration and Programming =
-
ERIKA is configured through [[Tutorial: RT-Druid and OIL basics | RT-Druid and an OIL file]]
+
ERIKA Enterprise is configured through [[Tutorial: RT-Druid and OIL basics | RT-Druid and an OIL file]]
== Compiler Path ==
== Compiler Path ==
Line 71: Line 71:
* 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:
** see [[RT-Druid configuration#Compiler paths]]
** see [[RT-Druid configuration#Compiler paths]]
* gui:
* gui:
**inside eclipse preferences, it is possible to set the paths of above compilers.
**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 <code>EE_OPT</code>s in the <code>OS</code> 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 ==
Line 109: Line 120:
== Interrupt Handling ==
== Interrupt Handling ==
-
Interrupts in ERIKA are handled in different manner between NXP LPC12xx MCU (Cortex M0) and Texas Instruments Stellaris LM4F232xxxx MCU (Cortex M4).
+
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 LPC12xx MCU (Cortex M0) ===
+
=== NXP LPCXpresso LPC12xx MCU (Cortex M0) ===
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.
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.
Line 117: Line 128:
This scheme of ISR handling can be changed by rewriting the startup_LPC12xx.s changing the Interrupt Vector Table.
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 and STMicroelectronics STM32F4xx MCUs (Cortex M4 )===
-
Texas Instruments Stellaris LM4F232XXXX MCU (Cortex M4) is 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] for Keil/uVision compiler 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 TMS470 compiler. Each entry is specified by the following macro:
+
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:
   EE_<ARCH>_<ENTRY>_ISR
   EE_<ARCH>_<ENTRY>_ISR
Line 136: Line 147:
= OSEK/VDX Extensions =
= 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. Some of these features are not yet implemented in all the portings of ERIKA Enterprise.
+
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 ==
== Resource Managament at ISR level ==
Line 200: Line 211:
* The software libraries currently supported are:
* 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]. (Cortex M0 ONLY)
+
** [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
== CMSIS OIL file configuration ==
== CMSIS OIL file configuration ==
-
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:
+
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 = "__ADD_LIBS__";
   EE_OPT = "__ADD_LIBS__";
-
   LIB = ENABLE {
+
   LIB = ENABLE { NAME = "CMSIS"; };
-
    NAME = "CMSIS";
+
-
  };
+
   EE_OPT = "__USE_LPC12XX_CMSIS_V2__";
   EE_OPT = "__USE_LPC12XX_CMSIS_V2__";
Line 223: Line 234:
   ...
   ...
-
= AUTOSAR Drivers =
+
== SPD OIL file configuration ==
 +
 
 +
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:
 +
 
 +
  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 is supported through AUTOSAR Drivers. Documentation can be found at [[Stellaris AUTOSAR 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.
Inside lm4f232xxxx examples folder you can find a [[Erika Benchmark|benchmark project]] too.

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