Difference between revisions of "Renesas RH850"

From ERIKA WIKI
Jump to: navigation, search
Line 24: Line 24:
 
== Integration with Renesas Embark E2X Software ==
 
== Integration with Renesas Embark E2X Software ==
  
This ERIKA's porting relies on Embark E2x Software for all the low-level startup activity needed to bring up an RTOS environment,
+
This ERIKA's porting relies on Renesas Embark Software for all the low-level startup activity needed to bring up an RTOS environment,
 
like: boot from reset vector, general purpose and special registers initialization, C data initialization, pll ramp-up (CLK), eventual FPU initialization etc.
 
like: boot from reset vector, general purpose and special registers initialization, C data initialization, pll ramp-up (CLK), eventual FPU initialization etc.
All these procedures plus most of the other low-level drivers (e.g. PORT, SCI, ADCH, CAN etc) are configured and executed in exactly the the same way as what is typically done in a native Renesas Embark E2x application (i.e. without an external RTOS).
+
All these procedures plus most of the other low-level drivers (e.g. PORT, SCI, ADCH, CAN etc) are configured and executed in exactly the the same way as what is typically done in a native Renesas Embark application (i.e. without an external RTOS).
  
Interrupt Controller Initialization (INTC) and OS Timer Module (OSTM) initialization (when the system timer is configured) are done inside the StartOS call, always relying on Embark E2x library. The configuration of these features is automatically generated by RT-Druid, starting from OIL file. The generated configuration file is out/ee_r_embark_e2x_cfg.c.
+
Interrupt Controller Initialization (INTC) and OS Timer Module (OSTM) initialization (when the system timer is configured) are done inside the StartOS call, always relying on Embark E2x library. The configuration of these features is automatically generated by RT-Druid, starting from OIL file. The generated configuration file is out/ee_r_embark_g4mh_cfg.c.
  
 
Module Standby for OSTM is internally handled by ERIKA3 when the System Timer is configured, all other peripherals stand-by have to be handled by the application.
 
Module Standby for OSTM is internally handled by ERIKA3 when the System Timer is configured, all other peripherals stand-by have to be handled by the application.
  
Currently only the low-level drivers of the Embark E2X library are automatically supported by ERIKA's build system (i.e. those contained in Drivers/RH850 sub-folder).
+
Currently, only the low-level drivers of the Embark library are automatically compiled by ERIKA's build system (i.e. those contained in Drivers/RH850 sub-folder).
  
The support for everything external to the RH850 low level drivers has been currently postponed. In particular the modules: CanFD driver, Ethernet Stack with Lightweight IP, Floating Point Exception driver (FPE), GTM support and Serial Terminal (Term), can be added as external sources to the application. Some of these modules (CanFD, FPE and Term) can be integrated in a straightforward way. LWIP and GTM will require more effort. We do no exclude that in future releases additional modules will be automatically added to the ERIKA3 build system.
+
Any driver inside the Embark/SourceCode/Drivers can be added to the build through OIL provided that it follows the Embark Driver Software Layout Convention.
  
'''IMPORTANT''': In case of a '''multicore''' application, the application '''MUST NOT call directly the Embark E2X R_BOOT_SetPeActive''' function (this will break the ERIKA3 startup procedure), but it should rely on the standard kernel API StartCore.
+
'''IMPORTANT''': In case of a '''multicore''' application, the application '''MUST NOT call directly the Embark R_BOOT_SetPeActive''' function (this will break the ERIKA3 startup procedure), but it should rely on the standard kernel API StartCore.
  
Obviously, Embark E2X Scheduler Module (SCHD) is not compatible with ERIKA.
+
Obviously, Embark Scheduler Module (SCHD) is not compatible with ERIKA.
  
Details for the Embark E2X configuration are provided below, in the specific paragraph dedicated to the Embark library.
+
Details for the Embark configuration are provided below, in the specific paragraph dedicated to the Embark library.
  
 
== Tutorials ==
 
== Tutorials ==
Line 65: Line 65:
 
Here is an [[Common oil.pref example|example of RT-Druid configuration file]].
 
