The code generated by the MBDT example is compiled incorrectly in s32ds

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The code generated by the MBDT example is compiled incorrectly in s32ds

Jump to solution
3,487 Views
dashe
Contributor II

Hello,Everyone

      My development board is s32k344. I use the example in MBDT to automatically generate code, and then move it to s32ds. It always reports an error and displays that the header file cannot be found. Is this not set correctly?I hope I can get your help. Thank you very much.

0 Kudos
1 Solution
3,466 Views
Irina_Costachescu
NXP Employee
NXP Employee

Hi @dashe 

For importing MBDT for S32K3 applications inside S32DS, an additional step needs to be performed. After building the model and generating its corresponding C code, you will have to also export it as a S32DS project. I have attached here a link to a community thread where this process is described step by step. 

Hope this helps,

Irina

View solution in original post

0 Kudos
9 Replies
1,486 Views
kamilla_peixoto
Contributor II

Hello,

I am trying to export a project from MBDT to the SDK, but the folder on the SDK is empty.

I am building the project on Simulink and flashing it directly to the board successfully. However, on the project settings I don't have the option to export it (as shown in the figure attached). But, even without setting the export parameters, I have the ProjectInfo.xml generated (also attached). I guess because the option to generate the project file is checked on the block MBD_S32K14x_Config_Information.

May someone help me to solve this, please?

I am using Matlab R2022b, the S32 Design Studio for ARM v2.0 and the hardware is S32K144-EVB. I am using the same path file for both export and import steps.

I appreciate your assistance.

Kamilla

0 Kudos
3,467 Views
Irina_Costachescu
NXP Employee
NXP Employee

Hi @dashe 

For importing MBDT for S32K3 applications inside S32DS, an additional step needs to be performed. After building the model and generating its corresponding C code, you will have to also export it as a S32DS project. I have attached here a link to a community thread where this process is described step by step. 

Hope this helps,

Irina

0 Kudos
3,425 Views
dashe
Contributor II

Hello, Irina,捕获2.PNGwhen I import files from s32ds and update the source code, the following errors appear. I don't know why?Is it because of the version?

Pins initialization requires the PINS Driver in the project.
Clocks initialization requires the CLOCK Driver in the project.
SysDal not found in the toolchain/IDE project. Project will not compile!
Can not found in the toolchain/IDE project. Project will not compile!
Platform not found in the toolchain/IDE project. Project will not compile!
Mcu not found in the toolchain/IDE project. Project will not compile!捕获.PNG捕获1.PNG

0 Kudos
3,416 Views
Irina_Costachescu
NXP Employee
NXP Employee

Hi @dashe,

Please check the first point of my previous post since it seems that it could help you with this issue as well.

Regards,
Irina

0 Kudos
3,460 Views
dashe
Contributor II

Hello, I followed your steps to the compilation step, and there was a compilation error. As shown in the picture, I couldn't find the two files on the path you said. Is there an error in my installation package?

0 Kudos
3,420 Views
Irina_Costachescu
NXP Employee
NXP Employee

Hi @dashe ,

From the S32DS screenshot you attached I notice 2 issues that may cause the problem you are currently facing and I am going to elaborate on each of them as it follows:

1. S32K344.h file cannot be found.

This file is part of the RTD (Real Time Drivers). MBDT uses RTD for configuring and controlling the MCU peripherals and the MBDT blocks generate code on top of the RTD APIs. Since MBDT delivers RTD within its package, the Simulink build process knows where to look for such general RTD files, like the S32K344.h.

However, when exporting and importing a project in the IDE, we are moving to a different applications development environment. Hence, in this case, since S32K344.h is not found, my guess would be that the RTD package is not installed inside S32DS. Therefore, first of all, could you please check this by accessing the Help menu -> S32DS Extensions and Updates?

If the package is not there, you just need to click on the Add Update Sites button and include there the .zip file that you can download from nxp.com. You can find it under Automotive SW - S32K3 Standard Software / Automotive SW - S32K3 - Real-Time Drivers for Cortex-M / S32K3 Real Time Drivers Version 1.0.0. 

Irina_Costachescu_2-1649587474164.png

Please also note that the versions I am using are:

  •  MBDT 1.1.0 (using the integrated RTD 2021_10) 
  •  S32DS v3.4, where I have SW32K3_RTD_4.4_1.0.0_DS_updatesite_D2110 installed.

2. Inside the project imported in S32DS, the generate folder is missing.

The generate folder contains the hardware components configuration code, generated based on the configuration project that is associated to the model. The MBDT for S32K3 integrates the usage of configuration tools (S32 Config Tools and EB Tresos), specialized on setting and initializing the hardware used by an application.

If you open one of the MBDT Simulink examples, you will see that either a .mex file or a TresosProject folder will be brought next to the model, based on the selected Configuration Tool, which can be set from the model's Hardware Settings. These files represent the default configuration MBDT provides for hardware initializing of all the components it provides support for. The MBDT blocks read the settings of the configuration project associated to the model and display in their masks the available options for implementing the logic of your design. 

In addition to that, a modelName_Config folder will also be brought next to the model. This one contains the drivers, linker files, basically all the necessary hardware aware sources. During the Simulink build process, all these files are cross compiled with the Simulink application generated code, and with the hardware configuration project generated code into an executable file automatically downloaded on the MCU.

We provide application examples that use both EB Tresos and S32CT and you can find them under the S32K3_Examples folder. 

Therefore, I would recommend you to test this export functionality on one of the models MBDT provides, as the steps from this post indicate. In this way, we can validate your current MBDT setup. Please note that if the Simulink model does not compile successfully (if executable files are not generated when the building process ends), the export functionality won't behave as expected either. Hence, please report to us any issues that may occur during the Simulink model build process.

You can then export the model's code as a S32DS project using the Export functionality form the Hardware Settings, and its import into the IDE should display the complete structure of the project.

Hope this helps,
Irina

0 Kudos
3,393 Views
dashe
Contributor II

After I imported the sample project in Simulink in s32ds, the prompt "the loaded configuration is created by an earlier version of the tool" appeared when updating the source code, and then there were problems with pins and peripherals. The picture shows my installed s32ds software. Is there a version mismatch?微信1.png捕获3.PNG捕获.PNG微信图片.png

0 Kudos
3,363 Views
Irina_Costachescu
NXP Employee
NXP Employee

Hi @dashe ,

Indeed it seems that this is caused by a versioning issue. The S32DS environment you are currently working on uses an updated Tools package (version 3.4.3). Since the S32DS IDE integrates the S32 Configuration Tools, you are trying to open a .mex file, created in a previous S32CT version, in a newer release of this tool.

It seems that the RTD 1.0.0 implementation is not compatible with this new S32CT version. For more information related to the RTD compatibility and integration in S32DS, please refer to the RTD Reference Manual.

I have attached here screenshots of the versions we are currently using.

Irina_Costachescu_0-1649755754146.png

 

Regards,

Irina

 

0 Kudos
3,312 Views
dashe
Contributor II

Hello,

         I reinstalled s32ds and used the version you said, and then the project I generated with MBDT example has this problem because of the problem of gcc compiler? I tried several different examples of the same problem. I'm sorry to trouble you.微信.png微信图.png

0 Kudos