MPC5744P & Autosar (MPC574XP_MCAL4_0_RTM_2_0_2)

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MPC5744P & Autosar (MPC574XP_MCAL4_0_RTM_2_0_2)

466件の閲覧回数
MElGreatly
Contributor II

Hello experts,

I installed the AUTOSAR MCAL package MPC574XP_MCAL4_0_RTM_2_0_2, but it fails to work on the MPC5744P. To isolate the issue, I commented out all application code in main() and replaced it with a minimal test case:

BoardInit(); GPIOInit(); CANInit();

This test code (with hardcoded register values, where only register addresses are initialized) is trusted—it has worked in multiple MPC5744P S32 projects. However, in the AUTOSAR project, while the debugger confirms registers are set correctly, the CAN peripheral remains non-functional.

Questions:

Could the MPC574XP_MCAL package be incompatible with the MPC5744P despite shared branding?

Why might the test code fail in the AUTOSAR context despite working elsewhere?

Could the AUTOSAR startup code (e.g., clock initialization, MPU configuration, or exception handling) conflict with the MCAL or hardware?


Thanks in advance.

0 件の賞賛
返信
7 返答(返信)

360件の閲覧回数
MElGreatly
Contributor II

Thank you Peter for your answer,

First:  My development Board is https://www.nxp.com/design/design-center/development-boards-and-designs/DEVKIT-MPC5744P

I downloaded these packages: Autosar Version 4.0.3

MElGreatly_4-1756184394400.png

Second: I need to test the CAN task which uses CAN0, it didn't work, so I used EB tresos to generate another configuration file;
Look at this part of the generated configuration: Can_PBcfg.c file: 
Configuration of FlexCan controller

MElGreatly_5-1756185281810.png

MElGreatly_8-1756185570117.png

the CTRL1 register was not affected by changing the configuration,
the case in screenshot  - for example -
PSEG1 =2
PSEG2 =2
PROPSEG =5
RJW =2
but the values in the CTRL1 register are ones ( after Can_Init function -in Can.c - return ) 
MElGreatly_7-1756185457690.png

Ones filled after this part in Can_FlexCan_ChangeBaudrate function - in Can_Flexcan.c - which called in Can_Init function.

MElGreatly_9-1756186502784.png

Are there any bugs at this peripheral ?

Are there any solutions to operate the CAN peripheral using these package ?

Thanks in advance.

 

 

 

 

 

0 件の賞賛
返信

169件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Here is the feedback from SW team:

Follow the release note, please make sure that the diab version was supported for this release is:

petervlna_0-1756451008573.png

Can you read Can_ControllerStatuses and show value of all elements in this structure at some points as below:

petervlna_0-1756451160473.png

like this:

petervlna_1-1756451172867.png

Some bits in CTRL1 just can be write in Freeze mode as RM mentioned:

petervlna_2-1756451184079.png

So, please make sure that CAN controller is in Freeze mode before setting CTRL1 value, you can check this through the register MCR

petervlna_3-1756451193728.png

This setting and checking is in the function Can_FlexCan_ChangeBaudrate() 

petervlna_4-1756451205056.png

Best regards,

Peter

0 件の賞賛
返信

56件の閲覧回数
MElGreatly
Contributor II

Hello,

 Diab version is:

MElGreatly_2-1756717042635.png


 Can_ControllerStatuses value at Can_FlexCan_InitVariables function:

MElGreatly_0-1756716576199.png

 Can_ControllerStatuses value at Can_FlexCan_ChangeBaudrate function:

MElGreatly_1-1756716753480.png

The same value for Can_ControllerStatuses before setting CTRL1 value

Thanks

 

0 件の賞賛
返信

265件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hello,

there is no restriction on access to CTRL1 register:

petervlna_0-1756278769900.png

petervlna_1-1756278799648.png

Switch to assembly debug to check the instruction execution on core to see if the register is really going to be modified. Also try direct write via debugger.

I am sure there is no issue in HW here.

Either the peripheral is not clocked and you trying to write or the SW is simply not performing writes to the register address.

Are there any bugs at this peripheral ?

All issues are described in errata sheets. But I do not expect the issue is in uC. I suspect your SW.

Simply try write via debugger to the register..

Best regards,

Peter

0 件の賞賛
返信

229件の閲覧回数
MElGreatly
Contributor II

I tried direct write; worked , and I noticed that the problem is the global array of struct named "Can_ControllerStatuses[CAN_MAXCTRL_CONFIGURED]" was not affected with direct write of any member of this struct that should holding current status/run-time configuration of individual FlexCAN controllers, 

MElGreatly_1-1756345218005.png


At Can_FlexCan_InitVariables function in Can_Flexcan.c that initializes all global variables/statuses for all controllers, 

MElGreatly_0-1756344921400.png

this screenshot shows the 1111 values after write 0 to this member of the struct ! 
why is this happen ? I use diab compiler and S32 , this is my project attached, if you could help for any solutions.

Thanks for advance.

 

0 件の賞賛
返信

203件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I have forwarded your issue to the SW team as I am not familiar with CAN driver.

Once I have answer I will update you.

Best regards,

Peter

0 件の賞賛
返信

443件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Could the MPC574XP_MCAL package be incompatible with the MPC5744P despite shared branding?

No. It is fully compatible and tested on MPC574xP device.

petervlna_0-1754556341415.png

petervlna_1-1754556466226.png

 

Could the AUTOSAR startup code (e.g., clock initialization, MPU configuration, or exception handling) conflict with the MCAL or hardware?

No. As the MCAL is AUTOSAR compliant. (developed according the autosar standard).

Why might the test code fail in the AUTOSAR context despite working elsewhere?

Not sure. Example code should work right after import.

petervlna_2-1754556586042.png

Could the MPC574XP_MCAL package be incompatible with the MPC5744P despite shared branding?

Always refer to release notes of the SW packages.

petervlna_3-1754556659044.png

So maybe you have autosar other then 4.0.

Best regards,

Peter

 

 

0 件の賞賛
返信