1

I am doing an academy project about porting Autosar OS to a microcontroller. After reading papers and information about Autosar, Arctic Core and Arctic Studio, I have some questions:

  1. I used to port FreeRTOS to a microcontroller and it's very easy, I just included some *.h and *.c files of FreeRTOS, and then used the FreeRTOS functions to build my application on the chip. Can I do similarly to Autosar? If it is possible, which files should I include to my main.c
  2. Second question, in FreeRTOS, I only need to use xcreatetask() function(this is a FreeRTOS function) to set task priority, and then i applied vstarttaskschedule() function to run the task in queue however I cannot see these kinds of functions in Autosar OS. Can someone tell me which function in autosar have same functionality like functions I said.
  3. When I program Texas Instrument chips, there is always main function which include the main program that we will build for the chip. However, I don't see any main functions in arctic Core example. How can the chips runs the program without main function? Please help me answer these questions!
JackABC
  • 27
  • 2
  • 7
  • Questions 1 and 2 look like the kind of thing best answered in the [documentation](http://www.arccore.com/resources/user-documentation/). However ARCCORE require you to register, so I have not looked; you should however. For question 3, presence of a `main()` function is nothing to do with the chip; it is a standard requirement of C and C++ that `main()` is the entry point to the code; however some kernel and application framework libraries include the `main()` function in the library which in turn calls some alternate user entry-point that you must provide in *your* code – Clifford Apr 09 '15 at 18:20
  • 1
    Autosar systems are very heavily based on code generation from UML & XML and intentionally enforces a top-down design based workflow. So it's a *very* different paradigm from what you're used to with FreeRTOS. Also typical upfront "startup cost" is absolutely massive compared to a traditional RTOS, to such a point that I would be seriously impressed if you can do anything at all with it in a semester long university project as a lone developer. – Brian McFarland Apr 09 '15 at 21:06

3 Answers3

3

3, You are not able to see to main function in ARTIC core: AUTOSAR does not define start-up code. You are expected to write main function yourself. Kernel in AUTOSAR OS gets initialized from ECUM module. If you want to boot your OS, you must have ECUM module. Also you should have BSWM module to start schedule tables. You have to create rule in BSWM for RTE start-up and it will start your schedule table. You have to handcode start-up code (RAM/Register/etc initialization), from that you have to call main function, main function will be handcoded. Call EcuM_init from main function. This way your OS will boot. 2, You are not able to locate function to set task priority and activation: AUTOSAR does not support dynamic task priority. You have to set all priorities in cofiguration. To run task you can use ActivateTask(). One quick trick to start task at startup is, set parameter OsTaskAutostart for one task. Task for which you have set parameter OsTaskAutostart will get invoked as soon as kernel is initialized.

Omkar
  • 31
  • 2
1
  1. Your start-up code will be target specific.
  2. ECUM does the initialisation part for all the SW modules within ECU.
  3. Remember to call ECUM from your Main.c
  4. ECUM does initialisation of BSWM, Drivers and the SW modules.
  5. Once RTE is initialised - there is a part SchM within the RTE which schedules the Mainfunctions from each module.
  6. The Mainfunctions from each SW Module are known to RTE by BSWMD and SWCD files.

Read RTE SWS, ECUM SWS, SYSTEMTemplate SWS for more info

Community
  • 1
  • 1
DarkKnight
  • 131
  • 10
0

I guess your academic project already ended, however porting an AUTOSAR OS to a specific microcontroller is not a suitable scope for an academic project.

Firstly, from your question, I cannot tell if the OS is ARCCORE or other. Secondly, from my experience with FreeRTOS, there is only a limited amount of knowledge which applies to AUTOSAR OS and creating tasks (2.) is application-level rather than porting. Thirdly, the majority of AUTOSAR OS rely on specialised embedded compilers, e.g. GHS or DIAB which are not home to academia.

I have not ported AUTOSAR OS myself, but I suggest taking a look at a ported version, the architecture and file structure, system and then the start-up routines, vector tables, peripheral code, etc. Complexity might be reduced when porting within the same MCU architecture, say Renesas machines or ARM.

To answer your question 3., you will not find the main() within the ARCCORE examples. main() is located in os_init.c and looks like this:

extern void EcuM_Init(void);


int main( void )
{
    EcuM_Init();
}

Then, EcuM_Init() [EcuM.c] calls InitOS();