Unable to get a reading on data logging/scope on MBDT while in External Mode

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

Unable to get a reading on data logging/scope on MBDT while in External Mode

1,436 Views
ylahdili
Contributor II

We have a Simulink model that reads the ADC input of our i.MX RT1024 board, and displays it on a scope. To be able to visualize this input, we are running the model on External Mode ("Tune & Monitor" button). It successfully runs, and an LED correctly light up when potentiometer output (ADC input) exceeds a certain value. We are also able to press a virtual toggle button on the Simulink dashboard to turn the LED on and off.

But the problem is that we are unable to get the ADC input reading in Simulink: the scope connected to the output of ADC MBDT block is always blank. What can be the cause of this?

Thank you very much.

0 Kudos
Reply
1 Reply

1,329 Views
ylahdili
Contributor II

Hi, I found the solution to my issue: in Simulink's Hardware Settings > External Mode > Communication Interface, I simply had to select "XCP Serial Interface" instead of the "Serial Interface" which was there by default. Now, I am able to log my data and see the "Data Inspector" icon on the Simulink tab.

I still though have an issue when I close my Simulink model and re-open it, when I run it and it gets compiled and uploaded to board, I am hit with this error "External Mode Open Protocol Connect command failed Caused by: Could not connect to XCP slave: XCP Master internal error: Busy(0) or no timeout(2) for 255" (which also happened when I used "Serial Interface" although the error message was rephrased to "Error occurred while executing External Mode MEX-file 'ext_serial_win32_comm"). My only solution is to always randomly change several Hardware Settings (baud rate, buffer, etc..), sample rate, comment out some blocks, and run it each time (which takes at least 1 hour of continuous fiddling), until it finally says "running on NXP MIMXRT1024..", and I rejoice. And from there it will run every time as expected, until Simulink gets closed by mistake.

0 Kudos
Reply