• AVR Freaks

Helpful ReplyBlock Set Build Error with Matlab 2016a

Author
AMeraj
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2017/01/18 12:58:10
  • Location: 0
  • Status: offline
2017/01/20 02:50:15 (permalink)
0

Block Set Build Error with Matlab 2016a

Hi,
 
I am struggling from the last 3 days to generate a single code using the block set.
 
Matlab R2016a.
OS: Windows 10
 
All I am generating is the Master Block nothing else just for the test case and I get the following error:

Elapsed: 25 sec
### Generating code into build folder: C:\Users\ali\Documents\MATLAB\untitled.X
### Invoking Target Language Compiler on untitled.rtw
### Using System Target File: C:\Program Files (x86)\Microchip\MatlabTools\blocks\MCHP_dsPIC_stf.tlc
### Loading TLC function libraries
### Initial pass through model to cache user defined code
### Caching model source code .
Error: File: C:\Program Files (x86)\Microchip\MatlabTools\blocks\MCHP_Master.tlc Line: 5 Column: 49
Unable to find ChipIdL1 within the RTWGenSettings scope
Main program: ==> [00] C:\Program Files (x86)\Microchip\MatlabTools\blocks\MCHP_Master.tlc:Start(5)
[01] C:\Program Files\MATLAB\R2016a\rtw\c\tlc\blocks\gensfun.tlc:Start(574)
[02] C:\Program Files\MATLAB\R2016a\rtw\c\tlc\mw\opaquelib.tlc:OpaqueTLCBlockFcn(3845)
[03] C:\Users\ali\Documents\MATLAB\untitled.X\tlc\s0_b0_rj79_ModelInitialize.tlc:ModelInitialize(7)
[04] C:\Program Files\MATLAB\R2016a\rtw\c\tlc\mw\opaquelib.tlc:FcnGenRateGroupedCodeFromModule(4518)
[05] C:\Program Files\MATLAB\R2016a\rtw\c\tlc\mw\opaquelib.tlc:FcnGenerateCodeFromModule(4433)
[06] C:\Program Files\MATLAB\R2016a\rtw\c\tlc\mw\opaquelib.tlc:SLibFcnGenBodySysFcn(193)
[07] C:\Program Files\MATLAB\R2016a\rtw\c\tlc\mw\opaquelib.tlc:SLibFcnGenBodyFcnCache(406)
[08] C:\Program Files\MATLAB\R2016a\rtw\c\tlc\mw\opaquelib.tlc:SLibFcnGenBodySysFcnEntry(508)
[09] C:\Program Files\MATLAB\R2016a\rtw\c\tlc\mw\commonbodlib.tlc:FcnGenBodySysCache(1186)
[10] C:\Program Files\MATLAB\R2016a\rtw\c\tlc\mw\commonbodlib.tlc:SLibGenBodyCache(5145)
[11] C:\Program Files\MATLAB\R2016a\rtw\c\tlc\mw\formatwide.tlc:<NONE>(55) Error: File: C:\Program Files (x86)\Microchip\MatlabTools\blocks\MCHP_Master.tlc Line: 5 Column: 48 Bad cast - unable to cast this expression to "String"
Main program: ==> [00] C:\Program Files (x86)\Microchip\MatlabTools\blocks\MCHP_Master.tlc:Start(5) [01] C:\ProgramError: File: C:\Program Files (x86)\Microchip\MatlabTools\blocks\MCHP_Master.tlc Line: 7 Column: 49 Unable to find ChipIdL3 within the RTWGenSettings scope

 
Please Help me out to get this working as I really need to get some work done.
 
Regards,
Ali
#1
Lubin
Moderator
  • Total Posts : 360
  • Reward points : 5
  • Joined: 2007/03/31 07:38:15
  • Location: Bayonne, France
  • Status: offline
Re: Block Set Build Error with Matlab 2016a 2017/01/20 05:33:38 (permalink)
0
Hi Ali,
 
Further input would be required: 
Which Blockset version are you using ?
Which matlab tools do you have (Typing ver at matlab prompt would provide all required inputs)
 