Here is an [[Common oil.pref example|example of RT-Druid configuration file]].
  
== Renesas Embark E2X Software ==
+
== Renesas Embark Software ==
  
 
It is possible to choose the path in two different ways:
 
It is possible to choose the path in two different ways:
  
 
* ''RT-Druid Eclipse IDE Property''.
 
* ''RT-Druid Eclipse IDE Property''.
* ''RT-Druid Configuration File Entry'': '''preference_rh850__path_for_embark_e2x_software'''
+
* ''RT-Druid Configuration File Entry'': '''preference_rh850__path_for_embark_g4mh_software'''
** E.g.: preference_rh850__path_for_embark_e2x_software=C:\\Renesas\\EmbarkE2x_V2.5\\EmbarkE2xFCC1
+
** E.g.: preference_rh850__path_for_embark_g4mh_software=C:\\Renesas\\EmbarkE2x_V2.5\\EmbarkE2xFCC1
  
 
== Lauterbach TRACE32 Path ==
 
== Lauterbach TRACE32 Path ==
Line 108: Line 108:
  
 
ID is a numeric value starting from 0 (default value).
 
ID is a numeric value starting from 0 (default value).
The ID value correspond to the core physical ID, so the ID=0 (corresponding to the master core), MUST be configured always as it is requested by the AUTOSAR specifications, the other ID values are free to be configured or not.
+
The ID value corresponds to the core physical ID, so the ID=0 (corresponding to the master core), MUST be configured always as it is requested by the AUTOSAR specifications, the other ID values are free to be configured or not.
  
In RH850 E2X-FCC2 MCU family this number can be 5 at most, since this family is equipped with 6 cores.
+
In RH850 GM4H MCU family this number can be 5 at most since this family is equipped with 6 cores.
  
 
=== COMPILER ===
 
=== COMPILER ===
Line 137: Line 137:
 
       ...
 
       ...
 
     };
 
     };
 +
 +
=== LINKER_SCRIPT ====
 +
 +
'''LINKER_SCRIPT ''' attribute of '''CPU_DATA''' is a String attribute that as to contains a path to a valid Linker Script. It has to be provided for a non-supported derivative (currently any derivative that is not r7f702z04)
  
 
== MCU ==
 
== MCU ==
  
The MCUs support for the RH850 is configured correctly by simply specifying the '''MCU_DATA''' item ''without additional options''.
+
The MCUs support for the RH850 is configured correctly by simply specifying the '''MCU_DATA'''.
 
 
In case you are debugging with Lauterbach TRACE32, you may specify the '''DERIVATIVE''' and in order for the .cmm scripts to be generated correctly.
 
  
 
=== Valid configurations ===
 
=== Valid configurations ===
Line 148: Line 150:
 
The following are valid configurations for the MCU_DATA setting:
 
The following are valid configurations for the MCU_DATA setting:
  
* E2X-FCC2
+
* RH850_G4MH
  
     MCU_DATA = E2X_FCC2 {
+
     MCU_DATA = RH850_G4MH {
       DERIVATIVE = "R7F702Z17";
+
       DERIVATIVE     = "r7f702z04"; /* <-- Default Value */
 +
      EIINT_CHANNELS = 512; /* <-- Default Value */
 
     };
 
     };
  
 
=== MCU_DATA ===
 
=== MCU_DATA ===
  
'''MCU_DATA''' currently supports '''E2X_FCC2 ''' value only.
+
'''MCU_DATA''' currently supports '''RH850_G4MH''' value only.
  
 
Example of a MCU_DATA section:
 
Example of a MCU_DATA section:
  
     MCU_DATA = E2X_FCC2 {
+
     MCU_DATA = RH850_G4MH {
 
       ...
 
       ...
 
     };
 
     };
Line 166: Line 169:
 
=== DERIVATIVE ===
 
=== DERIVATIVE ===
  
