Generating AUTOSAR Code
To generate code for a project containing a software component, proceed as follows:
- Open the project containing the software component.
- Adjust the project settings.
Configure the AUTOSAR XML output.
It is recommended that you clean the code generation directory (Clean Code Generation Directory in the Build menu) and enforce code generation for the software component and all referenced components (Build menu, Touch submenu, Recursive menu option).
Perform one of the following actions.
- Open the Build menu and select Generate Code.
- Click
Generate Code. - Press <Ctrl> + <F7>.
The C code for the current component is generated. The files are written to the code generation directory specified in the Paths subnode of the Build node in the ASCET options window.
The ASCET monitor displays any error messages returned by the code generator. You can find the relevant diagram item by clicking on an error message.
Note
The XML files required for AUTOSAR are not yet created.
In the File menu, open the Export submenu, point to Generated Code and select Recursive.
The Path to export Items window opens. The code generation directory that is specified in the Paths subnode of the Build node in the ASCET options window is preselected.
Click OK to confirm the selection and close the Path to export Items window.
The XML files required for AUTOSAR are created.
If you want to create code for a single software component, you can set up the default project of the software component, and afterwards perform the above steps in the software component editor.
See also
Adjusting the Project Settings for the SWC
Configuring the AUTOSAR XML Output