S32K312 PWM initialization problem under MCAL

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S32K312 PWM initialization problem under MCAL

2,223 次查看
Alfredo_Rubio
Contributor II

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.

0 项奖励
回复
5 回复数

2,131 次查看
Alfredo_Rubio
Contributor II

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.

 

0 项奖励
回复

2,114 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复

2,123 次查看
Alfredo_Rubio
Contributor II

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 

 

0 项奖励
回复

2,201 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

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?

danielmartynek_0-1688910771644.png

 

Regards,

Daniel

 

0 项奖励
回复

2,120 次查看
Alfredo_Rubio
Contributor II

 

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

 

 

Alfredo_Rubio_0-1688977252127.png

 

0 项奖励
回复