'''DERIVATIVE''' attribute of '''MCU_DATA''' is an OIL attribute of type String. This field is used to generate Lauterbach scripts, its value has to be a valid system.cpu value for Lauterbach scripts, belonging to the selected RH850 family.
+
'''DERIVATIVE''' attribute of '''MCU_DATA''' is an OIL attribute of type String. This field is used to select linker files (currently only the linker script for r7f702z04 is provided by ERIKA, linker script for any other derivative that is not r7f702z04 has to be provided through CPU_DATA.LINKER_SCRIPT field) and to generate Lauterbach scripts.
 +
 
 +
Example of DERIVATIVE attribute of a MCU_DATA section:
 +
 
 +
    MCU_DATA = RH850_G4MH {
 +
      DERIVATIVE = "r7f702z04";
 +
      ...
 +
    };
  
Please note that if you configure MCU_DATA = E2X_FCC2, the '''DERIVATIVE''' string has to point to a MCU belonging to the E2X-FCC2 family. Please note that no consistency checks have been implemented (you will notice it because Lauterbach TRACE32 will not start).
+
=== EIINT_CHANNELS ===
 +
 
 +
'''EIINT_CHANNELS''' attribute of '''MCU_DATA''' is an OIL attribute of type UINT32. This field is used to quantifaicate the number of entries of interrupt vector. There is no consistency check between DERIVATIVE and EIINT_CHANNELS values.
  
 
Example of DERIVATIVE attribute of a MCU_DATA section:
 
Example of DERIVATIVE attribute of a MCU_DATA section:
  
     MCU_DATA = E2X_FCC2 {
+
     MCU_DATA = RH850_G4MH {
      DERIVATIVE = "R7F702Z17";
 
 
       ...
 
       ...
 +
      EIINT_CHANNELS = 512;
 
     };
 
     };
 
"R7F702Z17" is the default value for the attribute DERIVATIVE if MCU_DATA E2X_FCC2 is configured
 
  
 
== Interrupt Handling ==
 
== Interrupt Handling ==
  
Since there is no naming convention enforced by Renesas to identify a specific external interrupt source, the numeric approach have been chosen for this porting, mimicking what is done in native Embark E2X application. Valid values for the '''SOURCE''' field are strings representing numbers from "0" to "695" for a MCU_DATA E2X_FCC2.
+
Since there is no naming convention enforced by Renesas to identify a specific external interrupt source, the numeric approach has been chosen for this porting, mimicking what is done in native Embark E2X application. Valid values for the '''SOURCE''' field are strings representing numbers from "0" to "EIINT_CHANNELS" value for MCU_DATA RH850_G4MH.
  
 
Additional details:
 
Additional details:
* The Renesas interrupt controller (INTC) is a two level interrupt controller.
+
* The Renesas interrupt controller (INTC) is a two-level interrupt controller.
 
* The first 32 entries are handled privately for each core, while all the entries after 32 are global for the entire system.
 
* The first 32 entries are handled privately for each core, while all the entries after 32 are global for the entire system.
 
* It is legal to have multiple ISR with SOURCE 18 as long as they belong to different cores.
 
* It is legal to have multiple ISR with SOURCE 18 as long as they belong to different cores.
* IMPORTANT: in multicore enviroment, '''SOURCE = "0";''' correspond to Channel 0, mapped to the Inter-processor interrupt function (IPIR). This source is reserverd for Kernel internal communication.
+
* IMPORTANT: in multicore environments, '''SOURCE = "0";''' correspond to Channel 0, mapped to the Inter-processor interrupt function (IPIR). This source is reserved for Kernel internal communication.
  
 
== System Timer ==
 
== System Timer ==
Line 219: Line 229:
 
* '''COUNTER/TYPE/PRIORITY''' By default SYSTEM_TIMER is tied to smallest ISR priority (i.e. PRIORITY = 1;), but it can be overwritten.
 
* '''COUNTER/TYPE/PRIORITY''' By default SYSTEM_TIMER is tied to smallest ISR priority (i.e. PRIORITY = 1;), but it can be overwritten.
 
* '''COUNTER/SECONDSPERTICK''' is used to declare the wanted time duration of one hardware tick in seconds.
 
