I’m trying to implement a single PWM output in the S32K312 EVB board.
I’ve previously generated different PWM signals but without the MCAL abstraction layer. I need to use this layer to generate and verify the .mex file that we will use during our MBD development.
I’m trying to use EMIOS_1 channel 12 that is connected to the onboard red led.
I think that the configuration is correct, but when the Pwm_Init function is called, the program crash (go to HardFault_Handler). I have followed the execution and found that the exception arise when the following function is executed:
Emios_Pwm_Ip_SetOutputUpdate(Emios_Pwm_Ip_HwAddrType *const Base,
uint8 Channel,
boolean Value)
{
Base->OUDIS = Base->OUDIS | (eMIOS_OUDIS_OU0((Value == TRUE) ? 0x00U : 0x01U) << Channel);
}
As far as I now all the parameters are correct. Base is pointing to address 0x4008C000, channel value is 12 (intended emios channel) and Value is TRUE.
Do you have any idea on this problem.
I'm triying to attach the .mex file but the system doesn't allow me to upload it.
Thanks you in advance.
I have just intalled the DS a month and a half ago, but don't have any 312 example on my installation. I think that need to check for updates.
Hi @Alfredo_Rubio,
According to the release notes of the RTD RTM 2.0.x, it is compatible with S32DS IDE 3.4.
Please install the 3.4 version.
The RTD should be available in S32DS Extensions and Updates.
If not, let me know.
Best regards,
Daniel
And yes, the problem was that the clock was not enabled for any emios.
It was not clear were to enable the clock under de MCAL environment. I had checked that it was enable on the menu bar clock icon, but I have found that it was the right place. Yo need to enable on MCAL->MCU->McuModuleConfiguration->McuModeSettingConf
Thanks
Hi @Alfredo_Rubio,
Do you initialize the EMIOS clock before the EMIOS?
There is this RTD IP example that utilizes EMIOS_1_ch12 and the LED for PWM.
Have you tested it?
Regards,
Daniel
I ' have just checked for update and the last S32K3XX AUTOSAR version available is the 4.4 that I have already installed. How can I get the 4.4.2.0.1 that you have?
Thanks in advance
This is my new from example menu