Could you try compiling example provided ?
type 'picInfo' to copy examples in current folder, and follow instructions to compile them all. would take few minutes. You end up with a summary about success/fall.
If you also get errors, please provide the report.
 
Thanks,
Lubin
#2
AMeraj
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2017/01/18 12:58:10
  • Location: 0
  • Status: offline
Re: Block Set Build Error with Matlab 2016a 2017/01/25 11:11:16 (permalink)
0
Hi Lubin,
 
First of all sorry for the late reply as I was stuck with some stuff.
 
I am using Block-set version mentioned below:
Microchip Blockset 3.38 installed. See info and examples.
and following is my toolbox installed
 
MATLAB Version: 9.0.0.341360 (R2016a)
MATLAB License Number: 722433
Operating System: Microsoft Windows 10 Home Version 10.0 (Build 14393)
Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
----------------------------------------------------------------------------------------------------
MATLAB Version 9.0 (R2016a)
Simulink Version 8.7 (R2016a)
Aerospace Blockset Version 3.17 (R2016a)
Aerospace Toolbox Version 2.17 (R2016a)
Antenna Toolbox Version 2.0 (R2016a)
Audio System Toolbox Version 1.0 (R2016a)
Bioinformatics Toolbox Version 4.6 (R2016a)
Communications System Toolbox Version 6.2 (R2016a)
Computer Vision System Toolbox Version 7.1 (R2016a)
Control System Toolbox Version 10.0 (R2016a)
Curve Fitting Toolbox Version 3.5.3 (R2016a)
DSP System Toolbox Version 9.2 (R2016a)
Data Acquisition Toolbox Version 3.9 (R2016a)
Database Toolbox Version 6.1 (R2016a)
Datafeed Toolbox Version 5.3 (R2016a)
Econometrics Toolbox Version 3.4 (R2016a)
Embedded Coder Version 6.10 (R2016a)
Embedded Target for Microchip Version 3.38 (R20xx)
Filter Design HDL Coder Version 3.0 (R2016a)
Financial Instruments Toolbox Version 2.3 (R2016a)
Financial Toolbox Version 5.7 (R2016a)
Fixed-Point Designer Version 5.2 (R2016a)
Fuzzy Logic Toolbox Version 2.2.23 (R2016a)
Global Optimization Toolbox Version 3.4 (R2016a)
HDL Coder Version 3.8 (R2016a)
HDL Verifier Version 5.0 (R2016a)
Image Acquisition Toolbox Version 5.0 (R2016a)
Image Processing Toolbox Version 9.4 (R2016a)
Instrument Control Toolbox Version 3.9 (R2016a)
LTE System Toolbox Version 2.2 (R2016a)
MATLAB Coder Version 3.1 (R2016a)
MATLAB Compiler Version 6.2 (R2016a)
MATLAB Compiler SDK Version 6.2 (R2016a)
MATLAB Report Generator Version 5.0 (R2016a)
Mapping Toolbox Version 4.3 (R2016a)
Model Predictive Control Toolbox Version 5.2 (R2016a)
Model-Based Calibration Toolbox Version 5.1 (R2016a)
Neural Network Toolbox Version 9.0 (R2016a)
OPC Toolbox Version 4.0.1 (R2016a)
Optimization Toolbox Version 7.4 (R2016a)
Parallel Computing Toolbox Version 6.8 (R2016a)
Partial Differential Equation Toolbox Version 2.2 (R2016a)
Phased Array System Toolbox Version 3.2 (R2016a)
Polyspace Bug Finder Version 2.1 (R2016a)
Polyspace Code Prover Version 9.5 (R2016a)
RF Toolbox Version 3.0 (R2016a)
Robotics System Toolbox Version 1.2 (R2016a)
Robust Control Toolbox Version 6.1 (R2016a)
Signal Processing Toolbox Version 7.2 (R2016a)
SimBiology Version 5.4 (R2016a)
SimEvents Version 5.0 (R2016a)
SimRF Version 5.0 (R2016a)
Simscape Version 4.0 (R2016a)
Simscape Driveline Version 2.10 (R2016a)
Simscape Electronics Version 2.9 (R2016a)
Simscape Fluids Version 2.0 (R2016a)
Simscape Multibody Version 4.8 (R2016a)
Simscape Power Systems Version 6.5 (R2016a)
Simulink 3D Animation Version 7.5 (R2016a)
Simulink Code Inspector Version 2.5 (R2016a)
Simulink Coder Version 8.10 (R2016a)
Simulink Control Design Version 4.3 (R2016a)
Simulink Design Optimization Version 3.0 (R2016a)
Simulink Design Verifier Version 3.1 (R2016a)
Simulink Desktop Real-Time Version 5.2 (R2016a)
Simulink PLC Coder Version 2.1 (R2016a)
Simulink Real-Time Version 6.4 (R2016a)
Simulink Report Generator Version 5.0 (R2016a)
Simulink Test Version 2.0 (R2016a)
Simulink Verification and Validation Version 3.11 (R2016a)
Spreadsheet Link Version 3.2.5 (R2016a)
Stateflow Version 8.7 (R2016a)
Statistics and Machine Learning Toolbox Version 10.2 (R2016a)
Symbolic Math Toolbox Version 7.0 (R2016a)
System Identification Toolbox Version 9.4 (R2016a)
Trading Toolbox Version 3.0 (R2016a)
Vehicle Network Toolbox Version 3.1 (R2016a)
Vision HDL Toolbox Version 1.2 (R2016a)
WLAN System Toolbox Version 1.1 (R2016a)
Wavelet Toolbox Version 4.16 (R2016a)
>>
 
