Common Terms Used in Autosar - Runnable Entity

Runnable Entity

  Runnable entity is a part of SWC where the application behavior logic is written. 

  Runnable is similar to functions in C.

  In AUTOSAR, we create Runnable in a SWC during configuration and that runnable or function skeleton is generated in respective source files of SWCs.

  We need to write our code in this function/Runnable which will be then executed by AUTOSAR OS, this code is the application which the SWC should perform. 

  Runnables also have variables, and some Runnables also have trigger points which “calls” or triggers our runnable when a specific condition is met. 

  Such conditions can be defined during configuration, conditions can be: Init Runnable which will be called on initialization,periodic call of runnable which can be used to send some periodic data, different RTE events based triggering, etc.

 

  Below is the example of runnable skeleton generated after configuration, this runnable is of Indicator SWC named Runnable1. 

Such runnable skeletons are generated in SWC .c files.

/*Indicator.c*/
void Runnable1(){
   /*runnable logic code here*/
}

 

 

There are generally three types of runnables:

  1. Init Runnable: This runnable is called on init of ECU
  2. Periodic Runnable: This runnable is used when we need to trigger this runnable periodically to execute some operation periodically.
  3. Server Runnable: This runnable is used to implement server of Client/Server port interface.

Runnables can be configured to be activated on RTE events like:

  1. Timing Event: 
    •         Whenever a set time is reached, this event will trigger/call dedicated runnable
    •         and it will perform the logic written in it.
    •         This is relatable to timer interrupt we use in general Embedded systems programming,
    •         where ISR ( Interrupt Service Routines , 中断服务程序 ) is called on each timer overflow.
  2. Data received event: 
    •   As the name suggests, such event will trigger a runnable whenever data is received by ports.
  3. Operation Invoked Event: 
    •   This event is called by client, when invoking a server runnable using Client/server port interface. 
  4. Mode Switch Event: 
    •   Whenever ECU mode is changed, runnable can be triggered to perform some work.
      •           For example ECU shutdown mode,
      •                if ECU needs to perform some work before shutdown,
      •                then such event shall be hooked with(与...挂钩) that runnable
      •                which will perform the work before shutdown.
  5. Data Received Error Event: 
    •   Whenever any error occurs in data receiving, a runnable can be called to take action on such event.
  6. Data Send Completed Event: 
    •   This event will trigger a runnable if data is sent successfully to take action further on
    •        data transmission completion.

 

posted @ 2022-10-09 21:26  Jasper2003  阅读(65)  评论(0编辑  收藏  举报