Free mini AUTOSAR editor for microcontrollers

In this post I want to share with you a program I wrote for developing software for microcontrollers according to a standard close to AUTOSAR.





In 2018, I was invited to work at EPAM Belarus on an outsourcing project to develop software for steering racks. I agreed with great pleasure and went to live and work in Belarus.





On this project, I got acquainted with the software development standard in the automotive industry - AUTOSAR .





A few words about AUTOSAR

According to the standard, the application architecture is divided into 3 levels:





  • Application;





  • Run Time Environment (RTE);





  • Basic software.





The main idea of ​​the standard is to divide the system into components, as well as define the levels of responsibility for each of the levels. At the same time, they mainly try to make the application independent of iron, so that you can painlessly transfer software from one MC to another. The system is split into independent components and they interact with each other using RTE. This allows you to be able to test each component separately and achieve almost 100% code coverage with tests.





You can read more about the standard here .





According to the standard, components can have the following components:





  • Ports for communicating with each other;





  • Functions called on events from RTE (runnables);





  • – Calibration Data (CData);





  • – Per Instance Memory (PIM);





  • runnables – Inter Runnable Variable (IRV).





runnables CData, PIM, IRV RTE.





. , , . : sender-receiver, client-server.





  • Sender – ;





  • Receiver – ;





  • Server – ;





  • Client – .





SWC1 SWC2, SWC1.





.





AUTOSAR GUI Editor

, , . . , , arxml. :





  • ;





  • client-server sender-receiver ;





  • . ;





  • (struct), ;





  • ;





  • , , write read , server ;





  • (Multiple instantiation);





  • PIM CData , PIM CData;





  • runnable , ;





  • runnables ;





  • RTE , ;





  • ;





  • test environment ;





  • runnables;





  • .





:





  • , Main .





  • - ;





  • FreeRTOS, , , , FreeRTOS . git .





.





, Main. , , .





, , insert.





, , .





, definition, , , definition (drag and drop). , . , , Multiple instantiation. runnables, , PIM CData.





An example of a simple project with 4 components.
4 .

, , , defenition , .





init values PIM CData Component properties .





, .   Insert->Connection , . , , . , , .





,





-





-





, , .





.





Runnables management, System-> Runnables order. , , runnables .





Create and edit scheduler tasks.
.
Distribution of runnables by scheduler task.
runnables .

Stack size in bytes . , ( git ) , RTOS .





RTE

RTE , . System->Check errors.





, RTE Project Settings. (Project->Settings…). , .





, , .





, , Project->Generate RTE RTE . , RTE RteSkeleton RTE.





STM32CubeIDE

STM32CubeIDE, , , runnables, Data .





STM32CubeIDE , .. . , , :





  1. Components





  2. , , .





  3. Includes   include , RTE.





4.    Source Location Components RTE





5.  main.c  :







#include "Rte_Task_Scheduler.h"

.





6.   stm32f4xx_it.c /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ :

#include "Rte_Task_Scheduler.h"





SysTick_Handler.





7.  .





github.





, AGE , – RTE, .





If the program interests anyone, in the next article I will tell you how to do tests for components.





Conclusion

This editor allowed me to make the architecture of my STM32 application more visual and flexible. If it is necessary to write any mathematically loaded component, I can now painlessly test it in Eclipse and only then easily implement it into a project in STM32. Also, the data flow from one component to another became clearly visible, which makes it easy and quick to find the sources of problems in the project if they arise.





Link to AUTOSAR Gui Editor.





Link to the project. R








All Articles