MPC57xx FCAN Receive Blocking Mode Error

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

MPC57xx FCAN Receive Blocking Mode Error

780 Views
j_wale_3
Contributor II

Hello Everyone,

Trying to select the Blocking mode in the MPC57xx MBDT FCAN receiver gives an error 'Simulink.DataType object 'status_t' is not in scope...' in version 3.2.0. I have also seen this in v3.1.0 and it has also been reported in v3.0.0 (Unable-to-use-Blocking-mode-in-FCAN-Receive-block).

Can anyone suggest a fix or work-around?

Is anyone from NXP prepared to explain why it is still broken after several revisions to the toolbox?

Thanks,

John.

0 Kudos
2 Replies

760 Views
paulvlase
NXP Employee
NXP Employee

Hi @j_wale_3 ,

 

I installed MBDToolbox_MPC57xx_3.2.0_20200414.mltbx in Matlab R2019b, and I wasn't able to reproduce your error.

 

I know for sure that we fixed this error in 3.2.0, and you are right, that in the previous version you got this error when you tried to used the CAN blocking mode.

 

Do you have multiple version of the MPC57xx toolbox installed in Matlab? If so, can you try to uninstall all MPC57xx toolboxes, reinstall the 3.2.0 one, and try again?

 

Regards,

Paul

0 Kudos

749 Views
j_wale_3
Contributor II

Hi Paul,

Thanks for your reply.

I have been using Matlab R2018b, if that makes any difference. I never got the blocking mode to work with MBDT v3.1.0 and immediately after upgrading to v3.2.0, it still would not work. However, since then I de-installed the MBDT completely and removed the old remnants of the original toolbox (the update installation created a new folder with a different name to the previous installation which broke several links). On re-starting Matlab and re-installing MBDT v3.2.0 for the second time, CAN blocking mode can now be selected without seeing the status_t error. I don't know if it was the removal of the old install remnants or the Matlab re-start that made the difference. Either way, I consider this problem to be resolved now.

On a related note, please would you be able to provide any further information on what the Status output does? The help page does not even mention it, but I did find your reply on another thread related to the CAN send function in blocking mode that says this:

The output of the blocking FCAN_Send is:

  • Status (enum)

Status enum output is a Simulink enumeration mapped to the status_t C enum from SDK. Supported values for FCAN are:

  • status_t.STATUS_SUCCESS if successful
  • status_t.STATUS_TIMEOUT if the timeout is reached
  • status_t.STATUS_BUSY if another receive/send using the same message buffer is in progress

For the receive function, does STATUS_SUCCESS mean that a CAN frame has been received and is ready for processing? I am currently attempting to use this block in a polling loop to tell my program when it needs to act on a received message. I have set the timeout to zero on the assumption that it will return immediately with STATUS_TIMEOUT if there is no CAN message in the receive buffer. Can you confirm if this is a valid way to use blocking mode or should I be checking one or more of the other outputs to indicate when a message has been received?

 

Thanks again,

John.

0 Kudos