writing variables problem

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

writing variables problem

跳至解决方案
2,115 次查看
hjhjhj
Contributor IV

Hi,

I try to write variables in Variable Watch by CAN communication.Sometimes it  succeeds ,while it often fails to set the variable value.

222.bmp

I am sure that FreeMASTER CAN communication is OK because reading variables is OK.Can you help me solve the writing variables problem?

0 项奖励
回复
1 解答
2,050 次查看
MichalH
NXP Apps Support
NXP Apps Support

Hello,

can you tell if you use the interrupt-driven or polling mode of FreeMASTER communication? You say that reading is 100% successful while writing often fails on communication timeout... This could be an issue that the FMSTR_Poll is not called fast enough in polling mode. In interrupt mode, it could also happen if the application would be disabling interrupts for long time. The Write command takes slightly longer time to process than the Read command - which could make the difference.

The issue could be also caused by wrong bus termination or imprecise clock. Can you try to lower the communication speed?

Also: does the failure occurs also with the FreeMASTER test application included in FreeMASTER driver? 

Thanks,

Michal

在原帖中查看解决方案

3 回复数
2,050 次查看
MichalH
NXP Apps Support
NXP Apps Support

Also, have you tried to increase the CAN response timeout in the FreeMASTER-over-CAN plug-in configuration? 

If none of the ideas help, please try to capture the CAN communication when writing the variable. Just to see if there is any response coming out from the target MCU.

pastedImage_1.png

Regards,

Michal

0 项奖励
回复
2,050 次查看
hjhjhj
Contributor IV

Hi Michal,

The problem has been solved now.The FMSTR_Poll is not called fast enough in polling mode.I put the FMSTR_Poll in the correct place and the writing variables function is OK.

Thanks,

HJ

0 项奖励
回复
2,051 次查看
MichalH
NXP Apps Support
NXP Apps Support

Hello,

can you tell if you use the interrupt-driven or polling mode of FreeMASTER communication? You say that reading is 100% successful while writing often fails on communication timeout... This could be an issue that the FMSTR_Poll is not called fast enough in polling mode. In interrupt mode, it could also happen if the application would be disabling interrupts for long time. The Write command takes slightly longer time to process than the Read command - which could make the difference.

The issue could be also caused by wrong bus termination or imprecise clock. Can you try to lower the communication speed?

Also: does the failure occurs also with the FreeMASTER test application included in FreeMASTER driver? 

Thanks,

Michal