MBDT SIMULINK

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

MBDT SIMULINK

Jump to solution
796 Views
paul_ephraim_13
Contributor III

 

But i have an issue, if i interchange the rgb leds i am unable to see the change even after building it to the microprocessor.

My question is apart from led configuration shoud we configure any other peripherals to see that in effect.

I have replicated this in the nxps32k312 please clarify!


This is the reference link that i used to build or simply configured to the s32k312 mcu 

https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/Interacting-with-Digital-Inputs-Outputs-on...


Labels (2)
Tags (1)
0 Kudos
Reply
1 Solution
740 Views
dragostoma
NXP Employee
NXP Employee

Hi, @paul_ephraim_13 

I downloaded the model you gave me and tested it on the board. I notice that it was configured to toggle RGBLED0_BLUE, as it appears from the generated code.
After that, I modified the DIO block to toggle the RED color, on the RGBLED0_RED channel. Everything worked correctly, the led being red this time.

As a note, if sometimes the application is not in sync with the latest changes, try to view the generated C code, it is possible that sometimes, even if you change settings in blocks, the code remains from the previous version. I think this happened in your case.

You can view the generated code directly in Simulink, by accessing the Apps section, followed by the Embedded Coder section.

dragostoma_0-1726826362887.png

The C Code tab will open and you can access the generated code by pressing the View Code button. By clicking on a block in Simulink, you can see the generated code related to that block and thus you can see if the parameters are updated or not.

1. RGBLED0_BLUE

dragostoma_1-1726826383939.png

2. RGBLED0_RED

dragostoma_2-1726826446641.png

Additionally, you can open the generated code in text format, from the following location: model_name_ert_rtw folder -> model_name.c. In this case would be temp_2_ert_rtw -> temp_2.c

If you notice discrepancies between the model and the generated code, you can do a cleanup and delete the ert_rtw folder, where the generated code is located, and building the model again, the new code will be generated and thus make sure that it is in sync with the latest version.

 

Hope this helps,

Dragos

 

View solution in original post

4 Replies
745 Views
paul_ephraim_13
Contributor III

paul_ephraim_13_0-1726821682393.png

Thankyou mam for your information, but it seems that the port pins  are already configured by default in the port component.
Actually, what i am going through is that when Iinitially build the simulink model into the target (s32k312), the light does glow according to the initial setup, but when i change that in the model like in the below demonstrated image(blue to red) and building it once agaiin to the target, it seems to stick around with the initial build-up.

paul_ephraim_13_1-1726821988841.png

I have also attached my model, please consider, you could also provide some manuals for the setup procedure!
Sorry to keep pstig my queries! cause i am pretty new to this area!

 

 

0 Kudos
Reply
741 Views
dragostoma
NXP Employee
NXP Employee

Hi, @paul_ephraim_13 

I downloaded the model you gave me and tested it on the board. I notice that it was configured to toggle RGBLED0_BLUE, as it appears from the generated code.
After that, I modified the DIO block to toggle the RED color, on the RGBLED0_RED channel. Everything worked correctly, the led being red this time.

As a note, if sometimes the application is not in sync with the latest changes, try to view the generated C code, it is possible that sometimes, even if you change settings in blocks, the code remains from the previous version. I think this happened in your case.

You can view the generated code directly in Simulink, by accessing the Apps section, followed by the Embedded Coder section.

dragostoma_0-1726826362887.png

The C Code tab will open and you can access the generated code by pressing the View Code button. By clicking on a block in Simulink, you can see the generated code related to that block and thus you can see if the parameters are updated or not.

1. RGBLED0_BLUE

dragostoma_1-1726826383939.png

2. RGBLED0_RED

dragostoma_2-1726826446641.png

Additionally, you can open the generated code in text format, from the following location: model_name_ert_rtw folder -> model_name.c. In this case would be temp_2_ert_rtw -> temp_2.c

If you notice discrepancies between the model and the generated code, you can do a cleanup and delete the ert_rtw folder, where the generated code is located, and building the model again, the new code will be generated and thus make sure that it is in sync with the latest version.

 

Hope this helps,

Dragos

 

589 Views
paul_ephraim_13
Contributor III

The problem still occurs!  only after deleting the ert file after every modification the change seems to be reflected in the s32k312evb! is there any additional configurations  to be done for it to work seamlessly after every bulid  apart from DIO and Port configurations.
please clarify! 

0 Kudos
Reply
786 Views
Irina_Costachescu
NXP Employee
NXP Employee

Hi @paul_ephraim_13 

If you are using MBDT for S32K3 v1.5.0, besides the Pins Tool configuration, where you should configure the pins used inside the application, you would also need to ensure the same pins configuration inside the Port component.

This is because, during the initialization sequence, the Port_Init function is called. Hence, not having the pin configured there as well, won't produce your expected results.

This linkage between the Pins Tool and the Port component is mandatory, as specified by the RTD (Real-Time Drivers) implementation. MBDT uses this software drivers for ensuring hardware configuration and access from the Simulink environment.

Please check the S32K3 Release Notes document - Section 3.6 where you could find details on the correspondence between the Port component and the Pins tool (attached a snippet from the section in discussion).

Irina_Costachescu_0-1726742592507.png

 

Please let us know if this helps, or please provide any additional information that could help us identify the issue you are currently encountering.

Irina

0 Kudos
Reply