* '''COUNTER/SECONDSPERTICK''' is used to declare the wanted time duration of one hardware tick in seconds.
*: '''IMPORTANT:''' SECONDSPERTICK needs to have the same value for all system timers are driven by DEVICE = 18 (OSTM0 unit), otherwise some temporal misbehaviour will happen in some core. The OSTM0 unit configuration is physically done by the first core reaching the system timer initialization routine. A multicore "atomic" boolean grants a single initialization.
+
*: '''IMPORTANT:''' SECONDSPERTICK needs to have the same value for all system timers are driven by DEVICE = 18 (OSTM0 unit), otherwise some temporal misbehavior will happen in some core. The OSTM0 unit configuration is physically done by the first core reaching the system timer initialization routine. A multicore "atomic" boolean grants a single initialization.
  
 
The System Timer can be attached to ALARMs as usual, as in the following example:
 
The System Timer can be attached to ALARMs as usual, as in the following example:
Line 236: Line 246:
 
Example of a LIB section:
 
Example of a LIB section:
  
     LIB = EMBARK_E2X {
+
     LIB = EMBARK_G4MH {
      ...
+
      DRIVER = "GTM"; "Extra drivers folder from which getting source for libembark_g4mh.a";
 +
      DRIVER = "FPE"; "Extra drivers folder from which getting source for libembark_g4mh.a";
 
     };
 
     };
  
  
=== EMBARK_E2X ===
+
=== EMBARK_G4MH ===
  
The following sections describe the OIL fields of the '''LIB''' object customized for the official Renesas '''EMBARK E2X''' software support.
+
The following sections describe the OIL fields of the '''LIB''' object customized for the official Renesas '''EMBARK''' software support.
  
 
==== VERSION ====
 
==== VERSION ====
 
The '''VERSION''' attribute is a string attribute of '''EMBARK_E2X''' that would be used by the ERIKA's build system to handle multiple version of the library.
 
* '''"2.5"''' is default value
 
* this value is present in the OIL, but currently not used
 
 
Example of the VERSION attribute:
 
 
    LIB = EMBARK_E2X {
 
      VERSION = "2.5";
 
      ...
 
    };
 
  
 
==== STAND_ALONE ====
 
==== STAND_ALONE ====
  
The '''STAND_ALONE''' boolean attribute of '''EMBARK_E2X''' configures the build system to generate or not a '''libembark_e2x.a''' stand-alone binary library. The default value is set to '''TRUE'''.
+
The '''STAND_ALONE''' boolean attribute of '''EMBARK_G4MH''' configures the build system to generate or not a '''libembark_e2x.a''' stand-alone binary library. Otherwise, all the sources will be added to ERIKA library libee.a. The default value is set to '''TRUE'''.
  
 
Example of STAND_ALONE attribute of EMBARK_E2X:
 
Example of STAND_ALONE attribute of EMBARK_E2X:
  
 
     LIB = EMBARK_E2X  {
 
     LIB = EMBARK_E2X  {
      VERSION = "2.5";
 
 
       STAND_ALONE = TRUE;
 
       STAND_ALONE = TRUE;
 
     };
 
     };
  
 +
==== DRIVER ====
 +
This is a list of extra sub-folder of Embark/Drivers that have to be added to the build of libembark_g4mh.a
  
