当前位置:网站首页>[overview of AUTOSAR three RTE]
[overview of AUTOSAR three RTE]
2022-07-03 00:49:00 【Ke Yuqian】
AutoSAR 3、 ... and RTE summary
1 RTE summary
RTE Provides SWC Operating environment .
RTE Its function is a bit like an express transfer station or a telephone operator ( It's the kind in the last world that you have to call the operator first , Then transfer the telephone line to the destination through the operator ), Its function is to make a SWC Information through RTE Connect to other SWC perhaps BSW On . And RTE It has the function of managing this information , For example, received SWC Busy ( The subscriber you dialed is busy ), that RTE Responsible for sending messages SWC wait for , Or do something else ;RTE Also trigger SWC, It's like receiving at this time SWC Sleeping , Sent at this time SWC Send a message , that RTE It is necessary to put the received SWC Wake up .
2 RTE effect
• Provide cross ECU/ECU Internal communication management .
• Provide right runnable Management function of ( Trigger 、 Wake up, etc , In short, it is runnable Need to map to Task Run on , And this mapping is through RTE actualized ).
• We didn't mention before VFB( Virtual function bus ),RTE Namely VFB The concrete realization of .
• stay Vector In the tool chain ,RTE It's generated automatically .
2.1 RTE Yes Runnables Operation support of
- adopt RTE to runnable Provide departure events
- adopt RTE to runnable Provide the required resources
- take BSW and SWC Do isolation
2.1.1 runnable The trigger condition of
• Initialize event : Initialize auto trigger
• Timer event : Give a cycle timer , It's time to trigger
• Receive data event (S/R):Receiver Port Once the data is received , It triggers
• Receive data error event (S/R)
• Data sending completion event (S/R):Send Port Send complete , It triggers
• Operation call event (C/S): When the function is called
• The asynchronous service returns an event (C/S): I said before C/S It can run asynchronously , That is, when I call a Server function , But I call asynchronously .
Then the function to be dropped runs in parallel with the current running program as a thread ,
When the called function finishes running, it returns (Return) When , At this time, the asynchronous service return event is triggered
• Mode switching event
• Mode switching response event
2.2 RTE Yes Ports The support of
2.2.1 features
Play the role SWCs and BSW Communication channels
• As VFB The concrete realization of
• As S/R Communication implementation of interface
• As C/S Communication implementation of interface
• ECU Internal communication / Span ECU( adopt COM)
• Realization AR-COM The callback function of , The concrete realization is in SWC Done in ,RTE Responsible for completing this callback mechanism
Other characteristics
• Provides a mechanism to achieve data consistency
• Support simple and complex data types
• Yes SWC Instantiation of type
2.2.2 S/R Different ways of interface
- Call directly (Direct)
It is equivalent to having a global variable ,runnable You can read and write this variable directly
Std_ReturnType Rte_Read_<port>_<data> (<DataType> *data)
Std_ReturnType Rte_Write_<port>_<data> (<DataType> data)
- Cache call (Buffered)
It is equivalent to copying global variables to a runnable In local variables of , Then operate on this local variable , Finally, assign this local variable to the global variable . stay runnable During the operation of this local variable , Global variables will not change .
<DataType> Rte_IRead_<r>_<port>_<data> (void)
void Rte_IWrite_<r>_<port>_<data> (<DataType> data)
- Queue calls (Queued)
Because there is more than one data , Is a set of queue data , Just like our commonly used serial port FIFO. therefore , You can set cyclic reception or wait for reception , There is timeout management when waiting .
Std_ReturnType Rte_Receive_<port>_<data> (<DataType> *data)
Std_ReturnType Rte_Send_<port>_<data> (<DataType> data)
2.2.3 Span ECU The way
If it is cross ECU Data transmission of . that , I am here runnable Use in Rte_Write__() After such a function , Will need to go :
runnable(ECU1) ->RTE (ECU1) ->BSW (ECU1) -> External bus ->BSW (ECU2) ->RTE (ECU2)->runnable (ECU2)
Com_SendSignal()
Com_ReceiveSignal()
2.2.4 C/S Different ways of interface
A synchronous invocation
Synchronous call is actually the same function we usually call , It is equivalent to embedding the called function code into the currently called function code to run
// Suppose our called function is :
Std_ReturnType RunnableServer(int *param)
// The calling function that our customers should write is :
Std_ReturnType Rte_Call_<Port>_RunnableServer(int *param)
// This param Is the variable we want to be manipulated by the called function
Asynchronous call
An asynchronous call is equivalent to having two threads , A thread runs the contents of our original function , The other is to execute the content of the called function . Then you can read the return result of the called function after a period of time
How to know whether the called function is finished ? There are three ways :
- Cycle test , Just wait there , Wait until the value is returned , In this case, it is almost the same as synchronization , It doesn't make much sense
- Timeout detection , Set a time , When the time comes, read , Continue to run my program before it arrives
- Events trigger , When the service function is finished ,RTE Can trigger the original function , Tell it that the called function is finished , You can read the return value
// After executing the following function, you can return the parameters
Std_ReturnType Rte_Result_<Port>_RunnableServer(int *param)
2.3 RTE Management of data consistency
Data consistency , When multiple users try to access a database at the same time , When their transactions use the same data at the same time , There are four possible scenarios : Lost update 、 Undetermined correlation 、 Inconsistent analysis and fantasy reading .
Implementation mechanism of data consistency :
utilize RTE management
SWC Internal variables
• EAs(ExclusiveAreas, Dedicated area ): It is the following two sentences of code , Equivalent to an off interrupt , The statements that call variables are placed inside , The runtime cannot have more advanced Task Break the protected statement
......
Rte_Enter_<name>();
// Put protected statements here
Rte_Exit_<name>();
......
• IRVs(Inter-runnablevariables, Cross functional variables ): Or two sentences of code , above EAs The whole code segment is protected , The two sentences here are equivalent to being protected when changing variables , That is, when these two sentences are executed, they are protected .
Rte_IrvWrite_<re>_<name>()
Rte_IrvRead_<re>_<name>()
2.4 RTE Yes Interface Interface
2.4.1 AutoSAR Interface
As I said before S/R and C/S The interface is AutoSAR Interface
characteristic :
The interface function name is variable , For example, as I said before Std_ReturnType Rte_Read__ (
*data) In this form S/R function , Among them It is the name configured by the user , therefore , The function names of these interfaces can be changed , But the general form is unchanged .
Location :
SWC<>RTE、RTE<>CDD、RTE<>ECU AB
- ( Here's a word ,ECU AB I didn't talk about , In fact, many sensors 、 The actuators are all here , yes ECU The abstraction of , It can also be seen as SWC Of ,IoHwAb It's in here ). To be clear , As long as it can be regarded as SWC To deal with the , Namely AutoSAR Interface
2.4.2 Standard interface
AutoSAR Stipulated C Language API
characteristic :
The interface function name is fixed , yes AutoSAR Stipulated .
such as :Com_SendSignal() WaitEvent() These are API Function name , There can be upper layer calls ,
But it is usually generated by using tool configuration , Those who do upper level applications generally don't care about their specific implementation
Location :
The brown one in the figure is the standard interface , To put it bluntly, it's about functions API Call to .
One thing that needs special explanation is : The arrows in the two red circles in the figure below ,OS and COM It is the only two standard interfaces that allow direct and RTE Connected .
because RTE Many functions of the need to be based on these two modules to achieve ```
2.4.3 standard AutoSAR Interface
AutoSAR Interface , But the name is by AutoSAR Official regulations cannot be modified
characteristic :
Standard interfaces and AutoSAR The characteristics of the interface have some .
The first is and AutoSAR As the interface , What is offered is C/S、S/R Interface ; Then it is the same as the standard interface , The function name is immutable .
To put it bluntly, it is officially stipulated C/S、S/R Interface , Let's take it as AutoSAR Interface is fine , Never mind the function name
Location :
RTE<>Services, Just such a place
边栏推荐
- Attributeerror: 'tuple' object has no attribute 'layer' problem solving
- RK3568开发板评测篇(二):开发环境搭建
- 微信小程序获取某个元素的信息(高、宽等),并将px转换为rpx。
- Vulkan并非“灵药“
- FAQ | FAQ for building applications for large screen devices
- leetcode-1964:找出到每个位置为止最长的有效障碍赛跑路线
- MySQL multi table joint deletion
- Logback configuration file
- 文件操作IO-Part2
- 为什么网站打开速度慢?
猜你喜欢
Leetcode-849: maximum distance to the nearest person
[IELTS reading] Wang Xiwei reading P1 (reading judgment question)
University of Toronto:Anthony Coache | 深度强化学习的条件可诱导动态风险度量
antv x6节点拖拽到画布上后的回调事件(踩大坑记录)
Teach you JDBC hand in hand -- structure separation
百数不断创新,打造自由的低代码办公工具
【雅思阅读】王希伟阅读P1(阅读判断题)
Linux Software: how to install redis service
Unity learns from spaceshooter to record the difference between fixedupdate and update in unity for the second time
Use Jenkins II job
随机推荐
In the first half of 2022, there are 10 worth seeing, and each sentence can bring you strength!
飞凌搭载TI AM62x的ARM核心板/开发板首发上市,亮相Embedded World 2022
研发一款国产ARM智能边缘计算网关需要什么
leetcode-934:最短的桥
腾讯云免费SSL证书扩展文件含义
MySQL multi table joint deletion
Machine learning: numpy version linear regression predicts Boston house prices
Leetcode 294. Flip game II (game theory)
1.11 - 总线
Liad: the consumer end of micro LED products is first targeted at TVs above 100 inches. At this stage, it is still difficult to enter a smaller size
Nacos+openfeign error reporting solution
leetcode-849:到最近的人的最大距离
[golang syntax] map common errors golang panic: assignment to entry in nil map
The difference between tail -f, tail -f and tail
University of Toronto: Anthony coach | the conditions of deep reinforcement learning can induce dynamic risk measurement
【日常训练】871. 最低加油次数
Shell implements basic file operations (SED edit, awk match)
Vulkan并非“灵药“
Leetcode-871: minimum refueling times
mm中的GAN模型架构