Stellaris AUTOSAR Drivers
From ErikaWiki
Contents |
AUTOSAR Drivers
To enable AUTOSAR Drivers for Texas Instruments Stellaris LM4F232H5QD evaluation board and Keil ARM compiler, the following EE_OPT
attribute is needed in the OS
object of the OSEK/VDX configuration:
EE_OPT = "__AUTOSAR_R4_0__";
AUTOSAR Drivers need to be configured by C header compiler file (Compiler_Cfg.h). These file (for now) needs to be manually written.
Template of these file can be found in contrib/as/arch/stellaris/config/.
The configuration C header compiler file 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 compiler file is stored.
Note: Each AUTOSAR Driver must be enabled individually.
AUTOSAR MCU Driver
To enable AUTOSAR MCU Driver for Texas Instruments Stellaris LM4F232H5QD evaluation board and Keil ARM compiler, the following EE_OPT
attribute is needed in the OS
object of the OSEK/VDX configuration:
EE_OPT = "__AS_MCU_DRIVER__";
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.
Templates of these files can be found in contrib/as/arch/stellaris/config/.
The configuration C header file 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 file is stored.
Instead the configurations C source file is added to the compilation process by APP_SRC
attribute in the CPU_DATA
object of the OSEK/VDX configuration:
APP_SRC = "<PATH>/Mcu_Cfg.c";
Where <PATH>
is the absolute or relative directory path which configuration C source file is stored.
AUTOSAR PORT Driver
To enable AUTOSAR PORT Driver for Texas Instruments Stellaris LM4F232H5QD evaluation board and Keil ARM compiler, the following EE_OPT
attribute is needed in the OS
object of the OSEK/VDX configuration:
EE_OPT = "__AS_PORT_DRIVER__";
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.
Templates of these files can be found in contrib/as/arch/stellaris/config/.
The configuration C header file 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 file is stored.
Instead the configurations C source file is added to the compilation process by APP_SRC
attribute in the CPU_DATA
object of the OSEK/VDX configuration:
APP_SRC = "<PATH>/Port_Cfg.c";
Where <PATH>
is the absolute or relative directory path which configuration C source file is stored.
AUTOSAR DIO Driver
To enable AUTOSAR DIO Driver for Texas Instruments Stellaris LM4F232H5QD evaluation board and Keil ARM compiler, the following EE_OPT
attribute is needed in the OS
object of the OSEK/VDX configuration:
EE_OPT = "__AS_DIO_DRIVER__";
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.
Templates of these files can be found in contrib/as/arch/stellaris/config/.
The configuration C header file 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 file is stored.
Instead the configurations C source file is added to the compilation process by APP_SRC
attribute in the CPU_DATA
object of the OSEK/VDX configuration:
APP_SRC = "<PATH>/Dio_Cfg.c";
Where <PATH>
is the absolute or relative directory path which configuration C source file is stored.
AUTOSAR SCI Driver
To enable AUTOSAR SCI Driver for Texas Instruments Stellaris LM4F232H5QD evaluation board and Keil ARM compiler, the following EE_OPT
attribute is needed in the OS
object of the OSEK/VDX configuration:
EE_OPT = "__AS_SCI_DRIVER__";
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.
Templates of these files can be found in contrib/as/arch/stellaris/config/.
The configuration C header file 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 file is stored.
Instead the configurations C source file is added to the compilation process by APP_SRC
attribute in the CPU_DATA
object of the OSEK/VDX configuration:
APP_SRC = "<PATH>/Sci_Cfg.c";
Where <PATH>
is the absolute or relative directory path which configuration C source file is stored.
To use the SCI driver in interrupt mode, an ISR object must be added to OSEK/VDX configuration for every SCI Channel:
ISR Sci_Channel_<Channel Number>_ISR { CATEGORY = 2; ENTRY = "UART_<Channel Number>"; PRIORITY = <ISR Priority>; };
Where <Channel Number>
is the "channel number" as stated in the SCI Driver Channel Identifier of the channel and <ISR Priority>
is a number between 0 and 7 indicating the level of priority (0: Highest, 7: Lowest).
An example of the use of SCI Driver in interrupt mode can be found at examples/cortex_mx/lm4f232xxxx/as/ASSCI3
Stand-alone Library
To build a stand-alone library (libas.a) containing enabled AUTOSAR Drivers for Texas Instruments Stellaris LM4F232H5QD evaluation board and Keil ARM compiler, 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__";
Keil uVision Integration
To integrate AUTOSAR Drivers or Texas Instruments Stellaris LM4F232H5QD evaluation board in a Keil uVision application project, it nees:
- To add a previously builded libas.a (containing drivers configurations) to a Target Sources Group of Keil uVision Project.
- To add AUTOSAR Drivers include path (contrib/as/include/) to Keil uVision C/C++ compiler include paths.
- To add AUTOSAR Drivers for Texas Instruments Stellaris LM4F232H5QD evaluation board and Keil compiler 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 and Keil compiler include path to Keil uVision C/C++ compiler include paths.
See also
- ARM Cortex MX#Building stand-alone libee.a using RT-Druid Eclipse
- ARM Cortex MX#Building ERIKA based application using KEIL uVision
- AUTOSAR - Automotive Open System Architecture - Web site
- Texas Instruments - Stellaris LM4F232 USB+CAN Evaluation Kits - Web site
- Keil Embedded Development Tools Web site