==== RH850 ====
+
     LIB = EMBARK_G4MH {
 
+
      DRIVER = "GTM"; "Extra drivers folder from which getting source for libembark_g4mh.a";
* The '''RH850''' boolean attribute enables the '''EMBARK_E2X''' low level drivers inclusion.
+
      DRIVER = "FPE"; "Extra drivers folder from which getting source for libembark_g4mh.a";
* The '''RH850''' default value is '''TRUE'''.
 
* RH850 contains a set of boolean flag to switch on/off inclusion of various low level drivers. Each flag has it's own default value so if you just declare LIB = EMBARK_E2x; you will get the minimal library needed to execute an ERIKA3 application.
 
* The Embark E2X software is composed by different layers and modules of utilities. The lowest level is the RH850, and is the only level currently supported by the automatic build system.
 
 
 
Below we describe all the RH850 flags with their respective default values.
 
 
 
     LIB = EMBARK_E2X {
 
      RH850 = TRUE {
 
        ADCH    = FALSE; /* Analog to Digital Converter */
 
        BARR    = FALSE; /* BARR synchronization API for multicore applications */
 
        BOOT    = TRUE; /* Startup code */
 
        CADC    = FALSE; /* Cyclic Analog to Digital Converter */
 
        CAN    = FALSE; /* Low Level Driver for RS-CANFD */
 
        CLK    = TRUE;  /* low level driver for Clock Controller (CLKC) */
 
        DFL    = FALSE; /* Data Flash */
 
        DSADC  = FALSE; /* Delta Sigma Analog to Digital Converter */
 
        DTS    = FALSE; /* Data Transfer Service (Renesas DMA) */
 
        ECM    = FALSE; /* Error Control Module */
 
        ETNC    = FALSE; /* Ethernet controller driver */
 
        FPU    = TRUE;  /* Floating Point Unit (ERIKA support FPU coprocessor context, not FXU yet) */
 
        MSTB    = TRUE;  /* Module Standby */
 
        OSTM    = TRUE;  /* OS Timer Module (Even deactivated can be implicitly used by ERIKA) */
 
        PBG    = FALSE; /* Peripheral Bus Guard (Peripheral access protection) */
 
        PIC2    = FALSE; /* Peripheral Interconnection module 2 */
 
        PORT    = FALSE; /* Port Configuration driver */
 
        SCI    = FALSE; /* Serial Communication Interface */
 
        WDTB    = FALSE; /* Window Watchdog Timer */
 
      };
 
 
     };
 
     };
  
 
[[Category:Architectures]]
 
[[Category:Architectures]]

Revision as of 19:42, 22 May 2019

Introduction

This manual describes the porting details of the ERIKA Enterprise v3 kernel(s) for Renesas RH850 E2x-FCC2 microcontroller.

RH850 features supported

The following are the main features currently supported by the RH850 port:

N.B. ERIKA currently support Floating Point Unit Coprocessor (FPU), Extended Floating Point Unit Coprocessor (FXU) is not supported yet.

Integration with Renesas Embark E2X Software

This ERIKA's porting relies on Renesas Embark Software for all the low-level startup activity needed to bring up an RTOS environment, like: boot from reset vector, general purpose and special registers initialization, C data initialization, pll ramp-up (CLK), eventual FPU initialization etc. All these procedures plus most of the other low-level drivers (e.g. PORT, SCI, ADCH, CAN etc) are configured and executed in exactly the the same way as what is typically done in a native Renesas Embark application (i.e. without an external RTOS).

Interrupt Controller Initialization (INTC) and OS Timer Module (OSTM) initialization (when the system timer is configured) are done inside the StartOS call, always relying on Embark E2x library. The configuration of these features is automatically generated by RT-Druid, starting from OIL file. The generated configuration file is out/ee_r_embark_g4mh_cfg.c.

Module Standby for OSTM is internally handled by ERIKA3 when the System Timer is configured, all other peripherals stand-by have to be handled by the application.

Currently, only the low-level drivers of the Embark library are automatically compiled by ERIKA's build system (i.e. those contained in Drivers/RH850 sub-folder).

Any driver inside the Embark/SourceCode/Drivers can be added to the build through OIL provided that it follows the Embark Driver Software Layout Convention.

IMPORTANT: In case of a multicore application, the application MUST NOT call directly the Embark R_BOOT_SetPeActive function (this will break the ERIKA3 startup procedure), but it should rely on the standard kernel API StartCore.

Obviously, Embark Scheduler Module (SCHD) is not compatible with ERIKA.

Details for the Embark configuration are provided below, in the specific paragraph dedicated to the Embark library.

Tutorials

The following tutorials are available for this architecture:

Configuration and Programming

ERIKA Enterprise is configured through RT-Druid and an OIL file and some other properties.

