writing variables problem

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

writing variables problem

ソリューションへジャンプ
2,893件の閲覧回数
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,828件の閲覧回数
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,828件の閲覧回数
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,828件の閲覧回数
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,829件の閲覧回数
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