ERROR CODE :0x858e003(Timeout when waiting for the CAN/LIN response(No data received) )

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ERROR CODE :0x858e003(Timeout when waiting for the CAN/LIN response(No data received) )

999 Views
leang
Contributor II

when i migrate freemaster to other platforms,i foud if i want to make Test Connection  ok with CAN,i need to run the function FREE_Poll()  twice.

leang_0-1665218784518.png

Becasuse when i debug with step in  i found the  first time,the    pcm_wFlags.flg.bTxActive    in function FMSTR_TxCan();  is 0,so the function FMSTR_TxCan()  will return fasle  

leang_1-1665219262642.png

then it can not transmit data to freemaster , and the program wll go to FMSTR_RxDone() and FMSTR_SendResponse() ,but when the program go  to the FREE_Poll()  secondly, FMSTR_TxCan() will excute  normally.

Is there anybody could explain that? 

 

0 Kudos
4 Replies

971 Views
leang
Contributor II

sorry  Penultimate  picture  should be this

916659027242981919.png

0 Kudos

978 Views
MichalH
NXP Apps Support
NXP Apps Support

Hello,

the FMSTR_Poll() should be called periodically in the main application task or loop. It has an internal state machine which needs to be called again and again to get freemaster protocol properly handled.

In your case, the first call will receive the data and the second call sends the response.

Regards,
Michal

0 Kudos

972 Views
leang
Contributor II

Dear Michal

Thanks  for your reply,  

But now ,sorry  for that , i have another question to bother you .   ^^

as i understand it, the freemaster send the address which is being monitored,and the MCU send the data in the address monitored.

My program logic is as long as my MCU received a message from freemaster, go  to interupt to read it , then handl  it ,the FMSTR_Poll()   in a while(1)  in the main program...

So i found that,when i click the test  connection  MCU has response

1.png

3.png

but when i click go button, the MCU  has no response .

2.png

4.png

624122750637575139.png

so,i want to know my logic is wrong? the address information may be stored in two  or three can message from freemter?

 

Best regards.

green  hand

  

 

0 Kudos

968 Views
MichalH
NXP Apps Support
NXP Apps Support

Hello, 

yes, some longer messages and responses may be split to multiple CAN frames. But this should be handled automatically by the freemaster driver. You just need to make sure the FMSTR_Poll call is called periodically.

  • Can you try to change both CAN ID (for RX and TX) to 0x7aa?  (in the FreeMASTER Configuration dialog and also make sure these are set correctly in freemaster_cfg.h or freemaster_can.h - FMSTR_CAN_CMDID and FMSTR_CAN_RESPID)
  • What interrupt mode do you use (which of FMSTR_POLL_DRIVEN,  FMSTR_SHORT_INTR, FMSTR_LONG_INTR do you have set in freemaster_cfg.h)
  • I reccommend to try the FMSTR_POLL_DRIVEN mode first as this does not depend on interrupts.

Please tell me more about your target platform, freemaster driver version etc.  There are two versions of the freemaster protocol and the PC tool tries both to detect what version is supported by the MCU application. 

Thanks,
Michal

0 Kudos