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.