AUTOSAR-like Drivers

From ErikaWiki

(Difference between revisions)
Jump to: navigation, search
(Configurator RT-Druid Eclipse Plug-in)
 
(42 intermediate revisions not shown)
Line 1: Line 1:
-
= AUTOSAR-like Drivers =
+
== Synopsis ==
-
== Motivations ==
+
The picture in the figure below shows the general architecture of AUTOSAR-like Drivers.
-
== Configurator ==
+
[[File: AUTOSAR_Device_Drivers.png ]]
-
== Compiling ==
+
AUTOSAR-like Drivers are meant to be used in the context of a process in which static configuration supported by tools is strongly suggested if not implied.
-
To enable AUTOSAR-like Drivers for Texas Instruments Stellaris LM4F232H5QD Evaluation Board with ARM KEIL Compiler Toolchain, the following <code>EE_OPT</code> attribute is needed in the <code>OS</code> object of the OSEK/VDX configuration:
 
-
  EE_OPT = "__AUTOSAR_R4_0__";
+
Each driver specification in AUTOSAR-like includes at the very least the following:
 +
* Dependencies from other drivers
 +
* A suggested architecture for the driver files, some of them to be defined with the help of automatic configuration tools
 +
* A set of driver-specific types
 +
* A set of driver-specific constants
 +
* An API consisting of a set of functions, callbacks and notification functions
-
AUTOSAR-like 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/].
+
== Configurator RT-Druid Eclipse Plug-in ==
-
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:
+
AUTOSAR-like Drivers need to be statically configured via RT-Druid Eclipse plug-in, available for free download at the [http://www.evidence.eu.com/products/eforms.html EFORMS web page]
-
  CFLAGS = "-I<PATH>";
+
=== Plug-in Installation ===
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C header compiler file is stored.
+
In order to install the AUTOSAR-like Drivers Configurator plug-in inside RT-Druid Eclipse, you have to select "Install New Software..." menu voice in "Help" menu.
-
<b>Note:</b> Each AUTOSAR Driver must be enabled individually.
+
[[File:Install_New_Software.png]]
 +
In the "Install" dialog window, you have to push "Add..." button.
-
== Drivers ==
+
[[File:Install_Add.png]]
-
=== AUTOSAR MCU Driver ===
+
In the "Add Repository" dialog window, you have to push "Archive..." button.
-
To enable AUTOSAR MCU Driver for Texas Instruments Stellaris LM4F232H5QD Evaluation Board with ARM KEIL compiler toolchain, the following <code>EE_OPT</code> attribute is needed in the <code>OS</code> object of the OSEK/VDX configuration:
+
[[File:Add_Repository_Archive.png]]
-
  EE_OPT = "__AS_MCU_DRIVER__";
+
You have to select the "Repository Archive" containig the Plug-in to install and push "Open" button.
-
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/].
+
[[File:Repository_Archive.png]]
-
The configuration C header file inclusion is done by <code>CFLAGS</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
+
In the "Add Repository" dialog window, you have to push "OK" button.
-
  CFLAGS = "-I<PATH>";
+
[[File:Add_Repository_OK.png]]
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C header file is stored.
+
In the "Install Details" dialog window, you have to push "Next >" button.
-
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:
+
[[File:Install_Details_Next.png]]
-
  APP_SRC = "<PATH>/Mcu_Cfg.c";
+
In the "Install" dialog window, you have to check "Driver configurator Erika Enterprise" and click on the "Next >" button.
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C source file is stored.
+
[[File:Install_Next.png]]
-
Usage examples of the AUTOSAR MCU Driver can be found at [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/examples/cortex_mx/lm4f232xxxx/as  examples/cortex_mx/lm4f232xxxx/as]
+
In the "Install Review License" dialog window, you have to accept the terms of license agreements and push "Finish" button.
-
=== AUTOSAR PORT Driver ===
+
[[File:Install_Finish.png]]
-
To enable AUTOSAR PORT Driver for Texas Instruments Stellaris LM4F232H5QD Evaluation Board with ARM KEIL compiler toolchain, the following <code>EE_OPT</code> attribute is needed in the <code>OS</code> object of the OSEK/VDX configuration:
+
Now you have to wait the installation process to finish.
-
  EE_OPT = "__AS_PORT_DRIVER__";
+
[[File:Installing_Software_Wait.png]]
-
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/].
+
In the "Security Warning" dialog window, you have to push "OK" button.
-
The configuration C header file inclusion is done by <code>CFLAGS</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
+
[[File:Security_Warning.png]]
-
  CFLAGS = "-I<PATH>";
+
In the "Software Updates" dialog window, you have to push "Yes" button to finalize the installation process and restart RT-Druid Eclipse.
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C header file is stored.
+
[[File:Software_Updates.png]]
-
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:
+
Now you have AUTOSAR-like Drivers Configurator plug-in installed in RT-Druid Eclipse.
-
  APP_SRC = "<PATH>/Port_Cfg.c";