The following sections describe the properties and OIL fields customized for the Renesas RH850 Architecture.

Wind River Diab Compiler Path

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

  • Specific environment variable: WIND_DIAB_PATH (this is the same environment variable that Wind River configuration scripts generate and use)
    • E.g.: WIND_DIAB_PATH=C:\WindRiver\compilers\diab-5.9.6.6
  • RT-Druid Eclipse IDE Property.
  • RT-Druid Configuration File Entry: preference_tricore__path_for_hightec_gcc_compiler
    • E.g.: preference_rh850__path_for_windriver_diab_compiler=C:\\WindRiver\\compilers\\diab-5.9.6.6

Here is an example of RT-Druid configuration file.

Renesas Embark Software

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

  • RT-Druid Eclipse IDE Property.
  • RT-Druid Configuration File Entry: preference_rh850__path_for_embark_g4mh_software
    • E.g.: preference_rh850__path_for_embark_g4mh_software=C:\\Renesas\\EmbarkE2x_V2.5\\EmbarkE2xFCC1

Lauterbach TRACE32 Path

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

  • RT-Druid Eclipse IDE Property.
  • RT-Druid Configuration File Entry: preference_lauterbach__path_for_trace32
    • E.g.: preference_lauterbach__path_for_trace32=C:\T32

Here is an example of RT-Druid configuration file.

Lauterbach Emulator Interface

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

  • RT-Druid Eclipse IDE Property.
  • RT-Druid Configuration File Entry: preference_lauterbach__emulator_usb_interface
    • E.g.: preference_lauterbach__emulator_usb_interface=true

Here is an example of RT-Druid configuration file.

CPU

CPU_DATA object must be set to RH850.

Example of a CPU_DATA section:

   CPU_DATA = RH850 {
     ...
   };

ID

On multicore systems, one CPU_DATA instance exists for each core. They must have different IDs to be considered really distinct cores (all the CPU_DATA block with the same ID are merged together during generation and this may or may not cause validation errors if this happens due to a misconfiguration).

ID is a numeric value starting from 0 (default value). The ID value corresponds to the core physical ID, so the ID=0 (corresponding to the master core), MUST be configured always as it is requested by the AUTOSAR specifications, the other ID values are free to be configured or not.

In RH850 GM4H MCU family this number can be 5 at most since this family is equipped with 6 cores.

COMPILER

COMPILER attribute of CPU_DATA supports for now the DIAB value only. Deafult value is DIAB.

Example of a COMPILER attribute of CPU_DATA section:

   CPU_DATA = RH850 {
     COMPILER = DIAB;
     ...
   };

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 = RH850 {
     COMPILER = DIAB {
          MINIMAL_OPTS = TRUE;
     };
     ...
   };

LINKER_SCRIPT =

LINKER_SCRIPT attribute of CPU_DATA is a String attribute that as to contains a path to a valid Linker Script. It has to be provided for a non-supported derivative (currently any derivative that is not r7f702z04)

MCU

The MCUs support for the RH850 is configured correctly by simply specifying the MCU_DATA.

Valid configurations

The following are valid configurations for the MCU_DATA setting:

  • RH850_G4MH
   MCU_DATA = RH850_G4MH {
     DERIVATIVE     = "r7f702z04"; /* <-- Default Value */
     EIINT_CHANNELS = 512; /* <-- Default Value */
   };

MCU_DATA

MCU_DATA currently supports RH850_G4MH value only.

Example of a MCU_DATA section:

   MCU_DATA = RH850_G4MH {
     ...
   };

DERIVATIVE

DERIVATIVE attribute of MCU_DATA is an OIL attribute of type String. This field is used to select linker files (currently only the linker script for r7f702z04 is provided by ERIKA, linker script for any other derivative that is not r7f702z04 has to be provided through CPU_DATA.LINKER_SCRIPT field) and to generate Lauterbach scripts.

Example of DERIVATIVE attribute of a MCU_DATA section:

   MCU_DATA = RH850_G4MH {
     DERIVATIVE = "r7f702z04";
     ...
   };

