Hello everyone,
I am working with MKV31F256VLH512 microcontroller in Simulink with MBDT. I am trying to run an application on MKV31F256VLH512 microcontroller where it is not supposed to run on the hardware board FRDM-KV31F, but directly on the microcontroller. When I try to do this, the toolbox does not allow me to configure the mex file manually. Instead, it is generated with a predefined configuration for FRDM-KV31F and even if I change it manually in the Config Tool, it does not seem to be recognized by Simulink. How can I overcome this issue?
Best regards
Hi @cvstnc ,
For achieving your use case, and configuring your MBDT application for an MKV31F256VLH12 processor, I would recommend you to consider following the next steps, as described below:
1. Open the Model Settings and choose the Hardware Board as NXP MKV3x.
2. Under the Hardware board settings option, you can choose the processor you would like to be targeted by your application by selecting it inside the Hardware Part dropdown, like illustrated in the image below. After you select the MKV31F256VLH12, a pop up window will inform you about the fact that the SDK for this specific processor is not present in the toolbox.
MBDT blocks generate code on top of SDK functions, and also use such drivers for configuring the on-board peripherals, pins, and clocks for the developed application, therefore, the process of providing the corresponding SDK for your application is mandatory. Hence, you should click on the Go to SDK Builder page to download the corresponding SDK package.
3. By pressing the mentioned button, the following page will be opened, allowing you to customize and build your SDK package, according to the desired components you would like to use. This page will provide access to the latest version of the SDK, which is 2.13. However, MBDT for KVx was developed using an older SDK version (2.8.0), hence you should use this one to ensure that there will not be any compatibility issues caused by the SDK drivers updates. For this, you could click on the Select Board/Processor which will allow you to reconfigure the desired SDK package, and select an older version for the drivers.
4. In the newly opened page, expand the Processors group, and then go to Kinetis -> V-> KV3x family and select the MKV31F256xxx12 hardware platform, like illustrated in the image below. From the right side of the screen, select the 2.8.0 version then press the Build MCUXpresso SDK button.
5. Customize the components to be added inside the package and then press the Download SDK button, which can be found in the bottom of the page.
6. Now that the package was created, you can Download the archive containing the SDK for MKV31F256xxx12 on your PC. After the archive is downloaded, please also unzip it since MBDT will use the files inside it during the process of building the Simulink application.
7. Now, going back to the MBDT Simulink model, select one more time the Hardware Part as MKV31F256VLH12, as illustrated at point 2. When the same pop up window will be prompted, click on the Browse SDK button this time and provide the path to the unzipped archive which was recently downloaded.
8. A pop up will inform you that a new S32 Configuration Tools .mex file will overwrite the one already existing. Please click on the Overwrite the existing file button to ensure that a configuration project for this new selected processor will be used by the model. If you would also like to keep the .mex file already existing next to your model, please consider backing it up before this process.
9. After this process completes successfully you can open the configuration project by pressing the Configure button of any MBDT block in the Simulink model. This configuration project represents a default settings enablement that MBDT provides for the MKV31F256xxx12 platform, having as the default package the MKV31F256VLL12, as illustrated below.
10. You can change this project to address the MKV31F256VLH12 package, by performing the next actions:
10. After this, you can save the .mex file, now being configured for MKV31F256VLH12, and customize it according to your hardware setup (e.g re-route pins, enable peripheral instances, clocks, etc.), because MBDT provides an unlimited configuration mode that allows you to customize the S32 Configuration Tools projects, associated to the models, according to the specific particularities of the application you would like to develop. After any change in the .mex file, please save the project, and when going back in Simulink, press any block's Update button so that the changes will be reflected in the Simulink environment as well.
Moreover, as a general note, I would also like to mention that, for keeping the changes in your .mex file and for avoiding them to be overwritten with the default settings provided by the toolbox, the .mex file present next to the model should not be erased.
Hope these steps will help you achieve your use case. If any issues are encountered during this process, please let us know.
Regards,
Irina
@ramprakash07 , thank you so much for the answer, I'll try it next week and let you know how it works for me.