writing variables problem

cancel
Showing results for 
Search instead for 
Did you mean: 

writing variables problem

Jump to solution
116 Views
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 Kudos
1 Solution
51 Views
NXP Employee
NXP Employee

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

View solution in original post

3 Replies
51 Views
NXP Employee
NXP Employee

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 Kudos
51 Views
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 Kudos
52 Views
NXP Employee
NXP Employee

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

View solution in original post