examples models compilation generated result:
Not Ok ==> AUAV_V3_33EP512MU810_I2C_BMP180.mdl
Not Ok ==> AUAV_V3_33EP512MU810_SPI_MPU6000__I2C_HMC5883_SensorsTest.mdl
Not Ok ==> Explorer16_33FJ256GP710_SimpleFilter.mdl
Not Ok ==> MCLV_Board_33Fj256MC710A_BLDC_wHall_async_2_10Khz.mdl
Not Ok ==> Microstick_II_33EP128MC202_CustomCFunCall.mdl
Not Ok ==> Microstick_II_33EP128MC202_Drotek_I2C_MPU6050_HMC5883L_AGM.mdl
Not Ok ==> Microstick_II_33EP128MC202_Drotek_I2C_MS5611_TempAndPressure.mdl
Not Ok ==> Microstick_II_33EP128MC202_bare.mdl
Not Ok ==> Microstick_II_33FJ128MC802_Drotek_I2C_MPU6050_HMC5883L_AGM.mdl
Not Ok ==> Microstick_II_33FJ128MC802_MCU_TaskProfiling.mdl
Not Ok ==> Microstick_II_33FJ128MC802_bare.mdl
Not Ok ==> Microstick_II_33FJ64MC802_bare.mdl
Not Ok ==> Microstick_II_PlusDevBoard_33EP128MC202_Temperature_PICGUI.mdl
Not Ok ==> UDB5_33FJ256GP710A_SPI_MPU6000_SensorsTest.mdl
 
 
Thank you for your help in advance
 
Thanks,
Ali Meraj
#3
Lubin
Moderator
  • Total Posts : 360
  • Reward points : 5
  • Joined: 2007/03/31 07:38:15
  • Location: Bayonne, France
  • Status: offline
Re: Block Set Build Error with Matlab 2016a 2017/01/25 15:54:57 (permalink)
0
Hi Ali,
 
Could you type this command which list usefull information about the blockset setup and share the output ?
>> picInfo('check')
 
Thanks,
Lubin
 
#4
AMeraj
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2017/01/18 12:58:10
  • Location: 0
  • Status: offline
Re: Block Set Build Error with Matlab 2016a 2017/01/28 11:50:47 (permalink)
0
 
Hi Lubin,
 
