汽车电子软件的趋势 - autosar 如何改变您 使用飞思卡...
TRANSCRIPT
TM
Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007.
Nov 28–29, 2007
Andreas Both, 张恩勤
汽车电子软件的趋势汽车电子软件的趋势汽车电子软件的趋势汽车电子软件的趋势 - AUTOSAR 如何改变您如何改变您如何改变您如何改变您
使用飞思卡尔控制器的方式使用飞思卡尔控制器的方式使用飞思卡尔控制器的方式使用飞思卡尔控制器的方式
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 1
摘要摘要摘要摘要
汽车电子软件标准 AUTOSAR 规范了崭新的汽车应用领域软件的体系结构.
沿着 2006年FTF讲座的关于AUTOSAR基本知识介绍,本次将着重介绍分层架构,以及 MCU-相关和 MCU-无关的软件的划分.
我们将展示在遵守AUTOSAR设计方法下,使用飞思卡尔产品将有怎样的变化.
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 2
讲座安排讲座安排讲座安排讲座安排
►AUTOSAR 定义的基础软件
• 分层结构
• MCU-相关的基础软件模块
• MCU-无关的基础软件模块
►AUTOSAR 操作系统探讨
►AUTOSAR 配置方法探讨
►针对飞思卡尔控制器的AUTOSAR 软件
TM
AUTOSAR 基础软件
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 4
ECU-Hardware
AUTOSAR Runtime Environment
ActuatorSoftware
Component
AUTOSARInterface
ApplicationSoftware
Component
SensorSoftware
Component
ApplicationSoftware
Component
..............
AUTOSARSoftware
Basic Software
StandardizedInterface
AUTOSARInterface
AUTOSARInterface
AUTOSARInterface
MicrocontrollerAbstraction
AUTOSARSoftware
Component
Interface
ECUFirmware
StandardSoftware
StandardizedAUTOSARInterface
Services
StandardizedInterface
ECUAbstraction
AUTOSARInterface
StandardizedInterface
ComplexDeviceDrivers
AUTOSARInterface
StandardizedInterface
Communication
StandardizedInterface
StandardizedInterface
OperatingSystem
Sta
nd
ard
ized
Inte
face
AUTOSAR 体系结构体系结构体系结构体系结构
Source: AUTOSAR GbR
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 5
Microcontroller
Microcontroller Abstraction Layer
AUTOSAR Runtime Environment
ECU Abstraction Layer
AUTOSAR BSW 结构结构结构结构—基础层基础层基础层基础层
Services Layer
Co
mp
lex
Dri
ve
r
Bas
ic S
oft
ware
Application LayerApplication
SoftwareComponent
ApplicationSoftware
Component
ApplicationSoftware
Component
ApplicationSoftware
Component
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 6
Microcontroller
AUTOSAR Runtime Environment (RTE)
AUTOSAR BSW 体系结构体系结构体系结构体系结构—细化分层细化分层细化分层细化分层
Co
mp
lex D
river
Bas
ic S
oft
ware
Application Layer
CommunicationServices
MemoryServices
SystemServices
Onboard DeviceAbstraction
Memory HardwareAbstraction
Communication HardwareAbstraction
Microcontroller Drivers Memory Drivers Communication Drivers I/O Drivers
I/O HardwareAbstraction
Op
era
tin
g S
yste
m
ApplicationSoftware
Component
ApplicationSoftware
Component
ApplicationSoftware
Component
ApplicationSoftware
Component
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 7
微控制器驱动微控制器驱动微控制器驱动微控制器驱动
• 内部外设的驱动 (e.g., watchdog, 通用时钟)• 直接 µC可存取的功能 (e.g., Core测试)
Microcontroller Hardware A
DC
DIO
Tim
er
PW
M
LIN
/ S
CI
CA
N
SP
I
EE
PR
OM
Fla
sh
WD
T
GP
T
Microcontroller (MCU)Drivers
Watc
hdog
Driver
MC
UD
river
GP
T D
river
MC
U
Pow
er
&
Clo
ck U
nit
微控制器抽象层微控制器抽象层微控制器抽象层微控制器抽象层
PO
RT
S
Fle
xRa
y™
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 8
Microcontroller Hardware A
DC
DIO
Tim
er
PW
M
LIN
/ S
CI
CA
N
SP
I
EE
PR
OM
Fla
sh
WD
T
GP
T
Microcontroller Drivers Memory Drivers
RA
M T
est
Em
bedde
dE
EP
RO
M D
river
Em
bedde
dF
lash D
river
Watc
hdog
Driver
MC
UD
river
GP
T D
river
MC
U
Pow
er
&
Clo
ck U
nit
微控制器抽象层微控制器抽象层微控制器抽象层微控制器抽象层
PO
RT
S
Fle
xRa
y™
内存控制器内存控制器内存控制器内存控制器
• 片上内存设备的驱动 (e.g., 内部 flash, 内部 EEPROM)
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 9
通信驱动通信驱动通信驱动通信驱动
• ECU 板级上的通信驱动: SPI, I2C• 车载通信驱动: LIN, CAN, FlexRay™网络
Microcontroller Hardware A
DC
DIO
Tim
er
PW
M
LIN
/ S
CI
CA
N
SP
I
EE
PR
OM
Fla
sh
WD
T
GP
T
Microcontroller Drivers Communication DriversMemory Drivers
RA
M T
est
CA
N D
river
Em
bedde
dE
EP
RO
M D
river
Em
bedde
dF
lash D
river
Watc
hdog
Driver
LIN
Driver
MC
UD
river
Fle
xRa
y™
Driver
GP
T D
river
SP
I D
river
MC
U
Pow
er
&
Clo
ck U
nit
微控制器抽象层微控制器抽象层微控制器抽象层微控制器抽象层
PO
RT
S
Fle
xRa
y
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 10
I/O 驱动驱动驱动驱动
• 模拟和数字 I/O驱动: e.g., 模数转换器(ADC), 脉宽调制(PWM), 数字输入输出 (DIO)
Microcontroller Hardware A
DC
DIO
Tim
er
I/O Drivers
PO
RT
Driver
AD
C D
river
DIO
Driver
PW
M D
river
ICU
Driver
PW
M
LIN
/ S
CI
CA
N
SP
I
EE
PR
OM
FLA
SH
WD
T
GP
T
Microcontroller Drivers Communication DriversMemory Drivers
RA
M T
est
CA
N D
river
Em
bedde
dE
EP
RO
M D
river
Em
bedde
dF
lash D
river
Watc
hdog
Driver
LIN
Driver
MC
UD
river
Fle
xRa
yD
river
GP
T D
river
SP
I D
river
MC
U
Pow
er
&
Clo
ck U
nit
微控制器抽象层微控制器抽象层微控制器抽象层微控制器抽象层
PO
RT
S
Fle
xRa
y™
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 11
微控制器抽象层的驱动微控制器抽象层的驱动微控制器抽象层的驱动微控制器抽象层的驱动
• 直接与微控制器硬件接口 (核和外设)• 包括以下软件模块:
•微控制器驱动•内存驱动•通信驱动• I/O 驱动
Microcontroller Hardware A
DC
DIO
Tim
er
I/O Drivers
PO
RT
Driver
AD
C D
river
DIO
Driver
PW
M D
river
ICU
Driver
PW
M
LIN
/ S
CI
CA
N
SP
I
EE
PR
OM
Fla
sh
WD
T
GP
T
Microcontroller Drivers Communication DriversMemory Drivers
RA
M T
est
CA
N D
river
Inte
rnalE
EP
RO
M D
river
Inte
rnalF
lash D
river
Watc
hdog
Driver
LIN
Driver
MC
UD
river
Fle
xRa
y™
Driver
GP
T D
river
SP
I D
river
MC
U
Pow
er
&
Clo
ck U
nit
微控制器抽象层微控制器抽象层微控制器抽象层微控制器抽象层
PO
RT
S
Fle
xRa
y
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 12
复杂驱动复杂驱动复杂驱动复杂驱动
Microcontroller
AUTOSAR Runtime Environment (RTE)
Co
mp
lex D
riv
er
Basic
So
ftw
are
(B
SW
)
Application Layer
CommunicationServices
MemoryServices
SystemServices
Onboard DeviceAbstraction
Memory HardwareAbstraction
Communication HardwareAbstraction
Microcontroller Drivers Memory Drivers Communication Drivers I/O Drivers
I/O Hardware
Abstraction
Op
era
tin
g S
ys
tem
Application
Software
Component
Application
Software
Component
Application
Software
Component
Application
Software
Component
复杂驱动复杂驱动复杂驱动复杂驱动
• 通过采用特定中断或者复杂的外设(如 eTPU)的微控制器直接访问,实施复杂的传感器检测和执行单元控制
• 例子:•喷油控制•电子阀门控制•递增式位置检测
Complex Drivers
Ele
ctr
ic V
alv
eC
on
tro
l
Inje
ctio
nC
on
tro
l
Incre
men
talP
ositio
n D
ete
ctio
n
Co
mp
lex
De
vic
eD
rive
r X
Y
µC
eT
PU
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 13
通信硬件抽象层通信硬件抽象层通信硬件抽象层通信硬件抽象层
Microcontroller
AUTOSAR Runtime Environment (RTE)
Co
mp
lex D
riv
er
Basic
So
ftw
are
(B
SW
)
Application Layer
CommunicationServices
MemoryServices
SystemServices
Onboard DeviceAbstraction
Memory HardwareAbstraction
Communication HardwareAbstraction
Microcontroller Drivers Memory Drivers Communication Drivers I/O Drivers
I/O Hardware
Abstraction
Op
era
tin
g S
ys
tem
Application
Software
Component
Application
Software
Component
Application
Software
Component
Application
Software
Component
通信硬件抽象层通信硬件抽象层通信硬件抽象层通信硬件抽象层
• 对于内部和ECU硬件架构上外部通信控制器的抽象
• 对于所有的通信系统 (LIN, CAN, FlexRay),都需要特定的通信硬件抽象:• LIN 接口• CAN 接口• FlexRay 接口
• Freescale MCUs 具有 on-chip CAN 控制器,因此外部的 CAN ASIC 一般
不需要
Communication HardwareAbstraction
CommunicationDrivers
I/ODrivers
Driver for External
CAN ASIC
µC
CA
N
SP
I
CA
N D
river
SP
I D
river
DIO
Driver
DIO
CAN
Trans-ceiver Driver
CAN Interface
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 14
内存硬件抽象层内存硬件抽象层内存硬件抽象层内存硬件抽象层
Microcontroller
AUTOSAR Runtime Environment (RTE)
Co
mp
lex D
riv
er
Basic
So
ftw
are
(B
SW
)
Application Layer
CommunicationServices
MemoryServices
SystemServices
Onboard DeviceAbstraction
Memory HardwareAbstraction
Communication HardwareAbstraction
Microcontroller Drivers Memory Drivers Communication Drivers I/O Drivers
I/O Hardware
Abstraction
Op
era
tin
g S
ys
tem
Application
Software
Component
Application
Software
Component
Application
Software
Component
Application
Software
Component
内存硬件抽象内存硬件抽象内存硬件抽象内存硬件抽象
• 对于内存外设和板级的内存设备的抽象• Freescale MCUs 具有 on-chip (embedded) flash,可以仿真 EEPROM. 因此,这一层只需要两个模块:
• Flash EEPROM 仿真•内存抽象接口
Memory HardwareAbstraction
Memory DriversComDrivers
Memory Abstraction Interface
µC
Fla
sh
EE
PR
OM
Inte
rnal
Fla
sh
Driver
EE
PR
OM
Driver
SP
ID
river
SP
I
External
EEPROMDriver
EEPROM Abstraction
Flash EEPROM Emulation
External
FlashDriver
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 15
通信软件包通信软件包通信软件包通信软件包
Microcontroller
AUTOSAR Runtime Environment (RTE)
Co
mp
lex D
riv
er
Basic
So
ftw
are
(B
SW
)
Application Layer
CommunicationServices
MemoryServices
SystemServices
Onboard DeviceAbstraction
Memory HardwareAbstraction
Communication HardwareAbstraction
Microcontroller Drivers Memory Drivers Communication Drivers I/O Drivers
I/O Hardware
Abstraction
Op
era
tin
g S
ys
tem
Application
Software
Component
Application
Software
Component
Application
Software
Component
Application
Software
Component
通信协议栈通信协议栈通信协议栈通信协议栈
• 对于三种主要的车载通信协议 LIN, CAN 和 FlexRay,提供一致的软件结构。
• Autosar COM, DCM 和 Generic NM 模块都是协议无关的,适用于所有的通信,与物理层协议无关。
• Signal GW 和 PDU router 提供了基于信号和帧的网关功能
Communication HardwareAbstraction
Communication Drivers
µC
CA
NC
AN
Driver
SC
I
FlexRay Interface
LIN
Driver
Fle
xRa
y
Driver
Fle
xRa
y
CAN Interface
LIN Interface
Communication Services
DCMCOM
Signal
GW
Generic NM
PDU Router
FlexRay
NM
LIN NM
CAN NM
CAN TP
FlexRay™
TP
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 16
内存服务内存服务内存服务内存服务
Microcontroller
AUTOSAR Runtime Environment (RTE)
Co
mp
lex D
riv
er
Basic
So
ftw
are
(B
SW
)
Application Layer
CommunicationServices
MemoryServices
SystemServices
Onboard DeviceAbstraction
Memory HardwareAbstraction
Communication HardwareAbstraction
Microcontroller Drivers Memory Drivers Communication Drivers I/O Drivers
I/O Hardware
Abstraction
Op
era
tin
g S
ys
tem
Application
Software
Component
Application
Software
Component
Application
Software
Component
Application
Software
Component
内存服务内存服务内存服务内存服务
• 提供非易失数据的管理功能,例如数据存取,冗余校验保护,和可靠存储• 采用不同的内存驱动• 采取 RAM 映射作为应用程序快速读取数据的接口• NVRAM Manager 模块是 MCU 无关的
Memory Services
NVRAM Manager
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 17
系统服务系统服务系统服务系统服务
Microcontroller
AUTOSAR Runtime Environment (RTE)
Co
mp
lex D
riv
er
Basic
So
ftw
are
(B
SW
)
Application Layer
CommunicationServices
MemoryServices
SystemServices
Onboard DeviceAbstraction
Memory HardwareAbstraction
Communication HardwareAbstraction
Microcontroller Drivers Memory Drivers Communication Drivers I/O Drivers
I/O Hardware
Abstraction
Op
era
tin
g S
ys
tem
Application
Software
Component
Application
Software
Component
Application
Software
Component
Application
Software
Component
系统服务系统服务系统服务系统服务
• 提供一些功能以供别的模块调用,如诊断事件管理 (DEM), 诊断错误跟踪 (DET), 操作系统 (OS)
• OS 是与 MCU相关的系统服务,需要针对于每个MCU优化• 其余模块可以是应用或硬件相关的(e.g., ECU state manager)
System Services
Co
mm
un
ica
tio
nM
an
ag
er
EC
U S
tate
Ma
na
ge
r
Fu
nction
Inh
ibitio
nM
an
ag
er
Watc
hd
og
Ma
na
ge
r
Dia
gno
stic E
ve
nt
Ma
na
ge
r
Dia
gno
stic E
rro
rT
race
r
Opera
ting S
yste
m
CRC Library
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 18
AUTOSAR Release 2.1
►基础软件模块: 46 modules
►基础软件文档: 3609 pages
►其他文档: 1957 pages
►辅助文档
以上虽然不是一个很好的度量方法,但足以看出 AUTOSAR基础软件的复杂性。
Q: 全部的AUTOSAR基础软件模块是否是每个 MCU必需的?A: 不是的。请看下面的例子。
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 19
例子例子例子例子: S12XEP100 AUTOSAR 内存软件栈内存软件栈内存软件栈内存软件栈
Memory HardwareAbstraction
Memory DriversComDrivers
Memory Abstraction Interface
µC
FLA
SH
Virtu
al
NV
RA
M
Inte
rnal
Fla
sh
Driver
EE
PR
OM
Driver
SP
ID
river
SP
I
External
EEPROMDriver
EEPROM Abstraction
Flash EEPROM Emulation
External
FlashDriver
On-chip EEE of configurable size — no EEPROM driver needed
On-chip EEE of configurable size — no external EEPROM driver needed
EEE provides abstraction — no EEPROM Abstraction module needed, Flash EEPROM Emulation module significantly simplified
On-chip flash — no External Flash driver needed
►智能的 MCU 外设将大大简化 BSW 内存软
件栈。
TM
AUTOSAR 操作系统
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 21
AUTOSAR OS 展示展示展示展示
►AUTOSAR OS 是 OSEK/VDX™ OS 加上:
• 新的核心功能
� 软件和硬件计数器
� 基于时间同步的调度表
� 堆栈监视
• 保护功能
� 定时保护, 内存保护和服务保护
� OS 应用程序, 信任的和不信任的代码
� Protection hook
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 22
OSEK OS (all conformance classes)
Counter Interface
Schedule Tables
Stack Monitoring
Protection Hook
Timing Protection
Global Time/Synchronization Support
Memory Protection
OS Applications
Service Protection
CallTrustedFunction
Sca
lab
ility
Cla
ss 1
Sca
lab
ility
Cla
ss 2
Sca
lab
ility
Cla
ss 3
Sca
lab
ility
Cla
ss 4
� � � �
� � � �
� � � �
� � � �
� � �
� �
� �
� �
� �
� �
� �
AUTOSAR OS Scalability Classes 1–4
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 23
OS 应用以及可信任和不信任代码应用以及可信任和不信任代码应用以及可信任和不信任代码应用以及可信任和不信任代码
►完整性: 可信任和不信任代码
►OS 应用• 一组软件包括 tasks, ISRs, hooks 和 trusted 函数
• Trusted:具有无限制的存取权限
• Non-trusted:受限制的存取权限
►可信任函数
• 具有无限制存取权限的一种服务功能
• 由一个 trusted OS 应用提供
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 24
AUTOSAR OS 内存保护内存保护内存保护内存保护
►保护的边界
• Task/category 2 ISR
• OS application (all its Task/Category 2 ISRs)
►保护的内存
• Stack RAM
• Private data RAM
• Code flash
►受保护的存取方式
• 主要是写保护,读和执行保护是可选的
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 25
Protection Hook
►The Protection Hook• 在所有的保护出错被调用 (memory / service / timing)
• 根据返回值确定采取的操作:� Kill the faulty Task/Category 2 ISR, or
� Kill the faulty OS application, or
� Kill the faulty OS application and restart the OS application, or
� Call ShutdownOS()
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 26
内存保护的使用内存保护的使用内存保护的使用内存保护的使用
►不信任 OS 应用任务• 只能存取它所需要的内存
• 因此,不是指这一应用任务受保护,而是其他任务与它隔离
►内存保护可被用于以下
• 分离运行于同一 MCU的不同应用程序
• 分离来自于不同供应商的控制功能模块
• 实现安全性限制
• 作为一种调试功能 (防止错误的内存访问,防止堆栈溢出,protection hook 将被调用)
►内存保护必须有片上 MPU的支持
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 27
服务保护的使用服务保护的使用服务保护的使用服务保护的使用
►服务保护
• 保护一个 OS应用调用错误或被破坏的 OS服务
• 例子
� OS Application 调用 ShutDownOS()
� OS Application 试图通过执行 ActivateTask() 激活别的 OS Application的任务
• 在出现服务保护错误时,Protection Hook 将被调用
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 28
定时保护的使用以及全局时间定时保护的使用以及全局时间定时保护的使用以及全局时间定时保护的使用以及全局时间
►定时保护
• 执行时间增强
� 限制中断,资源锁定和中断屏蔽时间在一个静态可配置的时间 („time budget“)
• 调用频率增强
� 限制中断在指定时间内的调用次数在一个静态可配置的界限
• 在出现时间保护错误时,Protection Hook 将被调用
►全局时间 / 同步支持• 需要一个全局的时间源,例如 FlexRay 网络时间
• 这一功能通过 OS服务调用使得调度表与全局时间同步
TM
AUTOSAR 配置方法
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 30
BSW 配置分类配置分类配置分类配置分类
► 预编译阶段配置
• 在编译后,配置参数将不能被改变
• 需要提供源程序
► 连接阶段配置
• 配置决定于 linker scripts
• 在 link后,配置参数将不能被改变
• 适于提供 object code
► 生成后配置
• 生成后可载入的
� 配置参数在生成结束后可更改,不需要重新烧写 ECU
• 生成后可选择的
� 在启动阶段配置参数可从多组选项中选择
� 所有可能的配置选项都包含在编译阶段
• 配置参数存储在已知的内存空间地址
• 可提供 source 和 object code
• 生成后配置类的 BSW 模块可提供预编译或连接时的参数设置(并非所有的参数都可生成后配置)
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 31
基础软件配置流程基础软件配置流程基础软件配置流程基础软件配置流程
.h
.c
.h
.c
.h
.c
.h
.c
ECU Configuration Description
(XML)
MCAL Generators
Communication Services
Generator
OS Generator
RTE Generator
AUTOSAR BSWConfiguration Tool
AUTOSAR SystemDesign Tool
ECU Parameter Definitions
(XML)
ECU Parameter Definitions
(XML)
ECU Parameter Definitions
(XML)
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 32
AUTOSAR BSW 配置工具配置工具配置工具配置工具
例子例子例子例子: tresos® ECU► 图形化的 ECU 配置描
述 (ECD)
► ECD的输入 /输出
► 使用预编译方式,可方
便配置 AUTOSAR
BSW
Source: Elektrobit Automotive
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 33
...
void functionality2()
{ int8 localVar;
Read_in_speed(&localVar)
;
...
}
...
void functionality2()
{ int8 localVar;
Read_in_speed(&localVar)
;
...
}
Application SWC 1 Application SWC 2
...
void functionality1()
{
Write_out_speed(…);
...
Call_actuator_set(...);
}
...
void functionality1()
{
Write_out_speed(…);
...
Call_actuator_set(...);
}
out in
<<Interface>>
int8 speed;
<<Interface>>
int8 speed;
ECU1
#define Read_in_speed(vp) \
*(vp) = velocityVar
int8 velocityVar;
#define Write_out_speed(v) \
velocityVar = (v)
AUTOSAR RTE 生成生成生成生成例子例子例子例子: 单个单个单个单个 ECU上的上的上的上的SWCs
Source: dSpace
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 34
...
void functionality2()
{ int8 localVar;
Read_in_speed(&localVar)
;
...
}
...
void functionality2()
{ int8 localVar;
Read_in_speed(&localVar)
;
...
}
Application SWC 1 Application SWC 2
...
void functionality1()
{
Write_out_speed(…);
...
Call_actuator_set(...);
}
...
void functionality1()
{
Write_out_speed(…);
...
Call_actuator_set(...);
}
out in
<<Interface>>
int8 speed;
<<Interface>>
int8 speed;
ECU2
#define Read_in_speed(vp) \ReceiveMessage (msgID, vp);
#define Write_out_speed(v) \SendMessage(msgID, v)
AUTOSAR RTE 生成生成生成生成例子例子例子例子: 俩个俩个俩个俩个ECUs上的上的上的上的SWCs
Source: dSpace
ECU1
CAN
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 35
AUTOSAR
Application SWC 1
AUTOSAR
Application SWC 1
This environment and ECU dependent “gluing”code is generated by the so-called AUTOSAR RTE Generator.
AUTOSAR
Application SWC 2
AUTOSAR
Application SWC 2
AUTOSAR
I/O Driver
AUTOSAR
I/O Driver
GluingCode
RTEGenerator
AUTOSAR RTE 生成生成生成生成
GluingCode
Source: dSpace
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 36
AUTOSAR 应用程序生成应用程序生成应用程序生成应用程序生成
例子例子例子例子: SystemDeskTM
► SystemDesk以以下方式支持 ECU 网络应用程序的开发:• 设计分布式的系统和软件结构
• 将软件模块集成在一个软件架构和ECUs上• 符合 AUTOSAR 模型• 集成与功能开发工具上,如 TargetLink
Source: dSpace
TM
针对飞思卡尔控制器的AUTOSAR 软件
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 38
Freescale提供的是提供的是提供的是提供的是 AUTOSAR 基础软件基础软件基础软件基础软件
I/O
Drivers
LIN Driver CAN Driver FlexRay Driver
FlexRay
InterfaceCAN Interface
LIN Interface
LIN Master
Stack
CAN TL FlexRay™ TL
EE
PR
OM
Dri
ver/
Inte
rface
Fla
sh
Dri
ver/
Intf
c
CA
N N
M
FR
NM
Generic NM NVRAM
Manager
EEPROM
Emulation
IO Abstraction
PDU Router
Sig
nal
Gate
wa
y
WD
G D
river
/
Inte
rface
SP
I D
river
/
Inte
rface
MCU Driver
EC
U M
anager
CO
M M
anager
FIM
DE
T
CR
C
DE
M
DC
M
WD
G M
anager
AU
TO
SA
R O
S
AU
TO
SA
R
CO
M
Microcontroller
AUTOSAR RTE
Com
ple
x D
evic
e D
rivers
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 39
AUTOSAR 软件产品选项软件产品选项软件产品选项软件产品选项
来自于 AUTOSAR 软件 “产品包" :
1) SPAL Plus = MCAL + EEPROM emulation + IO abstraction layer
2) Operating system
3) Add-on services
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 40
SPAL Plus
► MCAL + EEPROM emulation + IO abstraction layer► 所有部件可使用符合 AUTOSAR 规范的配置工具配置
I/O
DriversFlexRay
Interface
CAN
Interface
LIN
Interface
LIN Master
Stack
CAN TL FlexRay TL
EE
PR
OM
Dri
ver/
Inte
rface
Fla
sh
Dri
ver/
Inte
rface
EEPROM
Emulation
I/O Abstraction
WD
G D
river
/
Inte
rface
SP
I D
river
/
Inte
rfaceMCU Driver
Microcontroller
Generic NM NVRAM
Manager
PDU Router
Sig
nal
Gate
wa
y
EC
U M
anager
CO
M M
anager
FIM
DE
T
CR
C
DE
M
DC
M
WD
G M
anager
AU
TO
SA
R O
S AU
TO
SA
R
CO
M
AUTOSAR RTE
Com
ple
x D
evic
e d
rive
rs
CA
N N
M
FR
NM
LIN Driver CAN Driver FR Driver
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 41
AUTOSAR 操作系统操作系统操作系统操作系统
I/O
Drivers
LIN Driver CAN Driver FR Driver
FR
Interface
CAN
Interface
LIN Interface
LIN Master
Stack
CAN TL FlexRay TL
EE
PR
OM
Dri
ver
/ In
terf
ace
Fla
sh
Dri
ver
/ In
terf
ace
EEPROM
Emulation
I/O Abstraction
MCU Driver
Microcontroller
Generic NM NVRAM
Manager
PDU Router
Sig
nal
Gate
wa
y
EC
U M
anager
CO
M M
anager
FIM
DE
T
CR
C
DE
M
DC
M
WD
G M
anager
AU
TO
SA
R
CO
M
AUTOSAR RTE
Com
ple
x D
evic
e D
rive
rs
AU
TO
SA
R O
S
WD
G D
river
/
Inte
rface
SP
I D
river
/
Inte
rface
CA
N N
M
FR
NM
►可使用符合 AUTOSAR 规范的配置工具配置
► 有四种可调配的级别 1, 2, 3, 4,以适合不同的应用要求
• SC1 –确定性的 RTOS 基础 (tasks, events, counters, alarms, messages)• SC2 –基于时间的任务管理 (low-latency, precise timing for periodic tasks)• SC3 –任务级的内存保护 (MMU/MPU),以避免安全系统的内存冲突问题• SC4 –任务级的时间和内存保护,充分利用芯片的功能,以提供汽车领域 RTOS的安全保护
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 42
软件质量体系保证软件质量体系保证软件质量体系保证软件质量体系保证
► 质量体系质量体系质量体系质量体系
• SPAL Plus team: CMM level 3 flow, certified to ISO 9001-2000
� move to CMMI in preparation
• OS team: CMM level 3 flow, certified to ISO 90003-2004
� comparable to ISO 15504 (SPICE), ISO 12207, and CMMI continuous
► 测试流程测试流程测试流程测试流程
• 单元测试
• 系统测试
• 代码审阅
► MISRA (PClint)
• Freescale AUTOSAR 驱动是部分符合 MISRA 标准的,所有不符合的部分都在原程序中采用以下形式的注释表明:// MISRA Rule #<id> deviation: <reason>
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 43
模块测试计划模块测试计划模块测试计划模块测试计划 / 测试报告测试报告测试报告测试报告
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 44
Freescale SPAL Plus 软件包内容软件包内容软件包内容软件包内容
can_freescale_mpc5516
cfg1
ssc
doc
inc
lib
mak
src
doc
gce_input
generator
inc
lib
mak
obj
src
can.c
can_Irq.c
Makefile
can.h
can_Irq.h
Can_TS_T22D1M2I0R0
autosar
Can.epc
Can.xdm
configCan.epd
Can_Cfg.h
Can_PBCfg.h
generate
src
include
Can_PBCfg.c
Can_defs.mak
Can_rules.mak
make
AUTOSAR_MPC5516_CAN_UM.pdf
Can_Cfg.h
Can_PBCfg.h
Makefile
Can_Cfg.h
Can_PBCfg.hUser Manual
Default Configuration
Driver Source Code + Makefile
AUTOSAR XML Configuration Files- Parameter Description- ECU Configuration Description- Plugin configuration (TresosECUtm)
Pre-compile + post-build configuration
parameters
Generator Makefiles
Example: CAN Driver for MPC5516
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 45
Freescale提供的提供的提供的提供的 AUTOSAR 软件软件软件软件
►以下 Freescale 处理器结构将支持 AUTOSAR标准的产品级软件:
• 16-bit : S12XE family
• 16-bit : S12XD family
• 32-bit : MPC556x family
• 32-bit : MPC551x family
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 46
S12X AUTOSAR OS/SPAL Roadmap 2007(subject to change)
Production Beta / Release Product
Beta / ESS / FC- Functionality may not be complete- largely tested, including documentation
Alpha- Functionality may not be complete- not tested, no documentation- NO DELIVERY TO CUSTOMERS
2007
S12XE/CW
• AUTOSAR 2.0/2.1
• Excluding LIN,
CAN Drivers
S12XE/CW
• AUTOSAR 2.0
• SC 1–4
S12XE/CW
• AUTOSAR 2.0
• excl LIN, CAN
SPAL Plus Available 02/07
OS Available 02/07
S12XD, XE/CW
• AUTOSAR 2.0
• SC 1–4 (XE)
• SC 1–2 (XD)
SPAL Plus
OS
SeptAugJulJunMayAprMarFebJan Oct Nov
+ LIN, CAN Drivers
S12XDT /CW
• AUTOSAR 2.0/2.1
S12XDP /CW
• AUTOSAR 2.0/2.1
S12XD/CW
• AUTOSAR 2.1• SC 1–2
Dec
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 47
MPC556x AUTOSAR OS/SPAL Roadmap 2007(subject to change)
Production Beta / Release Product
Beta / ESS / FC- Functionality may not be complete- largely tested, incl. documentation
Alpha- Functionality may not be complete- not tested, no documentation- NO DELIVERY TO CUSTOMERS
2007
MPC5567/WRS
• AUTOSAR 2.1
• No LIN, CAN, FlexRay
MPC556x/CW
• AUTOSAR 2.0
• SC 1–4
MPC556x/CW/WRS
• AUTOSAR 2.1• SC 1–4
/WRS
SPAL Plus
OS
SeptAugJulJunMayAprMarFebJan Oct Nov
MPC5567/WRS
• AUTOSAR 2.1
• Including LIN, CAN, FlexRay
MPC5567/GHS
• AUTOSAR 2.0• No LIN, CAN, FlexRay™
SPAL Plus Available 02/07
OS Available 03/07
MPC556x/CW
• AUTOSAR 2.0• SC 1–4
Dec
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 48
MPC5516/GHS
• MCU, PORT, DIO, GPT, CAN,PWM, LIN, FR, WDG
• AUTOSAR 2.1
MPC551x AUTOSAR OS/SPAL Roadmap 2007(subject to change)
Production Beta / Release Product
Beta / ESS / FC- Functionality may not be complete- largely tested, incl. documentation
Alpha- Functionality may not be complete- not tested, no documentation- NO DELIVERY TO CUSTOMERS
2007
MPC5516/GHS
• MCU, GPT, PORT, DIO, CAN only
• AUTOSAR 2.1
MPC5516/GHS
• AUTOSAR 2.1
MPC5510/GHS/CW
• AUTOSAR 2.1
• Single-core OS
• SC 1–4
OS
SeptAugJulJunMayAprMarFebJan Oct Nov Dec
MPC5567/GHS
• AUTOSAR 2.0
• No LIN, CAN, FlexRay
SPAL Plus Available 02/07
OS Available 02/07
MPC5560/CW
• AUTOSAR 2.0
• SC 1–4
MPC5510/GHS/CW
• AUTOSAR 2.1
• Single-core OS
• SC 1–4
SPAL Plus
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 49
AUTOSAR 软件商业模式软件商业模式软件商业模式软件商业模式
• To “customize” standard products
• To migrate from legacy software
服务和咨询服务和咨询服务和咨询服务和咨询
• CMM/SPICE compliant development
processes
• Process documentation available upon
request
质量保证质量保证质量保证质量保证
• SPAL Plus
• Operating system
• Add-on services
AUTOSAR 标准软件产品标准软件产品标准软件产品标准软件产品
• Dedicated resources at Freescale
• Agreed upon definitions of severity levels
and resolution times
• Custom service level agreements with
customer; pricing to be negotiated
特别支持特别支持特别支持特别支持
• Restricted liability in line with software
pricing
责任责任责任责任
• Project Buyout—Pay per project per core;
example: AUTOSAR product for 2009 BMW
Door Module using S12XE
• Core Buyout—Pay per core; use in
unlimited projects. Example: AUTOSAR
product for S12XE
免版税的价格模式免版税的价格模式免版税的价格模式免版税的价格模式
• Basic phone and e-mail support
• Support fee is percentage of list price
标准支持标准支持标准支持标准支持
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 50
为什么选择为什么选择为什么选择为什么选择 Freescale 的的的的 AUTOSAR 软件软件软件软件?
► 优化优化优化优化—我们长期的承诺我们长期的承诺我们长期的承诺我们长期的承诺
• Freescale 掌握芯片技术的细节,直到如何最好的使用芯片资源以提供软件模块的优化。
► 质量质量质量质量
• 采用已经验证的开发流程 (CMM/SPICE),提供 AUTOSAR 软件给主要的汽车客户,以驱动质量和成本的有效性
► 紧随芯片的发展蓝图紧随芯片的发展蓝图紧随芯片的发展蓝图紧随芯片的发展蓝图
• Freescale 支持 S12X 和 MPC55xx MCU 产品系列的 AUTOSAR 软件;客户可选择我们的 16- and 32-bit MCU 产品系列,加上 AUTOSAR 软件的支持。
► 全球支持全球支持全球支持全球支持
• 通过我们的全球客户支持体系架构。
► 软件服务团对软件服务团对软件服务团对软件服务团对
• 帮助将 Freescale AUTOSAR 软件集成于客户的软件架构体系和客户的模块开发中
TMFreescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are
the property of their respective owners. © Freescale Semiconductor, Inc. 2007. 51
总结总结总结总结
►AUTOSAR 描述了一个适用于汽车领域的完整的软件架构,包括基础软件
包,灵活的配置方法,以及软件工具的接口和应用指导
►可现用的软件模块,加上完备的配置方法将改变您使用 Freescale微控制器的方式
• 减少 ECU 开发时间
• 增强基础软件模块的重复使用率和质量保证
• 增强应用软件模块的重复使用率和质量保证
►Freescale 通过提供针对于我们16位和32位汽车级微控制器的可生产级的AUTOSAR软件,减轻了客户向 AUTOSAR 软件转变的难度
• 操作系统
• SPAL Plus 软件包
• 增值服务
TM