+
=== Plug-in Installation Check ===
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C source file is stored.
+
In order to check if the AUTOSAR-like Driver Configurator plug-in is installed in RT-Druid Eclipse, you have to select "About Eclipse" menu voice in "Help" menu.
-
Usage examples of the AUTOSAR PORT Driver can be found at [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/examples/cortex_mx/lm4f232xxxx/as  examples/cortex_mx/lm4f232xxxx/as]
+
[[File:Help_About.png]]
-
=== AUTOSAR DIO Driver ===
+
In the "About Eclipse" dialog window, you have to push the "Evidence" button.
-
To enable AUTOSAR DIO Driver for Texas Instruments Stellaris LM4F232H5QD Evaluation Board with ARM KEIL compiler toolchain, the following <code>EE_OPT</code> attribute is needed in the <code>OS</code> object of the OSEK/VDX configuration:
+
[[File:About_Eclipse_Evidence.png]]
-
  EE_OPT = "__AS_DIO_DRIVER__";
+
In the "About Eclipse Features" dialog window, you have to check "Driver configurator Erika Enterprise (Core)" and "Evidece EFORMS core" are installed.
-
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/].
+
[[File:About_Eclipse_Features.png]]
-
The configuration C header file inclusion is done by <code>CFLAGS</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
+
=== Plug-in Installation Removal ===
-
  CFLAGS = "-I<PATH>";
+
In order to remove the AUTOSAR-like Driver Configurator plug-in installed in RT-Druid Eclipse, you have to select "About Eclipse" menu voice in "Help" menu.
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C header file is stored.
+
[[File:Help_About.png]]
-
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:
+
In the "About Eclipse" dialog window, you have to push the "Installation Details" button.
-
  APP_SRC = "<PATH>/Dio_Cfg.c";
+
[[File:About_Eclipse_Installation_Details.png]]
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C source file is stored.
+
In the "Eclipse Installation Details" dialog window, you have to select "Driver configurator Erika Enterprise" and "Evidece EFORMS runtime" and then you have to push the "Uninstall..." button.
-
Usage examples of the AUTOSAR DIO Driver can be found at [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/examples/cortex_mx/lm4f232xxxx/as  examples/cortex_mx/lm4f232xxxx/as]
+
[[File:Eclipse_Installation_Details_Uninstall.png]]
-
=== AUTOSAR SCI Driver ===
+
In the "Uninstall" dialog window, you have to push "Finish" button.
-
To enable AUTOSAR SCI Driver for Texas Instruments Stellaris LM4F232H5QD Evaluation Board with ARM KEIL compiler toolchain, the following <code>EE_OPT</code> attribute is needed in the <code>OS</code> object of the OSEK/VDX configuration:
+
[[File:Eclipse_Uninstall.png]]
-
  EE_OPT = "__AS_SCI_DRIVER__";
+
Now you have to wait the installation removal process to finish.
-
The AUTOSAR SCI Driver needs to be configured by C header and source files (Sci_Cfg.h and Sci_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/].
+
[[File:Eclipse_Uninstalling_Software.png]]
-
The configuration C header file inclusion is done by <code>CFLAGS</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
 
-
  CFLAGS = "-I<PATH>";
+
In the "Software Updates" dialog window, you have to push "Yes" button to finalize the installation removal process and restart RT-Druid Eclipse.
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C header file is stored.
+
[[File:Software_Updates.png]]
-
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:
+
Now you have removed AUTOSAR-like Drivers Configurator plug-in from RT-Druid Eclipse.
-
  APP_SRC = "<PATH>/Sci_Cfg.c";
