Configuring a subsystem as an AUTOSAR SW-Component is not supported. Please convert the subsystem to a model and then configure the model as an AUTOSAR SW-Component.

11 次查看(过去 30 天)
Hello,
I am trying to generate a C code which is compliant with autosar from a model (I am using Matlab 2020 for code generation) but when I generated the code I get this error:
Error using Simulink.ModelReference.Conversion.SubsystemConversion/convert
Configuring a subsystem as an AUTOSAR SW-Component is not supported. Please convert the subsystem to a model and then configure the model as an AUTOSAR SW-Component.
So to convert the subsystem to model I select Subsystem Block I want to convert then in Subsystem Block tab, select Convert > Model Block
For conversion, some checks need to be passed but my check is failed in ^ Check subsystem content and I get this error
Check failed
Configuring a subsystem as an AUTOSAR SW-Component is not supported. Please convert the subsystem to a model and then configure the model as an AUTOSAR SW-Component.
Does anyone have any idea about this kind of issue ?

回答(1 个)

Namnendra
Namnendra 2024-9-12,5:35
Hello Nour,
The error message you're encountering suggests that you're trying to configure a subsystem directly as an AUTOSAR Software Component, which is not supported. Instead, you need to convert the subsystem into a model first, and then configure that model as an AUTOSAR component. Here’s how you can address this issue:
Steps to Convert a Subsystem to an AUTOSAR Model
1. Convert Subsystem to Model:
- Right-click the subsystem block you want to convert.
- Navigate to "Subsystem Block" tab and select "Convert > Model Block". This will convert the subsystem into a standalone model.
2. Resolve Conversion Checks:
- During the conversion process, MATLAB performs several checks to ensure the subsystem can be converted into a model. If these checks fail, you need to address the specific issues reported.
- Common issues include unsupported blocks, unresolved dependencies, or incompatible configurations. Review the detailed error messages to identify and fix these issues.
3. Configure the New Model for AUTOSAR:
- Open the newly created model.
- Go to Modeling > Model Settings.
- In the "Code Generation" pane, set the "System Target File" to an AUTOSAR target (e.g., `autosar.tlc`).
- Configure the AUTOSAR properties as needed, such as defining interfaces, runnable entities, and data elements.
4. Re-run Checks:
- After configuring the model for AUTOSAR, ensure you re-run any necessary checks to verify that the model is correctly set up for AUTOSAR code generation.
5. Generate AUTOSAR Code:
- Once all checks are passed and the model is properly configured, you can proceed to generate the AUTOSAR-compliant C code.
Troubleshooting Tips
- Check Block Support: Ensure all blocks within your subsystem are supported for code generation with AUTOSAR. Replace or modify unsupported blocks as needed.
- Dependencies and Libraries: Ensure that all dependencies, such as custom libraries or S-functions, are compatible with AUTOSAR code generation.
- Simplify Subsystem: If the subsystem is complex, consider simplifying it before conversion to isolate and resolve issues more easily.
- Consult Documentation: Refer to the MATLAB and Simulink documentation for details on AUTOSAR configuration and supported features in your version.
By following these steps and addressing any specific issues highlighted during the conversion checks, you should be able to successfully convert the subsystem into a model and generate AUTOSAR-compliant code.
Thank you.

类别

Help CenterFile Exchange 中查找有关 AUTOSAR Blockset 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by