here is the output
--------------------------------------------
Microchip Blockset 3.38 Installed:
--------------------------------------------
Refreshing cache...
- Blockset in C:\Program Files (x86)\Microchip\MatlabTools
- Link to MPLAB X to program chip is Ok
1 Compiler(s) found for 16 bits chip:
- C:/Program Files (x86)/Microchip/xc16/v1.30
<--return
>>
 
I am working on 33EP512MU810 Chip.
Regards,
Ali
#5
Lubin
Moderator
  • Total Posts : 360
  • Reward points : 5
  • Joined: 2007/03/31 07:38:15
  • Location: Bayonne, France
  • Status: offline
Re: Block Set Build Error with Matlab 2016a 2017/02/02 07:18:34 (permalink)
0
 
Hi Ali,
 
Installation of the blockset and related tools (XC compiler + MPLAB X to program chip) seems all ok.
 
We need to check for a possible issue with Windows 10 compatibility with Simulink.
Is Simulink working as usual?
 
If you open a model for code generation (use an example) for a dsPIC, what happens when you open the "Master Block"? Do you see any error while opening dsPIC library block?
These blocks use kind of compiled dll whose name are "mex files". I am wondering if these might cause any issue with windows 10.
 
Thanks,
Lubin
#6
schwoaf
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2017/02/07 07:31:21
  • Location: 0
  • Status: offline
Re: Block Set Build Error with Matlab 2016a 2017/02/23 03:30:12 (permalink)
0
Hey there,
 
I got kind of a similar problem when trying to generate code from a simple model using only the "C Function Call" block beside the "Microchip Master" and "Compiler Options" blocks.
 
I'd highly appreciate your help with this.
 
Matlab ver:
----------------------------------------------------------------------------------------------------
MATLAB Version: 9.0.0.341360 (R2016a)
MATLAB License Number: 40522393
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 14393)
Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
----------------------------------------------------------------------------------------------------
MATLAB Version 9.0 (R2016a)
Simulink Version 8.7 (R2016a)
Control System Toolbox Version 10.0 (R2016a)
Data Acquisition Toolbox Version 3.9 (R2016a)
Database Toolbox Version 6.1 (R2016a)
Embedded Coder Version 6.10 (R2016a)
Embedded Target for Microchip Version 3.38 (R20xx)
Fixed-Point Designer Version 5.2 (R2016a)
MATLAB Coder Version 3.1 (R2016a)
MATLAB Report Generator Version 5.0 (R2016a)
Optimization Toolbox Version 7.4 (R2016a)
Polyspace Bug Finder Version 2.1 (R2016a)
Simulink Coder Version 8.10 (R2016a)
Simulink Control Design Version 4.3 (R2016a)
Simulink Design Optimization Version 3.0 (R2016a)
Simulink Design Verifier Version 3.1 (R2016a)
Simulink Report Generator Version 5.0 (R2016a)
Simulink Test Version 2.0 (R2016a)
Simulink Verification and Validation Version 3.11 (R2016a)
Stateflow Version 8.7 (R2016a)
Vehicle Network Toolbox Version 3.1 (R2016a)

 
picInfo('check')
--------------------------------------------
   Microchip Blockset 3.38 Installed:
--------------------------------------------

Refreshing cache...
   - Blockset in C:\Program Files (x86)\Microchip\MatlabTools

   - Link to MPLAB X to program chip is Ok

  2 Compiler(s) found for 16 bits chip:
   - C:/Program Files (x86)/Microchip/xc16/v1.30
   - C:/Program Files (x86)/Microchip/xc16/v1.31

 
