ARM Cortex-R

From ERIKA WIKI
Revision as of 19:16, 25 February 2019 by E.Guidieri (talk | contribs) (System Timer)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

ERIKA Enterprise supports the ARM Cortex-R architecture. The support has been succesfully tested on Texas Instruments AWR1642.

We also have an internal porting of the RTOS for the Cortex-R5 on Xilinx Ultrascale+. Such support will be released in the next months. Please, contact us in case of urgent need.

Introduction

This manual describes the porting details of the ERIKA Enterprise v3 kernel(s) for families of microcontrollers which integrate ARM Cortex-R CPUs.

Configuration and Programming

ERIKA Enterprise is configured through RT-Druid and an OIL file and some other properties. The description of special fields and property have been separated by MCU.

Cortex-R MCU supported

All the Cortex-R microcontroller will need the CPU_DATA configured as Cortex-R as follow

CPU

CPU_DATA object must be set to CORTEX_R.

Example of a CPU_DATA section:

   CPU_DATA = CORTEX_R {
     ...
   };

Support for TI AWR16XX

The following sections describe the properties and OIL fields customized for TI AWR 1642 ARM Cortex-R architecture.

The support for TI AWR16XX have been developed on

Evaluation Board:

Using TI ARM CGT compiler:

As debugger we used XDS110-based JTAG on the through the Code Composer Studio IDE

Having the MMWave DEVPACK it is possible to use lauterbach TRACE32 too

The porting integrates with TI mmWave SDK library. mmWave SDK is a requisite for the porting.

The version integrated is the latest LTS at the moment of the porting

Tutorial

The following tutorials are available for this architecture:

TI ARM CGT Compiler Path

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

  • Specific environment variables: TI_ARM_C_DIR
    • E.g.: TI_ARM_C_DIR=C:\ti\ccsv8\tools\compiler\ti-cgt-arm_18.1.4.LTS
  • RT-Druid Eclipse IDE Property.
  • RT-Druid Configuration File Entry: preference_cortex_r__path_for_ti_cgt_arm_compiler
    • E.g.: preference_cortex_r__path_for_ti_cgt_arm_compiler=C:\ti\ti-cgt-arm_16.9.6.LTS

N.B. mmWave SDK 02_01_00_04 came with ti-cgt-arm_16.9.6.LTS packet

mmWave SDK Path

As we already this is a strict dependency for this porting so the following must be provided

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

  • Specific environment variables: TI_MMWAVE_SDK_PATH
    • E.g.: TI_MMWAVE_SDK_PATH=C:\\ti\\mmwave_sdk_02_01_00_04
  • RT-Druid Eclipse IDE Property.
  • RT-Druid Configuration File Entry: preference_cortex_r__path_for_ti_mmwave_sdk
    • E.g.: preference_cortex_r__path_for_ti_mmwave_sdk=C:\\ti\\mmwave_sdk_02_01_00_04

Here is an example of RT-Druid configuration file.

Porting for TI AWR1642 supporte the following under attributes for CPU_DATA CORTEX_R

COMPILER

COMPILER attribute of CPU_DATA must be set to TI_CGT_ARM.

Example of a COMPILER attribute of CPU_DATA section:

   CPU_DATA = CORTEX_R {
     COMPILER = TI_CGT_ARM;
     ...
   };

MINIMAL_OPTS

MINIMAL_OPTS boolean property of COMPILER attribute of CPU_DATA configures the build system with minimal compiling and linking options. The default value is set to FALSE.

Example of a MINIMAL_OPTS property of COMPILER attribute of CPU_DATA section:

   CPU_DATA = CORTEX_R {
     COMPILER = TI_CGT_ARM{
          MINIMAL_OPTS = TRUE;
     };
     ...
   };

MCU_DATA

MCU_DATA must be set to TI_AWR16XX.

Example of MODEL attribute of a MCU_DATA section:

   MCU_DATA = TI_AWR16XX;

Interrupt Handling

The ERIKA3 porting on TI AWR1642 implement a VIM (Vectored Interrupt Manager) driver. The SOURCE field of ISR is mapped on Request concept of VIM.

The mapping between Interrupt Sources and request numbers for TI AWR1642 is done in Table of 2-11 in chapter pag 159 chapter 2 16xx/2.3 Integration 16xx/2.3.9 Vectored Interrupt Manager (MSS_VIM)/2.3.9.1 Interrupt Request Assignments of TI AWR16XX/14xx Technical Reference Manual (TI doc code swru520b), in the colum with the unfurtunate name "Default VIM Interrupt Channel", since at MCU reset all the requests are mapped on the channel with the corresponding number.

N.B. Because of TI VIM hardware limitation is not possible to tie two ISR on the same priority (read Chaper 7 Vectored Interrupt Manager on TI AWR16XX/14xx TRM).

System Timer

The OSEK/VDX standard provides support for a System Counter (a counter that is automatically linked to a hardware timer).

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 for each core can be the System Timer.

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

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


 COUNTER SystemTimer {
   MINCYCLE = 1;
   MAXALLOWEDVALUE = 2147483647;
   TICKSPERBASE = 1;
   TYPE = HARDWARE {
     DEVICE = "RTIC0";
     SYSTEM_TIMER = TRUE;
     PRIORITY = 1;
   };
   SECONDSPERTICK = 0.001;
 };

The meaning of the various attributes is as follows:

  • 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. For TI AWR1642 a simple Real Time Interrupt (RTI) driver has been implemented to provide the system tick. Any of the 4 timers can be set as interrupt source of system timer. Allowed values are RTIC0, RTIC1, RTIC2, RTIC3.

N.B Internally these mnemonic strings are mapped to the corresponding VIM request numbers, so the request used as DEVICE for system timer cannot be used as SOURCE for a normal ISR2, currently no consistency check is implemented.

  • COUNTER/TYPE/PRIORITY By default SYSTEM_TIMER is tied to smallest ISR priority (i.e. PRIORITY = 1;), but it can be overritten.
  • COUNTER/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;
   };
 };