S32K144 CAN Extended ID (FCAN_Send)

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

S32K144 CAN Extended ID (FCAN_Send)

跳至解决方案
2,829 次查看
gramirezv
Contributor III

Hi,

I'm using a S32K144EVB, with the "Model-Based Design Toolbox for S32K1xx Series Version 2018.R1".

And, I'm trying to send a CAN message with Extended ID (29-bit). In the FCAN_Send block, I click the "Extended ID" checkbox and set the ID to 18FF0000.

pastedImage_2.png

But when I monitor the CAN bus, the ID is set to 0.

pastedImage_3.png

I tried using a Standard ID (Extended ID checkbox unchecked) and it works just fine.

I looked into the generated C code for this block I noticed the following.

308/* S-Function (fcan_s32k14_send): '<S8>/FCAN_Send' incorporates:
309 * Constant: '<S8>/TX_CAN_Data_Length'
310 */
311    {
312       uint8_t* data = &main_B.dr_TX_CAN_Data[0];
313       flexcan_data_info_t txInfo = {
314       .msg_id_type = FLEXCAN_MSG_ID_STD,
315       .data_length = ((uint8_T)8U),
316       .fd_enable = false,
317       .fd_padding = 0x0,
318       .enable_brs = false,
319       .is_remote = false
320    };
321
322    FLEXCAN_DRV_ConfigTxMb(0, 13, &txInfo, 0x800);
323    FLEXCAN_DRV_Send(0, 13, &txInfo, 0x800, data);
324 }

The msg_id_type is set to FLEXCAN_MSG_ID_STD, instead of FLEXCAN_MSG_ID_EXT

Is there a way to get this working, I really need to use the Extended ID since I'm working with J1939.

Thanks a lot,

Gustavo

1 解答
2,166 次查看
constantinrazva
NXP Employee
NXP Employee

Hello gramirezv‌,

I have the hotfix for setting the extended ID.

Please replace the following file

{install_dir}\mbdtbx_s32k14x\mbdtbx_s32k14x\mscripts\fcan\mbd_s32k14_fcan_send_sdk_params.p

with the file attached.

Thanks gabrielacatana for providing this fix.

Kind regards,

Razvan.

在原帖中查看解决方案

7 回复数
2,166 次查看
constantinrazva
NXP Employee
NXP Employee

Hello gramirezv‌,

It is indeed a strange behavior, I will take a look at the code generation and get back to you probably tomorrow with a fix.

Kind regards,

Razvan. 

0 项奖励
回复
2,166 次查看
gramirezv
Contributor III

Hi constantinrazvan.chivu‌,

Thanks a lot for your quick response (as usual) :smileyhappy:

Best regards,

Gustavo

0 项奖励
回复
2,167 次查看
constantinrazva
NXP Employee
NXP Employee

Hello gramirezv‌,

I have the hotfix for setting the extended ID.

Please replace the following file

{install_dir}\mbdtbx_s32k14x\mbdtbx_s32k14x\mscripts\fcan\mbd_s32k14_fcan_send_sdk_params.p

with the file attached.

Thanks gabrielacatana for providing this fix.

Kind regards,

Razvan.

2,166 次查看
sparkee
Contributor V

Is this hotfix still necessary?  I seem to have a similar issue.  Unfortunately I'm unable to read the p code to decipher whether or not this was incorporated into the latest release.

0 项奖励
回复
2,166 次查看
sparkee
Contributor V

Looks like it breaks something now.  Won't build.

0 项奖励
回复
2,166 次查看
constantinrazva
NXP Employee
NXP Employee

Hello sparkee‌,

These fixes were integrated in the latest release (v4.1) - so you don't need the patch. There were some changes to the toolbox from the previous release, so that is why it breaks (searches for different paths to blocks, etc.). 

Kind regards,

Razvan.

2,166 次查看
gramirezv
Contributor III

Hi constantinrazvan.chivu‌,

Thank you and gabrielacatana‌ for providing this hotfix, I really appreciate your prompt response.

I replaced the file per your instructions and it's working as expected. I got the Extended ID message transmitted properly.

pastedImage_1.png

Best regards,

Gustavo