code generation log (my model):
=== Build (Elapsed: 26 sec) ===
    Microchip Model Check before compilation
    TIMERS:
    1 timers used. Remaining timers: 4
      Timer 1
         - Resolution : 914.285714285715(ns)
         - Period : 9.99954285714287(ms)
         - Used for : Time Step (TS)
    - - - - - - - - - -
    
    [Pin] Port - Desc (With link to block)
    - - - - - - - - - -
    No pin list to report
    
    
     33EV256GM106, 0 pins used.
    - - - - - - - - - -
    ### Generating code into build folder: Z:\02_Kunden\Kreisel\02_Projekte\02_Mavero\03_Technische Unterlagen\06_Software\HV_Controller\SwSys_16a.X
    Warning: Supporting floating point numbers (!PurelyIntegerCode) is required in order to properly support non-inlined S-function (SupportNonInlinedSFcns).
    Warning: Supporting non-finite numbers (SupportNonFinite) is required in order to properly support non-inlined S-function (SupportNonInlinedSFcns).
    ### Invoking Target Language Compiler on SwSys_16a.rtw
    ### Using System Target File: C:\Program Files (x86)\Microchip\MatlabTools\blocks\MCHP_dsPIC_stf.tlc
    ### Loading TLC function libraries
    ### Initial pass through model to cache user defined code
    ### Caching model source code
    ### Writing main
    --- Single Tasking implementation ---
    Error: File: C:\Program Files\MATLAB\R2016a\rtw\c\tlc\mw\codetemplatelib.tlc Line: 615 Column: 20
    The == and != operators can only be used to compare values of the same type
    Main program:
    ==> [00] C:\Program Files\MATLAB\R2016a\rtw\c\tlc\mw\codetemplatelib.tlc:LibWriteModelOutput(615)
        [01] C:\Program Files\MATLAB\R2016a\rtw\c\tlc\mw\codetemplatelib.tlc:LibWriteModelOutputs(697)
        [02] C:\Program Files (x86)\Microchip\MatlabTools\blocks\MCHP_srmain.tlc:FcnSingleTaskingMain(133)
        [03] C:\Program Files (x86)\Microchip\MatlabTools\blocks\MCHP_Scheduler.tlc:MCHP_Scheduler_Main(27)
        [04] Z:\02_Kunden\Kreisel\02_Projekte\02_Mavero\03_Technische Unterlagen\06_Software\HV_Controller\SwSys_16a.X\tlc\MCHP_main.tlc:fcnMCHPwriteMain(69)
        [05] Z:\02_Kunden\Kreisel\02_Projekte\02_Mavero\03_Technische Unterlagen\06_Software\HV_Controller\SwSys_16a.X\tlc\MCHP_main.tlc:(80)
        [06] C:\Program Files\MATLAB\R2016a\rtw\c\tlc\mw\formatwide.tlc:(488)
    .
    ### Writing header file SwSys_16a.h
    ### Writing header file SwSys_16a_types.h
    ### Writing header file rtwtypes.h
    .
    ### Writing source file SwSys_16a.c
    ### Writing header file SwSys_16a_private.h
    ### Writing source file SwSys_16a_data.c
    ### Writing header file rtmodel.h
    ### Writing source file SwSys_16a_main.c
    .
    ### TLC code generation complete.
    ### Build procedure for model: 'SwSys_16a' aborted due to an error.
    Cannot propose to program chip from Matlab: Either file SwSys_16a.elf does not exist or MPLAB X API is not available on this system.
    * Visit the Microchip Blockset Forum for any questions, issues, share tricks.
    * Visit the Microchip Wiki for further informations and examples.
    
    -----------------------------------------------------------------------------------------
    * MPLAB X project: SwSys_16a.X then select the project folder
    -----------------------------------------------------------------------------------------
    
    
     ***** Error detected. Links above are provided for debug purpose only (.elf file might not be current).
    Error: Error: Errors occurred - aborting

 
 
