Transmission speed of i.MX RT 1170 EVK with MBDT in External Mode

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

Transmission speed of i.MX RT 1170 EVK with MBDT in External Mode

1,245 Views
allmo
Contributor II

Hello everyone,

i want to use the i.MX RT 1170 EVK as a target platform to test and develop control devices. Therefore it is really important to have a fast logging of the measured signals. In the picture below you can see the current model with which I am currently doing tests. 

ModelContent.png

I read the I2C data and then do some calculation to convert the data into a physical unit. 
I am using the following model settings: 
Solver: FixedStepDiscrete
Fixed-step size = 0.001

After I have set the External Mode, I used the "Monitor & Tune" to download the model onto the target and connect Matlab to it. All works fine, but when I open the scope, i see an interrupted signal (picture below). There is short time in which I can see the measured signal, but there are also some breaks, where no measured signals arrives.

Signal.png

In the picture below you see my setting of the External Signal & Triggering options. 

ExternalSignalTriggering.png

Is it possible to have high-resolution signals while using the external mode of matlab without these breaks? What do I need to change in my settings?

 

By the way, what is the best way for logging and storing the signals from External Model in Matlab to have them available for a later use like plotting oder evaluations? The block "To Workspace" worked not for me, i get a the following warning Saving external mode simulation output as a single object is not supported because the workspace variable 'out' is not created during model code execution.

 

Best regards,
Moritz

0 Kudos
4 Replies

1,233 Views
nxa11767
NXP Employee
NXP Employee

Hi @allmo ,

If you need to visualize in real time the variables/signal of your model you can use also the FreeMaster tool. I think is a better option that external mode in terms of features and connection stability.

You can find here a detailed presentation of the tool and it's capabilities.

It has nice features that allows to visualize and also modify variables in real time, record variables; it has different options to see variables/signals in a oscilloscope and also capture the data displayed in a local file; here is a post on this topic: https://community.nxp.com/t5/FreeMASTER/How-do-I-get-the-full-values-of-variables-in-FreeMASTER/m-p/...

The toolbox has special blocks for Freemaster:

nxa11767_0-1625560794079.png

To enable your model to use the freemaster, you need to add the Freemaster config block in your model and use Build, Deploy&Start application from Simulink that will build and download the application on the board. (you can also check the LPI2C examples from the toolbox that have this block added and uses the FM to see the variables send/recv via I2C).

You need to install Freemaster tool v3.1, open it and set up your project by specifying the path to the elf file you just created from simulink: (Project->Options)

nxa11767_1-1625561692275.png

I hope this helps,

Alexandra

0 Kudos

1,228 Views
allmo
Contributor II

hello@nxa11767 ,

thanks for the answer.

I have tried the FreeMaster-Tool for the visualization of the values, the operation is very intuitive
In the oscilloscope I use 0 as period, because 0 is the maximum peroid, but what exactly is the maximum peroid (in ms)? For us it is very important that we have synchronised points with the same sample time, but when I have a look at the measurement points with this setup, i see that the time between two points differs a lot.

Is there a possibillity or a setup, where i can get all measurement points with the same sample time (a sample time of 1ms for example)?

I think Matlab provides this synchronization and that's the reason why i want to use the external mode.
The FreeMaster is really great (it's easy to use), but is there a possible setup to run the evalboard in external mode (with 1 ms sample time) and observe as well as save the measurement in matlab/simulink?
We want to use Matlab/Simulink for the evaluation, since our algorithm already exists in this environment.

Best regards,
Moritz

0 Kudos

1,190 Views
nxa11767
NXP Employee
NXP Employee

Hello @allmo ,

That period set in defines the oscilloscope sampling period. You can try to sync this value with your model step size. You can try also the recorder feature of the freemaster that allows a faster sampling here is a short description on how the recorder works:

"4.1.1.3 Recorder
The Recorder item in the Project Tree structure defines a real-time recorder chart to be shown in the Detail View pane. While the Oscilloscope periodically reads variable values and plots them in real time, the Recorder runs on the target board, reads application variables, and sends them to the FreeMASTER tool in a burst mode. The recorder variables are continually sampled and stored into a circular buffer in the target board application. When the trigger event is detected by the target, data samples are counted until the number of Recorder samples is reached. At this point, data is sent to the FreeMASTER application. This mechanism enables the use of a much shorter sampling period and enables sampling and plotting of very fast actions."

I am also thinking that you can try to set up the the LPI2C to work in transfer mode - this is done from .mex file of your model, choosing transfer in Master Configuration; you can also see an example for configuration in the toolbox, in evkmimxrt1170_lpi2c_master_trans_recv.mdl(and the evkmimxrt1170_lpi2c_master_trans_recvConfig.mex file).  the function callback will be called when the data is received from the sensor device.

I also found this article on mathworks on parameters tuning on external mode, exemplified on TI: https://www.mathworks.com/help/supportpkg/texasinstrumentsc2000/ug/parameter-tuning-and-signal-loggi.... It explains also how to save the values for offline usage.

 

Best regards,

Alexandra

0 Kudos

1,201 Views
allmo
Contributor II

Hello @nxa11767 , 

do you have any suggestions or solutions?

 

Best regards, 

Moritz

0 Kudos