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.
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
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?
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
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
but when i click go button, the MCU has no response .
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
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.
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