S32K118 lpuart0 clock issue using AUTOSAR MCAL S32K14X_MCAL4_3_RTM_1_0_1

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

S32K118 lpuart0 clock issue using AUTOSAR MCAL S32K14X_MCAL4_3_RTM_1_0_1

Jump to solution
1,981 Views
riglesias
Contributor II

Hello, I´m implementing a UART module with the S32k118 and I´m using the MCAL ( Autosar abstraction layer ) to configure all the ports and clocks. But I´m having an issue:

If I configure the LPUART clock manually, setting the PCC registers to select the clock like this:

PCC->PCCn[PCC_LPUART0_INDEX] |=  PCC_PCCn_PCS(0x011) -> SELECT FIRCDIV2_CLK

( See Clock_Selection.PNG )

The Uart works.

However, If i remove this code and I only configure this clock using the Tresos tool, in the MCU module

( See Lpuart0_Tresos_Config.PNG )

I have an runtime error.

I don´t know if this is the expected behaviour and its strictly necessary to initialize the PCC registers manually, or this should be done by the MCAL, and this is a Tresos configuration error, So I´m posting this question here in case somebody knows how to solve this issue. Thank u

 

 
 
0 Kudos
1 Solution
1,942 Views
hungnguyenphi
NXP Employee
NXP Employee

Hello riglesias,

I have tried the configuration in your picture and I see that the Mcu still can set correct value to PCS field of register PCC_LPUART0.

 

hungnguyenphi_0-1608001772952.png

 

So I am asking for the Mcu.xdm or Mcu.epc which is in your tresos project.

Best regards,

Hung

View solution in original post

5 Replies
1,972 Views
hungnguyenphi
NXP Employee
NXP Employee

Hello riglesias,

From my point of view, the MCU can set the FIRC clock for LPUART normally. Could you please share your MCU configuration for checking this case.

Best regards,

Hung.

1,959 Views
riglesias
Contributor II

Yes, I attached an image of my lpuart mcu configuration in this message. Thank you for the reply.

0 Kudos
1,943 Views
hungnguyenphi
NXP Employee
NXP Employee

Hello riglesias,

I have tried the configuration in your picture and I see that the Mcu still can set correct value to PCS field of register PCC_LPUART0.

 

hungnguyenphi_0-1608001772952.png

 

So I am asking for the Mcu.xdm or Mcu.epc which is in your tresos project.

Best regards,

Hung

1,936 Views
riglesias
Contributor II

Hello, it seems like i am doing something wrong, because the cgc bit of my lpuart0 is not setting despite I am calling mcu init functions like you:

   Mcu_Init(&McuModuleConfiguration);

   Mcu_InitClock(McuClockSettingConfig_0);
 
I attach my registers capture and the mcu configuration, just in case you would like to check it.
 
Thank u anyways for the reply, Best regards.
0 Kudos
1,934 Views
riglesias
Contributor II

I encountered the problem, i was trying to configure the uart before doing the mcu_init(). Thank u for the reply

0 Kudos