picInfo('examples') Examples compilation:
Model using more than 8 I/Os pins require a license to compile.
Ok ==> AUAV_V3_33EP512MU810_I2C_BMP180.mdl
Ok ==> AUAV_V3_33EP512MU810_SPI_MPU6000__I2C_HMC5883_SensorsTest.mdl
Not Ok ==> Explorer16_33FJ256GP710_SimpleFilter.mdl
Ok ==> MCLV_Board_33Fj256MC710A_BLDC_wHall_async_2_10Khz.mdl
Ok ==> Microstick_II_33EP128MC202_CustomCFunCall.mdl
Ok ==> Microstick_II_33EP128MC202_Drotek_I2C_MPU6050_HMC5883L_AGM.mdl
Ok ==> Microstick_II_33EP128MC202_Drotek_I2C_MS5611_TempAndPressure.mdl
Ok ==> Microstick_II_33EP128MC202_bare.mdl
Ok ==> Microstick_II_33FJ128MC802_Drotek_I2C_MPU6050_HMC5883L_AGM.mdl
Ok ==> Microstick_II_33FJ128MC802_MCU_TaskProfiling.mdl
Ok ==> Microstick_II_33FJ128MC802_bare.mdl
Ok ==> Microstick_II_33FJ64MC802_bare.mdl
Ok ==> Microstick_II_PlusDevBoard_33EP128MC202_Temperature_PICGUI.mdl
Ok ==> UDB5_33FJ256GP710A_SPI_MPU6000_SensorsTest.mdl

 
Unfortunately the Microstick_II_33EP128MC202_CustomCFunCall.mdl seems to work just fine.
Still I got no idea why my model isn't working. I tried to:
- use or not use a DD
- change all the settings in Microchip Master and Compiler Options blocks (to fit the example model)
- make a new model from scratch
 
Maybe someone could give me a hint, why this error occurs. Then I might be able to find the issue.
 
additional Info (although I can't imagine that it has anything to do with that):
my custom C-Code only uses == Operators no !=. All == are used with a variable and a constant (eg. 0x02U or similar)
 
Thanks a lot in advance.
#7
Lubin
Moderator
  • Total Posts : 360
  • Reward points : 5
  • Joined: 2007/03/31 07:38:15
  • Location: Bayonne, France
  • Status: offline
Re: Block Set Build Error with Matlab 2016a 2017/02/23 04:49:37 (permalink) ☄ Helpfulby schwoaf 2017/02/23 05:26:01
0
Hi Joachim,
 
Thanks for detailed report. 
 
The error is not related to your code using == or !=. It's internal to the Simulink Coder, possibly caused by the blockset or internal to the Coder itself, to be checked...
 
You have two warning which might be fixed by selecting proposed option within Simulink Configuration dialog box:
 Warning: Supporting floating point numbers (!PurelyIntegerCode) is required in order to properly support non-inlined S-function (SupportNonInlinedSFcns).
    Warning: Supporting non-finite numbers (SupportNonFinite) is required in order to properly support non-inlined S-function (SupportNonInlinedSFcns).

 
It seems your model has no input and no output port defined (either as digital or analog port, or as a peripheral input.output). I am wondering if that might be the cause of this issue.
 
Please post your model or at least a screenshot if you need further inputs.
 
Thanks,
Lubin
#8
schwoaf
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2017/02/07 07:31:21
  • Location: 0
  • Status: offline
Re: Block Set Build Error with Matlab 2016a 2017/02/23 05:30:16 (permalink)
0
Hi Lubin,
 
Thanks a lot. Adding just a single digital output did the trick.
I hate it when such complicated issues have such a simple but unintelligible solution.
 
Thanks,
Joachim
#9
AMeraj
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2017/01/18 12:58:10
  • Location: 0
  • Status: offline
Re: Block Set Build Error with Matlab 2016a 2017/02/28 02:29:02 (permalink)
0
Hi Lubin,
 
Sorry for the late update as I was arranging a Matlab license for separate PC. I couldn't build the code on my machine so I got a separate machine and I installed a fresh copy of Matlab first then I installed the Blockset and compiler and now it all seems to be working fine.
I am still not sure why it is not working my machine its very strange and bizarre. I even uninstalled both matlab and blockset and installed it again but it didn't fix the issue.
 
I think for now the issue is fixed in one case as I can use a different PC now.
 
Thank you very much for your help much appreciated.
Regards,
Ali Meraj
#10
Jump to:
© 2019 APG vNext Commercial Version 4.5