I currently have MBDT 1.5, I am exploring the following modules in MBDT1.5 for S32K344
1) DIO
2) PWM
but I am not getting the expected output. After doing some debugging using S32DS by flashing same ELF, I found that the GPIO is not configured in Output Mode (by observing MSCR Register in case of DIO) and in case of PWM the 'SSS' field of MSCR is not configured for eMIOS mode, even if these get correctly configured in ConfigTool.
Have also confirmed with the example projects as well, but the aforementioned modules do not work with it as well.
I have also worked on MBDT 1.4 for S32K344, and the same modules worked fine there.
Solved! Go to Solution.
Hello, @RushikeshK_DC.
Initially I will approach the DIO_Test00 model for which you tried to generate code based on the DIO component. From what I can see from the model, the hardware part used to generate code is S32K344-Q257. Is this aspect correct?
Assuming that the hardware part is correct, from what I can see in the configuration project there is a discrepancy between the configuration of the pins in the Port, Pins and Dio components. A good reference to understand the connection between the Port and Dio components can be found at the following link, even if it is for the EB Tresos configuration tool, the concepts are similar.
Referring to your configuration, I can see that the only change in the Port component is related to LED1 which has MSCR 29, which also corresponds to RGBLED0_RED.
In the Dio section, I found LED1, LED2 and LED3 configured as PTG_L.
On the other hand, in the Pins section, I notice that the same pins are incorrectly configured, being assigned to the Adc_Pins_MBDT functional group. Instead, they should be set in the functional group corresponding to Dio, namely Dio_Pins_MBDT.
Moreover, MSCR registers must be synchronized between Port and Pins components, to ensure the connection between software and hardware configuration.
As a last mention related to your application, for the S32K344-Q257 board all the available LEDs are already configured in the default configuration project, namely RGBLED0 and RGBLED1.
Now, on the other hand, related to the s32k344_pwm_led_s32ct model, I notice similarities in the configuration of the pins with the DIO_Test00 model. The PWM signals you want to configure use eMIOS instance 1 and channels 19, 20 and 21, but they are functionally assigned to the wrong group, they must be set in Pwm_Pins_MBDT.
In the Pwm component the PWM channels are correctly set, according to the eMIOS instances used.
But in the Port component, the pins you are trying to use are not configured correctly.
I hope this helps.
Regards,
Dragos
Hello, @ dragostoma,
Thank you for reply.
Yes, I have already created a same model 2-3 times and the result was same, so there is no chance of issue related to cleanup project and code regeneration. For more information, I have shared the models for testing the DIO and PWM the used GPIOs are PTG3, PTG4, PTG5.
Hello, @RushikeshK_DC.
Initially I will approach the DIO_Test00 model for which you tried to generate code based on the DIO component. From what I can see from the model, the hardware part used to generate code is S32K344-Q257. Is this aspect correct?
Assuming that the hardware part is correct, from what I can see in the configuration project there is a discrepancy between the configuration of the pins in the Port, Pins and Dio components. A good reference to understand the connection between the Port and Dio components can be found at the following link, even if it is for the EB Tresos configuration tool, the concepts are similar.
Referring to your configuration, I can see that the only change in the Port component is related to LED1 which has MSCR 29, which also corresponds to RGBLED0_RED.
In the Dio section, I found LED1, LED2 and LED3 configured as PTG_L.
On the other hand, in the Pins section, I notice that the same pins are incorrectly configured, being assigned to the Adc_Pins_MBDT functional group. Instead, they should be set in the functional group corresponding to Dio, namely Dio_Pins_MBDT.
Moreover, MSCR registers must be synchronized between Port and Pins components, to ensure the connection between software and hardware configuration.
As a last mention related to your application, for the S32K344-Q257 board all the available LEDs are already configured in the default configuration project, namely RGBLED0 and RGBLED1.
Now, on the other hand, related to the s32k344_pwm_led_s32ct model, I notice similarities in the configuration of the pins with the DIO_Test00 model. The PWM signals you want to configure use eMIOS instance 1 and channels 19, 20 and 21, but they are functionally assigned to the wrong group, they must be set in Pwm_Pins_MBDT.
In the Pwm component the PWM channels are correctly set, according to the eMIOS instances used.
But in the Port component, the pins you are trying to use are not configured correctly.
I hope this helps.
Regards,
Dragos
Hello, @ dragostoma,
I have configured the DIO and PWM as you suggest and DIO working fine but I am facing issue with generating PMW output even I have configured as per you said. I have attached my PWM model here. Pls verify my configuration and need your suggestions.
Thank You!
Hello, @RushikeshK_DCl,
I have analyzed the model provided by you, the configuration of the pins seems fine to me, with the exception of enabling the interrupt handlers corresponding to the eMIOS instances. You can do this from the Platform tab -> Interrupt Controller section. You should enable the handlers for the instances you want to use in PWM signal generation, namely:
- EMIOS_1_CH_19
- EMIOS_1_CH_20
- EMIOS_1_CH_21
- EMIOS_2_CH_3
- EMIOS_1_CH_17
Please be aware that eMIOS interrupts are divided into groups, as follows:
So you should enable the following interrupt handlers: EMIOS1_0_IRQn, EMIOS1_1_IRQn and EMIOS2_5_IRQn.
Hope this helps.
Best regards,
Dragos
Hi, @RushikeshK_DC ,
The interrupt handlers enablement is necessary for ensuring that the generated code can handle real-time events efficiently and reliably: the eMIOS modules often generate interrupts to signal the CPU about events like timer overflows, input capture, output compare matches, or edge detection on input signals. Enabling interrupt handlers ensures that these events are appropriately handled, allowing for real-time processing and response.
Hope this helps,
Best regards,
Dragos
Hi, @RushikeshK_DC,
Thank you for your interest into Model-Based Design Toolbox for S32K3.
Did you try to use an example from the toolbox or a model configured by you that was migrated from the previous version of the toolbox? I am asking to try to understand what could be the root cause of the reported problem.
As you mentioned, there is a discrepancy between the configuration project and the generated code. I would initially suggest a cleanup in the project - deleting and regenerating the code, because the latest toolbox didn't make major changes to how these modules work compared to the previous version, but the way pin configuration is handled has been changed instead.
In addition, for the ease of finding a solution, you can provide the model and the configuration project to more accurately evaluate the possible problems.
Best regards,
Dragos