+
== Supported Drivers ==
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C source file is stored.
+
=== [http://erika.tuxfamily.org/wiki/index.php?title=AUTOSAR-like_MCU_Driver MCU] ===
 +
The MCU driver provides services for basic microcontroller initialization, power down functionality, reset and microcontroller specific functions required by other MCAL [Microcontroller  Abstraction  Layer] software modules.
-
To use the SCI driver in interrupt mode, an ISR object must be added to OSEK/VDX configuration for every SCI Channel:
+
=== [http://erika.tuxfamily.org/wiki/index.php?title=AUTOSAR-like_PORT_Driver PORT] ===
 +
The PORT driver provide services for initializing the whole PORT structure of the microcontroller.
-
  ISR Sci_Channel_<Channel Number>_ISR {
+
=== [http://erika.tuxfamily.org/wiki/index.php?title=AUTOSAR-like_DIO_Driver DIO] ===
-
    CATEGORY = 2;
+
The DIO Driver abstracts the access to the microcontroller's hardware pins. Furthermore, it allows the grouping of those pins.
-
    ENTRY = "UART_<Channel Number>";
+
-
    PRIORITY = <ISR Priority>;
+
-
  };
+
-
Where <code><Channel Number></code> is the "channel number" as stated in the SCI Driver Channel Identifier of the channel and <code><ISR Priority></code> is a number indicating the level of priority (0: Lowest).
+
=== [http://erika.tuxfamily.org/wiki/index.php?title=AUTOSAR-like_SCI_Driver SCI] ===
 +
The SCI Driver provides serial communications services.  
-
Usage examples of the AUTOSAR SCI Driver can be found at [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/examples/cortex_mx/lm4f232xxxx/as  examples/cortex_mx/lm4f232xxxx/as]
+
=== [http://erika.tuxfamily.org/wiki/index.php?title=AUTOSAR-like_GPT_Driver GPT] ===
 +
The GPT Driver initializes and controls the internal General Purpose Timer(s) of the microcontroller.
-
=== AUTOSAR GPT Driver ===
+
=== [http://erika.tuxfamily.org/wiki/index.php?title=AUTOSAR-like_DMA_Driver DMA] ===
 +
The DMA Driver provides services to offload data transfer tasks from the μC, allowing for more efficient use of the μC and the available bus bandwidth.
-
To enable AUTOSAR GPT Driver for Texas Instruments Stellaris LM4F232H5QD Evaluation Board with ARM KEIL compiler toolchain, the following <code>EE_OPT</code> attribute is needed in the <code>OS</code> object of the OSEK/VDX configuration:
+
=== [http://erika.tuxfamily.org/wiki/index.php?title=AUTOSAR-like_SPI_Driver SPI] ===
 +
The SPI Driver provides services for reading from and writing to devices connected via SPI busses. It also provides the required mechanism to configure the onchip SPI peripheral.
-
  EE_OPT = "__AS_GPT_DRIVER__";
+
=== [http://erika.tuxfamily.org/wiki/index.php?title=AUTOSAR-like_WDG_Driver WDG] ===
 +
The WDG Driver provides services for initialization, changing the operation mode and setting the trigger condition (timeout) of a watchdog device.
-
The AUTOSAR GPT Driver needs to be configured by C header and source files (Gpt_Cfg.h and Gpt_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/].
+
== Build ==
-
The configuration C header file inclusion is done by <code>CFLAGS</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
+
To enable AUTOSAR-like Drivers in Erika Enterprise build process, the following <code>EE_OPT</code> attribute is needed in the <code>OS</code> object of the OSEK/VDX configuration:
-
   CFLAGS = "-I<PATH>";
+
   EE_OPT = "__AUTOSAR_R4_0__";
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C header file is stored.
+
AUTOSAR-like Drivers need to be statically configured through the configurator described above. The configuration process shall generate configuration header and source C files that shall be added to Erika Enterprise build process.
-
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:
+
The configuration C header files inclusion is done by <code>CFLAGS</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
-
 
+
-
  APP_SRC = "<PATH>/Gpt_Cfg.c";
+
-
 
+
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C source file is stored.
+
-
 
+
-
The Stellaris General-Purpose Timer Module (GPTM) contains six 16/32-bit GPTM blocks and six 32/64-bit Wide GPTM blocks.
+
-
 
+
-
Each 16/32-bit GPTM block provides two 16-bit timers (referred to as Timer A and Timer B) that can be configured to operate independently (with optional 8-bit prescaler) or concatenated to operate as one 32-bit timer (without prescaler).
+
-
 
+
-
Channel Identifiers for 16/32-bit GPTM blocks operating indipendently are the followings:
+
-
 
+
-
  GPT_CHANNEL_0_A /* block 0 timer A */
+
-
  GPT_CHANNEL_0_B /* block 0 timer B */
+
-
  GPT_CHANNEL_1_A /* block 1 timer A */
+
-
  GPT_CHANNEL_1_B /  block 1 timer B */
+
-
  ...
+
-
  GPT_CHANNEL_5_A /* block 5 timer A */
+
-
  GPT_CHANNEL_5_B /* block 5 timer B */
+
-
 
+
-
If a timer value can't be translated on 16-bit, the driver enables the 8-bit prescaler extending the timer counter size to 24-bit.
+
-
 
+
-
Channel Identifiers for 16/32-bit GPTM blocks concatenated are the followings:
+
-
 
+
-
  GPT_CHANNEL_J_0 /* block 0 [timer B]:[timer A] */
+
-
  GPT_CHANNEL_J_1 /* block 1 [timer B]:[timer A] */
+
-
  ...
+
-
  GPT_CHANNEL_J_5 /* block 5 [timer B]:[timer A] */
+
-
 
+
-
The timer counter size is fixed to 32-bit.
+
-
 
+
-
Each 32/64-bit Wide GPTM block provides two 32-bit timers (referred to as Timer A and Timer B) that can be configured to operate independently (with optional 16-bit prescaler) or concatenated to operate as one 64-bit timer (without prescaler).
+
-
 
+
-
Channel Identifiers for 32/64-bit GPTM blocks operating indipendently are the followings:
+
-
 
+
-
  GPT_CHANNEL_W_0_A /* block 0 timer A */
+
-
  GPT_CHANNEL_W_0_B /* block 0 timer B */
+
-
  GPT_CHANNEL_W_1_A /* block 1 timer A */
+
-
  GPT_CHANNEL_W_1_B /  block 1 timer B */
+
-
  ...
+
-
  GPT_CHANNEL_W_5_A /* block 5 timer A */
+
-
  GPT_CHANNEL_W_5_B /* block 5 timer B */
+
-
 
+
-
If a timer value can't be represented on 32-bit, the driver enables the 16-bit prescaler extending the timer counter size to 48-bit.
+
-
 
+
-
Channel Identifiers for 32/64-bit GPTM blocks concatenated are the followings:
+
-
 
+
-
  GPT_CHANNEL_J_W_0 /* block 0 [timer B]:[timer A] */
+
-
  GPT_CHANNEL_J_W_1 /* block 1 [timer B]:[timer A] */
+
-
  ...
+
-
  GPT_CHANNEL_J_W_5 /* block 5 [timer B]:[timer A] */
+
-
 
+
-
The timer counter size is fixed to 64-bit.
+
-
 
+
-
To use the GPT driver in interrupt mode, an ISR object must be added to OSEK/VDX configuration for every GPT Channel:
+
-
 
+
-
  ISR Gpt_Channel_<Channel>_ISR {
+
-
    CATEGORY = 2;
+
-
    ENTRY = "[WIDE_]TIMER_<Channel>";
+
-
    PRIORITY = <ISR Priority>;
+
-
  };
+
-
 
+
-
Where <code><Channel></code> is the "channel identifier" part as stated in the GPT Driver Channel Identifier of the channel and <code><ISR Priority></code> is a number indicating the level of priority (0: Lowest).
+
-
 
+
-
Examples:
+
-
 
+
-
  /* GPT_CHANNEL_0_B: 16-bit GPTM block 0 timer B */
+
-
  ISR Gpt_Channel_0_B_ISR {
+
-
    CATEGORY = 2;
+
-
    ENTRY = "TIMER_0_B";
+
-
    PRIORITY = 4;
+
-
  };
+
-
  ...
+
-
  /* GPT_CHANNEL_J_1: 32-bit GPTM conactenated GPTM block 1 [timer B]:[timer A] */
+
-
  ISR Gpt_Channel_J_1_ISR {
+
-
    CATEGORY = 2;
+
-
    ENTRY = "TIMER_1_A"; /* Concatenated GPTM blocks ALWAYS refers timer A ENTRY */
+
-
    PRIORITY = 3;
+
-
  };
+
-
  ...
+
-
  /* GPT_CHANNEL_W_4_A: 32-bit WIDE GPTM block 4 timer A */
+
-
  ISR Gpt_Channel_0_B_ISR {
+
-
    CATEGORY = 2;
+
-
    ENTRY = "WIDE_TIMER_4_A"; /* WIDE GPTM block */
+
-
    PRIORITY = 6;
+
-
  };
+
-
  ...
+
-
  /* GPT_CHANNEL_J_W_3: 64-bit conactenated WIDE GPTM block 3 [timer B]:[timer A] */
+
-
  ISR Gpt_Channel_J_W_3_ISR {
+
-
    CATEGORY = 2;
+
-
    ENTRY = "WIDE_TIMER_3_A"; /* Concatenated WIDE GPTM blocks ALWAYS refers timer A ENTRY */
+
-
    PRIORITY = 7;
+
-
  };
+
-
 
+
-
Usage examples of the AUTOSAR GPT Driver can be found at [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/examples/cortex_mx/lm4f232xxxx/as  examples/cortex_mx/lm4f232xxxx/as]
+
-
 
+
-
=== AUTOSAR DMA Driver ===
+
-
 
+
-
To enable AUTOSAR DMA Driver for Texas Instruments Stellaris LM4F232H5QD Evaluation Board with ARM KEIL compiler toolchain, the following <code>EE_OPT</code> attribute is needed in the <code>OS</code> object of the OSEK/VDX configuration:
+
-
 
+
-
  EE_OPT = "__AS_DMA_DRIVER__";
+
-
 
+
-
The AUTOSAR DMA Driver needs to be configured by C header and source files (Dma_Cfg.h and Dma_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 configuration C header file inclusion is done by <code>CFLAGS</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
+
   CFLAGS = "-I<PATH>";
   CFLAGS = "-I<PATH>";
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C header file is stored.
+
Where <code><PATH></code> is the absolute or relative directory path which configuration C header files is stored.
-
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:
+
<b>Note:</b> Each AUTOSAR-like Driver must be enabled individually.
-
  APP_SRC = "<PATH>/Dma_Cfg.c";
+
=== Stand-alone Library ===
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C source file is stored.
+
To build a stand-alone library (libas.a) containing build-enabled AUTOSAR-like Drivers, the following code is needed in the <code>OS</code> object of the OSEK/VDX configuration:
-
To use the DMA driver in interrupt mode, an ISR object must be added to OSEK/VDX configuration for Software DMA Channel Transfer End and another ISR must be added to OSEK/VDX configuration for DMA Transfer Error:
+
   EE_OPT = "__ADD_LIBS__";
-
 
+
  LIB = ENABLE {
-
   ISR Dma_SoftwareTransferEnd_ISR {
+
     NAME = "AUTOSAR";
-
    CATEGORY = 2;
+
-
    ENTRY = "UDMA_SOFT_TRANSF";
+
-
    PRIORITY = <ISR Priority>;
+
-
  }
+
-
 
+
-
  ISR Dma_TransferError_ISR {
+
-
     CATEGORY = 2;
+
-
    ENTRY = "UDMA_ERR";
+
-
    PRIORITY = <ISR Priority>;
+
   };
   };
-
Where <code><ISR Priority></code> is a number indicating the level of priority (0: Lowest).
+
It's possible to include into library the drivers configurations by the following <code>EE_OPT</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
-
Usage examples of the AUTOSAR DMA Driver can be found at [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/examples/cortex_mx/lm4f232xxxx/as  examples/cortex_mx/lm4f232xxxx/as]
+
  EE_OPT = "__NO_APP__";
-
=== AUTOSAR SPI Driver ===
+
== Supported Architectures ==
-
To enable AUTOSAR SPI Driver for Texas Instruments Stellaris LM4F232H5QD Evaluation Board with ARM KEIL compiler toolchain, the following <code>EE_OPT</code> attribute is needed in the <code>OS</code> object of the OSEK/VDX configuration:
+
=== Texas Instruments Stellaris LM4F232xxxx with ARM KEIL uVision Compiler Toolchain ===
-
  EE_OPT = "__AS_SPI_DRIVER__";
+
==== Configuration Instatiation ====
-
The AUTOSAR SPI Driver needs to be configured by C header and source files (Spi_Cfg.h and Spi_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/].
+
In order to configure AUTOSAR-like Drivers for Texas Instruments Stellaris LM4F232xxxx with ARM KEIL uVision Compiler Toolchain, you have to create an instance of the drivers configuration inside your RT-Druid Eclipse project.
-
The configuration C header file inclusion is done by <code>CFLAGS</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
+
The first step to do this is to right-click on the project folder in the project explorer.
-
  CFLAGS = "-I<PATH>";
+
In the first Context-Menu popped-up, you have to choose the "New" menu voice.
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C header file is stored.
+
In the next Context-Menu popped-up, you have to select the "Other..." menu voice.
-
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:
+
[[File:Project_New_Other.png]]
-
  APP_SRC = "<PATH>/Spi_Cfg.c";
+
In the "New" dialog window, you have to expand the "Evidence" folder, select "Erika Driver Configurator" and then push "Next >" button.
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C source file is stored.
+
[[File:New_Evidence_Driver_Configurator.png]]
-
To use the AUTOSAR SPI driver, the AUTOSAR DMA driver must be enabled and configured too. Moreover an ISR object must be added to OSEK/VDX configuration for every TI Stellaris SSI harware unit configured and :
+
In the "Erika Driver Configuration" dialog window, you may change/choose the drivers configuration instance file name and then you have to push "Finish" button.
-
  ISR Spi_HwUnit_<Hardware Unit Number>_ISR {
+
[[File:Erika_Driver_Configuration_File_Name.png]]
-
    CATEGORY = 2;
+
-
    ENTRY = "SSI_<Hardware Unit Number>";
+
-
    PRIORITY = <ISR Priority>;
+
-
  }
+
 +
The AUTOSAR-like Drivers configuration instance file is now created and ready to be edited.
-
Where <code><Hardware Unit Number></code> is the TI Stellaris SSI hardware unit number (from 0 to 3) and <code><ISR Priority></code> is a number indicating the level of priority (0: Lowest).
+
[[File:Erika_Driver_Configurator_Main.png]]
-
Usage examples of the AUTOSAR SPI Driver can be found at [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/examples/cortex_mx/lm4f232xxxx/as  examples/cortex_mx/lm4f232xxxx/as]
+
==== Configuration Editing ====
-
=== AUTOSAR WDG Driver ===
+
The edit process for AUTOSAR-like Drivers configuration file is related to each individual driver.
-
Texas Instruments Stellaris LM4F232 MCU provides two watchdog peripherals: one clocked by Precision Internal Oscillator (PIOsc) with a fixed frequency of 16MHz and the other clocked System Clock (SysClk) which frequency is configurable by AUTOSAR MCU Driver.
+
Please refer to specific driver documentation.
-
Each watchdog is driven by a separate driver.
+
==== Configuration Generation ====
-
==== AUTOSAR PIOSC WDG Driver ====
+
Once you have edited the configuration file for AUTOSAR-like Drivers you wish to use in your application, to generate the configuration header and source C files for all drivers configured, you have to select "Generate Code" menu voice in the "Erika Driver Editor" Menu.
-
To enable AUTOSAR PIOSC WDG Driver for Texas Instruments Stellaris LM4F232H5QD Evaluation Board with ARM KEIL compiler toolchain, the following <code>EE_OPT</code> attribute is needed in the <code>OS</code> object of the OSEK/VDX configuration:
+
[[File:Erika_Driver_Editor_Generate_Code.png]]
-
  EE_OPT = "__AS_WDG_PIOSC_DRIVER__";
+
The configured AUTOSAR-like drivers configuration header and source C files will be generated in "src-gen" project folder.
-
The AUTOSAR PIOSC WDG Driver needs to be configured by C header and source files (Wdg_PIOscCfg.h and Wdg_PIOscCfg.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/].
+
[[File:Erika_Driver_configuration_Generated.png]]
-
 
+
-
The configuration C header file inclusion is done by <code>CFLAGS</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
+
-
 
+
-
  CFLAGS = "-I<PATH>";
+
-
 
+
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C header file is stored.
+
-
 
+
-
Instead the configurations C source file is added to the compilation process by <code>APP_SRC</code> attribute in the <code>CPU_DATA</code> object of the OSEK/VDX configuration:
+
-
 
+
-
  APP_SRC = "<PATH>/Wdg_PIOscCfg.c";
+
-
 
+
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C source file is stored.
+
-
 
+
-
To use the AUTOSAR PIOSC WDG driver, almost another pheriperal must be configured and initialized to be clocked by PIOsc (eg. Adc, Spi, Sci, ...). Moreover an ISR object must be added to OSEK/VDX configuration:
+
-
 
+
-
  ISR Wdg_PIOsc_ISR {
+
-
    CATEGORY = 2;
+
-
    ENTRY = "WATCHDOG_TIMER";
+
-
    PRIORITY = <ISR Priority>;
+
-
  }
+
-
 
+
-
Where <code><ISR Priority></code> is a number indicating the level of priority (0: Lowest); if the driver is configured to fire "Standard" Interrupts, or:
+
-
 
+
-
  ISR Wdg_PIOsc_ISR {
+
-
    CATEGORY = 2;
+
-
    ENTRY = "NMI";
+
-
  }
+
-
 
+
-
If the driver is configured to fire Non-Maskable Interrupts with a fixed priority higher than "standard".
+
-
 
+
-
Usage examples of the AUTOSAR PIOSC WDG Driver can be found at [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/examples/cortex_mx/lm4f232xxxx/as  examples/cortex_mx/lm4f232xxxx/as]
+
-
 
+
-
==== AUTOSAR SYSCLK WDG Driver ====
+
-
 
+
-
To enable AUTOSAR SYSCLK WDG Driver for Texas Instruments Stellaris LM4F232H5QD Evaluation Board with ARM KEIL compiler toolchain, the following <code>EE_OPT</code> attribute is needed in the <code>OS</code> object of the OSEK/VDX configuration:
+
-
 
+
-
  EE_OPT = "__AS_WDG_SYSCLK_DRIVER__";
+
-
 
+
-
The AUTOSAR PIOSC WDG Driver needs to be configured by C header and source files (Wdg_SysClkCfg.h and Wdg_SysClkCfg.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 configuration C header file inclusion is done by <code>CFLAGS</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
+
-
 
+
-
  CFLAGS = "-I<PATH>";
+
-
 
+
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C header file is stored.
+
-
 
+
-
Instead the configurations C source file is added to the compilation process by <code>APP_SRC</code> attribute in the <code>CPU_DATA</code> object of the OSEK/VDX configuration:
+
-
 
+
-
  APP_SRC = "<PATH>/Wdg_SysClkCfg.c";
+
-
 
+
-
Where <code><PATH></code> is the absolute or relative directory path which configuration C source file is stored.
+
-
 
+
-
To use the AUTOSAR SYSCLK WDG driver an ISR object must be added to OSEK/VDX configuration:
+
-
 
+
-
  ISR Wdg_SysClk_ISR {
+
-
    CATEGORY = 2;
+
-
    ENTRY = "WATCHDOG_TIMER";
+
-
    PRIORITY = <ISR Priority>;
+
-
  }
+
-
 
+
-
Where <code><ISR Priority></code> is a number indicating the level of priority (0: Lowest); if the driver is configured to fire "Standard" Interrupts, or:
+
-
 
+
-
  ISR Wdg_SysClk_ISR {
+
-
    CATEGORY = 2;
+
-
    ENTRY = "NMI";
+
-
  }
+
-
 
+
-
If the driver is configured to fire Non-Maskable Interrupts with a fixed priority higher than "standard".
+
-
 
+
-
Usage examples of the AUTOSAR SYSCLK WDG Driver can be found at [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/examples/cortex_mx/lm4f232xxxx/as  examples/cortex_mx/lm4f232xxxx/as]
+
-
 
+
-
=== Stand-alone Library ===
+
-
 
+
-
To build a stand-alone library (libas.a) containing enabled AUTOSAR Drivers for Texas Instruments Stellaris LM4F232H5QD Evaluation Board with ARM KEIL compiler toolchain, the following code is needed in the <code>OS</code> object of the OSEK/VDX configuration:
+
-
 
+
-
  EE_OPT = "__ADD_LIBS__";
+
-
  LIB = ENABLE {
+
-
    NAME = "AUTOSAR";
+
-
  };
+
-
 
+
-
It's possible to include into library the drivers configurations by the following <code>EE_OPT</code> attribute in the <code>OS</code> object of the OSEK/VDX configuration:
+
-
 
+
-
  EE_OPT = "__NO_APP__";
+
-
=== Keil uVision Integration ===
+
==== Keil uVision Integration ====
-
To integrate AUTOSAR Drivers for Texas Instruments Stellaris LM4F232H5QD Evaluation Board with ARM KEIL compiler toolchain in a ARM KEIL uVision application project, it nees:<br>
+
To integrate AUTOSAR-like Drivers for Texas Instruments Stellaris LM4F232xxxx with ARM KEIL uVision Compiler Toolchain in a ARM KEIL uVision application project, it nees:<br>
* To add a previously builded libas.a (containing drivers configurations) to a Target Sources Group of ARM KEIL uVision Project.
* To add a previously builded libas.a (containing drivers configurations) to a Target Sources Group of ARM KEIL uVision Project.
* To add AUTOSAR Drivers include path ([http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/contrib/as/include/ contrib/as/include/]) to ARM KEIL uVision C/C++ compiler include paths.
* To add AUTOSAR Drivers include path ([http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/contrib/as/include/ contrib/as/include/]) to ARM KEIL uVision C/C++ compiler include paths.
-
* To add AUTOSAR Drivers for Texas Instruments Stellaris LM4F232H5QD Evaluation Board with ARM KEIL compiler toolchain [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/contrib/as/arch/stellaris/keil/include/ contrib/as/arch/stellaris/keil/include/] to Keil uVision C/C++ compiler include paths.
+
* To add AUTOSAR Drivers for Texas Instruments Stellaris LM4F232xxxx with ARM KEIL compiler toolchain [http://svn.tuxfamily.org/viewvc.cgi/erika_erikae/repos/ee/trunk/ee/contrib/as/arch/stellaris/keil/include/ contrib/as/arch/stellaris/keil/include/] to Keil uVision C/C++ compiler include paths.
-
* To add AUTOSAR Drivers configurations for Texas Instruments Stellaris LM4F232H5QD Evaluation Board with ARM KEIL compiler toolchain include path to ARM KEIL uVision C/C++ compiler include paths.
+
* To add AUTOSAR Drivers configurations for Texas Instruments Stellaris LM4F232xxxx with ARM KEIL uVision Compiler Toolchain include path to ARM KEIL uVision C/C++ compiler include paths.
-
= See also =
+
==== See also ====
* [[ARM Cortex MX#Building stand-alone libee.a using RT-Druid Eclipse]]
* [[ARM Cortex MX#Building stand-alone libee.a using RT-Druid Eclipse]]

Latest revision as of 18:09, 16 July 2013

Contents

Synopsis

The picture in the figure below shows the general architecture of AUTOSAR-like Drivers.

AUTOSAR Device Drivers.png

AUTOSAR-like Drivers are meant to be used in the context of a process in which static configuration supported by tools is strongly suggested if not implied.


Each driver specification in AUTOSAR-like includes at the very least the following:

  • Dependencies from other drivers
  • A suggested architecture for the driver files, some of them to be defined with the help of automatic configuration tools
  • A set of driver-specific types
  • A set of driver-specific constants
  • An API consisting of a set of functions, callbacks and notification functions

Configurator RT-Druid Eclipse Plug-in

AUTOSAR-like Drivers need to be statically configured via RT-Druid Eclipse plug-in, available for free download at the EFORMS web page

Plug-in Installation

In order to install the AUTOSAR-like Drivers Configurator plug-in inside RT-Druid Eclipse, you have to select "Install New Software..." menu voice in "Help" menu.

Install New Software.png

In the "Install" dialog window, you have to push "Add..." button.

Install Add.png

In the "Add Repository" dialog window, you have to push "Archive..." button.

Add Repository Archive.png

You have to select the "Repository Archive" containig the Plug-in to install and push "Open" button.

Repository Archive.png

In the "Add Repository" dialog window, you have to push "OK" button.

Add Repository OK.png

In the "Install Details" dialog window, you have to push "Next >" button.

Install Details Next.png

In the "Install" dialog window, you have to check "Driver configurator Erika Enterprise" and click on the "Next >" button.

Install Next.png

In the "Install Review License" dialog window, you have to accept the terms of license agreements and push "Finish" button.

Install Finish.png

Now you have to wait the installation process to finish.

Installing Software Wait.png

In the "Security Warning" dialog window, you have to push "OK" button.

Security Warning.png

In the "Software Updates" dialog window, you have to push "Yes" button to finalize the installation process and restart RT-Druid Eclipse.

Software Updates.png

Now you have AUTOSAR-like Drivers Configurator plug-in installed in RT-Druid Eclipse.

Plug-in Installation Check

In order to check if the AUTOSAR-like Driver Configurator plug-in is installed in RT-Druid Eclipse, you have to select "About Eclipse" menu voice in "Help" menu.

Help About.png

In the "About Eclipse" dialog window, you have to push the "Evidence" button.

About Eclipse Evidence.png

In the "About Eclipse Features" dialog window, you have to check "Driver configurator Erika Enterprise (Core)" and "Evidece EFORMS core" are installed.

About Eclipse Features.png

Plug-in Installation Removal

In order to remove the AUTOSAR-like Driver Configurator plug-in installed in RT-Druid Eclipse, you have to select "About Eclipse" menu voice in "Help" menu.

Help About.png

In the "About Eclipse" dialog window, you have to push the "Installation Details" button.

About Eclipse Installation Details.png

In the "Eclipse Installation Details" dialog window, you have to select "Driver configurator Erika Enterprise" and "Evidece EFORMS runtime" and then you have to push the "Uninstall..." button.

Eclipse Installation Details Uninstall.png

In the "Uninstall" dialog window, you have to push "Finish" button.

Eclipse Uninstall.png

Now you have to wait the installation removal process to finish.

Eclipse Uninstalling Software.png


In the "Software Updates" dialog window, you have to push "Yes" button to finalize the installation removal process and restart RT-Druid Eclipse.

Software Updates.png

Now you have removed AUTOSAR-like Drivers Configurator plug-in from RT-Druid Eclipse.

Supported Drivers

MCU

The MCU driver provides services for basic microcontroller initialization, power down functionality, reset and microcontroller specific functions required by other MCAL [Microcontroller Abstraction Layer] software modules.

PORT

The PORT driver provide services for initializing the whole PORT structure of the microcontroller.

DIO

The DIO Driver abstracts the access to the microcontroller's hardware pins. Furthermore, it allows the grouping of those pins.

SCI

The SCI Driver provides serial communications services.

GPT

The GPT Driver initializes and controls the internal General Purpose Timer(s) of the microcontroller.

DMA

The DMA Driver provides services to offload data transfer tasks from the μC, allowing for more efficient use of the μC and the available bus bandwidth.

SPI

The SPI Driver provides services for reading from and writing to devices connected via SPI busses. It also provides the required mechanism to configure the onchip SPI peripheral.

WDG

The WDG Driver provides services for initialization, changing the operation mode and setting the trigger condition (timeout) of a watchdog device.

Build

To enable AUTOSAR-like Drivers in Erika Enterprise build process, the following EE_OPT attribute is needed in the OS object of the OSEK/VDX configuration:

 EE_OPT = "__AUTOSAR_R4_0__";

AUTOSAR-like Drivers need to be statically configured through the configurator described above. The configuration process shall generate configuration header and source C files that shall be added to Erika Enterprise build process.

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

 CFLAGS = "-I<PATH>";

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

Note: Each AUTOSAR-like Driver must be enabled individually.

Stand-alone Library

To build a stand-alone library (libas.a) containing build-enabled AUTOSAR-like Drivers, the following code is needed in the OS object of the OSEK/VDX configuration:

 EE_OPT = "__ADD_LIBS__";
 LIB = ENABLE {
   NAME = "AUTOSAR";
 };

It's possible to include into library the drivers configurations by the following EE_OPT attribute in the OS object of the OSEK/VDX configuration:

 EE_OPT = "__NO_APP__";

Supported Architectures

Texas Instruments Stellaris LM4F232xxxx with ARM KEIL uVision Compiler Toolchain

Configuration Instatiation

In order to configure AUTOSAR-like Drivers for Texas Instruments Stellaris LM4F232xxxx with ARM KEIL uVision Compiler Toolchain, you have to create an instance of the drivers configuration inside your RT-Druid Eclipse project.

The first step to do this is to right-click on the project folder in the project explorer.

In the first Context-Menu popped-up, you have to choose the "New" menu voice.

In the next Context-Menu popped-up, you have to select the "Other..." menu voice.

Project New Other.png

In the "New" dialog window, you have to expand the "Evidence" folder, select "Erika Driver Configurator" and then push "Next >" button.

New Evidence Driver Configurator.png

In the "Erika Driver Configuration" dialog window, you may change/choose the drivers configuration instance file name and then you have to push "Finish" button.

Erika Driver Configuration File Name.png

The AUTOSAR-like Drivers configuration instance file is now created and ready to be edited.

Erika Driver Configurator Main.png

Configuration Editing

The edit process for AUTOSAR-like Drivers configuration file is related to each individual driver.

Please refer to specific driver documentation.

Configuration Generation

Once you have edited the configuration file for AUTOSAR-like Drivers you wish to use in your application, to generate the configuration header and source C files for all drivers configured, you have to select "Generate Code" menu voice in the "Erika Driver Editor" Menu.

Erika Driver Editor Generate Code.png

The configured AUTOSAR-like drivers configuration header and source C files will be generated in "src-gen" project folder.

Erika Driver configuration Generated.png

Keil uVision Integration

To integrate AUTOSAR-like Drivers for Texas Instruments Stellaris LM4F232xxxx with ARM KEIL uVision Compiler Toolchain in a ARM KEIL uVision application project, it nees:

  • To add a previously builded libas.a (containing drivers configurations) to a Target Sources Group of ARM KEIL uVision Project.
  • To add AUTOSAR Drivers include path (contrib/as/include/) to ARM KEIL uVision C/C++ compiler include paths.
  • To add AUTOSAR Drivers for Texas Instruments Stellaris LM4F232xxxx with ARM KEIL compiler toolchain contrib/as/arch/stellaris/keil/include/ to Keil uVision C/C++ compiler include paths.
  • To add AUTOSAR Drivers configurations for Texas Instruments Stellaris LM4F232xxxx with ARM KEIL uVision Compiler Toolchain include path to ARM KEIL uVision C/C++ compiler include paths.

See also

Personal tools