EIINT_CHANNELS

EIINT_CHANNELS attribute of MCU_DATA is an OIL attribute of type UINT32. This field is used to quantifaicate the number of entries of interrupt vector. There is no consistency check between DERIVATIVE and EIINT_CHANNELS values.

Example of DERIVATIVE attribute of a MCU_DATA section:

   MCU_DATA = RH850_G4MH {
     ...
     EIINT_CHANNELS = 512;
   };

Interrupt Handling

Since there is no naming convention enforced by Renesas to identify a specific external interrupt source, the numeric approach has been chosen for this porting, mimicking what is done in native Embark E2X application. Valid values for the SOURCE field are strings representing numbers from "0" to "EIINT_CHANNELS" value for MCU_DATA RH850_G4MH.

Additional details:

  • The Renesas interrupt controller (INTC) is a two-level interrupt controller.
  • The first 32 entries are handled privately for each core, while all the entries after 32 are global for the entire system.
  • It is legal to have multiple ISR with SOURCE 18 as long as they belong to different cores.
  • IMPORTANT: in multicore environments, SOURCE = "0"; correspond to Channel 0, mapped to the Inter-processor interrupt function (IPIR). This source is reserved for Kernel internal communication.

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 {
   CPU_ID = 0;
   MINCYCLE = 1;
   MAXALLOWEDVALUE = 2147483647;
   TICKSPERBASE = 1;
   TYPE = HARDWARE {
     DEVICE = "18";
     SYSTEM_TIMER = TRUE;
     PRIORITY = 1;
   };
   SECONDSPERTICK = 0.001;
 };

The meaning of the various attributes is as follows:

  • COUNTER/CPU_ID is used to tie the counter to a specific core (you do not need to declare the CPU_ID in case the value is 0)
  • 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 as system timer. Currently, for RH850 only 18 and 19 (OS Timer Module) MCU peripheral are valid devices for system timer. DEVICE = "18" correspond to OSTM0 peripheral, that can broadcast its interrupt to all the cores (this is a nice feature which ensures a synchronized timebase for all cores). DEVICE = "19" correspond to a core private OSTM unit, from OSTM1 for Core0 to OSTM6 for Core5.
  • COUNTER/TYPE/PRIORITY By default SYSTEM_TIMER is tied to smallest ISR priority (i.e. PRIORITY = 1;), but it can be overwritten.
  • COUNTER/SECONDSPERTICK is used to declare the wanted time duration of one hardware tick in seconds.
    IMPORTANT: SECONDSPERTICK needs to have the same value for all system timers are driven by DEVICE = 18 (OSTM0 unit), otherwise some temporal misbehavior will happen in some core. The OSTM0 unit configuration is physically done by the first core reaching the system timer initialization routine. A multicore "atomic" boolean grants a single initialization.

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

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

LIB

LIB object supports for now the EMBARK_E2X value only.

Example of a LIB section:

   LIB = EMBARK_G4MH {
      DRIVER = "GTM"; "Extra drivers folder from which getting source for libembark_g4mh.a";
      DRIVER = "FPE"; "Extra drivers folder from which getting source for libembark_g4mh.a";
   };


EMBARK_G4MH

The following sections describe the OIL fields of the LIB object customized for the official Renesas EMBARK software support.

VERSION

STAND_ALONE

The STAND_ALONE boolean attribute of EMBARK_G4MH configures the build system to generate or not a libembark_e2x.a stand-alone binary library. Otherwise, all the sources will be added to ERIKA library libee.a. The default value is set to TRUE.

Example of STAND_ALONE attribute of EMBARK_E2X:

   LIB = EMBARK_E2X  {
     STAND_ALONE = TRUE;
   };

DRIVER

This is a list of extra sub-folder of Embark/Drivers that have to be added to the build of libembark_g4mh.a
   LIB = EMBARK_G4MH {
      DRIVER = "GTM"; "Extra drivers folder from which getting source for libembark_g4mh.a";
      DRIVER = "FPE"; "Extra drivers folder from which getting source for libembark_g4mh.a";
   };