MBDT Example s32k37x_s32k39x_can_receive_s32ct not working on S32K396-BGA-DC1 Evaluation Board

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

MBDT Example s32k37x_s32k39x_can_receive_s32ct not working on S32K396-BGA-DC1 Evaluation Board

ソリューションへジャンプ
1,506件の閲覧回数
Vincent_91687
Contributor I

Hello,

I'm trying to receive a CAN message on S32K396-BGA-DC1 Evaluation Board.

I successfully ran the s32k37x_s32k39x_can_transmit_ebt example, so I can receive CAN message from the board. Thus, i guess that my hardware setup is correct.

However, running the s32k37x_s32k39x_can_receive_s32ct example, D33 LED does not turn on when I send a message to the board.

I'm using two Peak PCAN USB adapters, the frame from the board is received by both my PCANs.

The frame i'm sending is from a PCAN is seen by the other PCAN but not by the board.

I did check configuration

Rx/Tx pins are set as in the board user guide (PTC23: Rx / PTC21 : Tx)

2025-03-05 09_29_46-_Pins - s32k37x_s32k39x_can_receive_s3... (S32K396, Cortex-M7 (Core #0)) [Offlin.png

Controller is not in loopback mode

2025-03-05 09_35_24-_Peripherals - s32k37x_s32k39x_can_receive_s3... (S32K396, Cortex-M7 (Core #0)) .png

I have some CanHardwareObjects set as receiver with Id filtering disabled (Filter mask 0 = accept all frames)

2025-03-05 09_36_20-_Peripherals - s32k37x_s32k39x_can_receive_s3... (S32K396, Cortex-M7 (Core #0)) .png

Can someone help with this ?

Thank you

Best regards

Vincent

0 件の賞賛
返信
1 解決策
1,404件の閲覧回数
Irina_Costachescu
NXP Employee
NXP Employee

Hi @Vincent_91687 

Could you please try and send frames with EXTENDED Id option enabled inside your Can analyzer software and let us know if this works?

extended.png

From what I am noticing from the configuration project, all the Receive hardware objects are configured with Can ID Message Type set as EXTENDED. For being also to also receive STANDARD frames, you should change the option to STANDARD.

For more details on this topic, could you please consult the following thread? A detailed explanation on the hardware objects, EXTENDED/STANDARD frame types, and the available options, is provided in this thread, which you might find helpful. https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K312-CAN-configuration/m-p/2044459#M...

Hope this helps,

Irina

 
 

 

 

元の投稿で解決策を見る

0 件の賞賛
返信
7 返答(返信)
1,429件の閲覧回数
Irina_Costachescu
NXP Employee
NXP Employee

Hi @Vincent_91687 

I have tried it on my own setup, and I managed to receive CAN messages from my CAN analyzer. Could you please check if you have selected the BGA-DC1 configuration in your model, like illustrated below?

canreceive.png

The reason why the LED is not blinking could be related to the fact that, on the BGA-DC1, the pin routed to the D33 BLUE LED is different than the one configured in the default configuration project that we provide for the S32K396 processor.

Changing the Configuration Project Template to address the DC1 board might solve the issue you are currently encountering.

Please let us know if this helps,

Irina

0 件の賞賛
返信
1,413件の閲覧回数
Vincent_91687
Contributor I

Hi Irina,

Thanks for your help.

 

I confirm that i'm using the same Configuration Project Template 

2025-03-06 13_48_02-Configuration Parameters_ s32k37x_s32k39x_can_receive_s32ct_Configuration (Activ.png

By the way, the s32k37x_s32k39x_can_transmit_ebt model example is also toggling D33 LED on frame transmission event.

Using the same config template with this model, i can see the LED going on and off and the message is transmitted

To dig a bit further, i have exported the model source code to S32 Design Studio and run the code in debug

It appears that the code never enter in the "CanIf_RxIndication" function (the function setting the LED), like if the interrupt never is never fired.

Call hierarchy of "CanIf_RxIndication" brings me to "Can_43_FLEXCAN_MainFunction_Read" in which we never enter either, explaining why interrupt is never fired

In fact, at any time I stop the code, we are in

while (runModel) {
}

Thanks

Vincent

0 件の賞賛
返信
1,405件の閲覧回数
Irina_Costachescu
NXP Employee
NXP Employee

Hi @Vincent_91687 

Could you please try and send frames with EXTENDED Id option enabled inside your Can analyzer software and let us know if this works?

extended.png

From what I am noticing from the configuration project, all the Receive hardware objects are configured with Can ID Message Type set as EXTENDED. For being also to also receive STANDARD frames, you should change the option to STANDARD.

For more details on this topic, could you please consult the following thread? A detailed explanation on the hardware objects, EXTENDED/STANDARD frame types, and the available options, is provided in this thread, which you might find helpful. https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/S32K312-CAN-configuration/m-p/2044459#M...

Hope this helps,

Irina

 
 

 

 

0 件の賞賛
返信
1,389件の閲覧回数
Vincent_91687
Contributor I
Hello Irina,
It works !
Thank you for the link, this is very helpful.
More generaly, is there a reference document (like a PDF) describing all options and configurations available in S32 Configuration Tool for the S32K396 MCU ?
I had a look on NXP web site but i didn't find it.
Do I need a "granted" account for this ?
Thank you very much for your help
Best regards
Vincent
0 件の賞賛
返信
1,374件の閲覧回数
Irina_Costachescu
NXP Employee
NXP Employee

Hello @Vincent_91687 

MBDT integrates the RTD (Real-Time Drivers) for configuration and access to the hardware (peripherals, pins, clocks, interrupts). For more details on configuration parameters, and functions implemented by our blocks, you could check the RTD User Manual for the component you would like to use, and also the AUTOSAR driver standard (RTD MCAL layer is AUTOSAR compatible).

For CAN, and other blocks as well, you could access this documentation I am referring to by clicking on the Help button of the Simulink block, and navigating to the Code Generation section, like illustrated below.

candoc.png

For configuration examples, you could check the configuration projects that we are delivering together with our application examples. 

Moreover, in case of the ADC, PWM, CAN, UART and DIO, we have also put together some articles on our MBDT NXP Community, that provide a more detailed insight into the available parameters, and settings. Maybe you would find them useful as well. Here is the link to the CAN one, but the others are available under the Beginner's Guide for Model-Based Design Toolbox section on our main page.

Hope this helps you. Please let us know in case additional information is required.

Thanks,

Irina

0 件の賞賛
返信
1,467件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@Vincent_91687

Can you provide us with this routine:s32k37x_s32k39x_can_receive_s32ct

(I'm sorry I don't know if we have such a routine), I will take the time to check it for you.

0 件の賞賛
返信
1,444件の閲覧回数
Vincent_91687
Contributor I

Hello,

Thanks for your help.

Please find attached the model i'm trying to run.

Model is saved in Matlab 2023b version.


Best regards

Vincent

0 件の賞賛
返信