• AVR Freaks

AnsweredCompilation issue using Matlab 2013a (64 bit version)

Author
Rahul Singhal
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2014/06/16 02:21:57
  • Location: 0
  • Status: offline
2014/06/16 02:55:41 (permalink)
0

Compilation issue using Matlab 2013a (64 bit version)

Hi,
I am using Matlab 2013a (64 bit version), Microchip Simulink Blockset v3.30.
I am facing compilation issue for the basic led blinking model.
 
Following is the output printed on matlab window :-
 
Microchip Model Check before compilation
TIMERS:
1 timers used. Remaining timers: 4
  Timer 1
     - Resolution : 271.3704206(ns)
     - Period : 1(ms)
     - Used for : Time Step (TS)
- - - - - - - - - -

[Pin]  Port - Desc (With link to block)
- - - - - - - - - -
  [3]  RA1  -  DOU


 33FJ128MC802, 1 pins used.
- - - - - - - - - -
### Starting build procedure for model: led_blinking
### Generating code into build folder: C:\Users\rahul\Documents\MATLAB\MicroshipWP\1.led\led_blinking.X\src
### Invoking Target Language Compiler on led_blinking.rtw
### Using System Target File: C:\Program Files (x86)\Microchip\MatlabTools\mchp\MCHP_dsPIC_stf.tlc
### Loading TLC function libraries
.....
Warning:  The data type "ufix1" uses a word size that is not available on the intended target.
    Fixed-point signals using this data type will be put inside a larger word or multi words.  When used,
extra software will be generated to force this larger word or multi words to emulate a smaller
word.  This emulation is helpful when your prototype target and your final
production target are not the same.  If the smaller word size does NOT exist
on the final production target, then consider increasing the word size to
one that is supported.

.
### Initial pass through model to cache user defined code
..
### Caching model source code
....................
### Writing main
--- Multi Tasking implementation ---
..
### Writing header file led_blinking.h
### Writing header file led_blinking_types.h
.
### Writing header file rtwtypes.h
### Writing source file led_blinking.c
.
### Writing header file led_blinking_private.h
### Writing header file rtmodel.h
.
### Writing source file led_blinking_main.c
### TLC code generation complete.
### Creating project marker file: rtw_proj.tmw
.
### Processing Template Makefile: C:\Program Files (x86)\Microchip\MatlabTools\mchp\MCHP_dsPIC.tmf
### Creating led_blinking.mk from C:\Program Files (x86)\Microchip\MatlabTools\mchp\MCHP_dsPIC.tmf
### Building led_blinking: .\led_blinking
 
C:\Users\rahul\Documents\MATLAB\MicroshipWP\1.led\led_blinking.X\src>"C:\Program Files\MATLAB\R2013a\bin\win64\gmake" -f led_blinking.mk  MULTI_INSTANCE_CODE=0 GENERATE_ASAP2=0 TMW_EXTMODE_TESTING=0 MCHP_AUTO_FLASH=0  
xc16-gcc.exe   -c -mcpu=33FJ128MC802  -omf=elf -g -O0 -fschedule-insns -fschedule-insns2   -I. -I..\.. -IC:\PROGRA~1\MATLAB\R2013a/simulink/include -IC:\PROGRA~1\MATLAB\R2013a/extern/include -IC:\PROGRA~1\MATLAB\R2013a/rtw/c/src -IC:\PROGRA~1\MATLAB\R2013a/rtw/c/ert -IC:\PROGRA~1\MATLAB\R2013a/rtw/c/src/ext_mode/common -IC:\Users\rahul\Documents\MATLAB\MicroshipWP\1.led\led_blinking.X\src -IC:\Users\rahul\Documents\MATLAB\MicroshipWP\1.led   -IC:\PROGRA~2\MICROC~1\xc16\v1.20\include -IC:\PROGRA~2\MICROC~1\xc16\v1.20\support\dsPIC33F\h -IC:\PROGRA~2\MICROC~1\xc16\v1.20\support\generic\h -IC:\PROGRA~2\MICROC~1\xc16\v1.20\support\PERIPH~2    led_blinking_main.c
xc16-gcc.exe   -c -mcpu=33FJ128MC802  -omf=elf -g -O0 -fschedule-insns -fschedule-insns2   -I. -I..\.. -IC:\PROGRA~1\MATLAB\R2013a/simulink/include -IC:\PROGRA~1\MATLAB\R2013a/extern/include -IC:\PROGRA~1\MATLAB\R2013a/rtw/c/src -IC:\PROGRA~1\MATLAB\R2013a/rtw/c/ert -IC:\PROGRA~1\MATLAB\R2013a/rtw/c/src/ext_mode/common -IC:\Users\rahul\Documents\MATLAB\MicroshipWP\1.led\led_blinking.X\src -IC:\Users\rahul\Documents\MATLAB\MicroshipWP\1.led   -IC:\PROGRA~2\MICROC~1\xc16\v1.20\include -IC:\PROGRA~2\MICROC~1\xc16\v1.20\support\dsPIC33F\h -IC:\PROGRA~2\MICROC~1\xc16\v1.20\support\generic\h -IC:\PROGRA~2\MICROC~1\xc16\v1.20\support\PERIPH~2    led_blinking.c
xc16-gcc.exe  -mcpu=33FJ128MC802 led_blinking_main.o led_blinking.o       C:\PROGRA~2\MICROC~1\xc16\v1.20\lib\dsPIC33F\libp33FJ128MC802-elf.a C:\PROGRA~2\MICROC~1\xc16\v1.20\lib\libpic30-elf.a C:\PROGRA~2\MICROC~1\xc16\v1.20\lib\libm-elf.a C:\PROGRA~2\MICROC~1\xc16\v1.20\lib\libc-elf.a C:\PROGRA~2\MICROC~1\xc16\v1.20\lib\libq-elf.a C:\PROGRA~2\MICROC~1\xc16\v1.20\lib\libq-dsp-elf.a -o ..\../led_blinking.elf -omf=elf -Xlinker --script="C:\PROGRA~2\MICROC~1\xc16\v1.20\support\dsPIC33F\gld\P3D789~1.GLD" -Xlinker -t -Xlinker --report-mem -Xlinker -Map=info.map -Xlinker --heap=0 -Xlinker -cref             
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.20libdsPIC33Flibp33FJ128MC802-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.20liblibpic30-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.20liblibm-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.20liblibc-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.20liblibq-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.20liblibq-dsp-elf.a: No such file or directory
gmake: *** [..\../led_blinking.elf] Error 255
### Build procedure for model: 'led_blinking' aborted due to an error.
 
Attached all the files generated along with model.
Screenshot of the model as below.
As it generate all the necessary .c and .h files, when i copied all files in the a folder and make a new project using mplabx - build was SUCCESSFUL.
Still not able to figure out error where matlab is stuck in generating a whole project in mplabx

 

Attached Image(s)

#1
urc
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2014/02/06 00:01:38
  • Location: 0
  • Status: offline
Re: Compilation issue using Matlab 2013a (64 bit version) 2014/06/24 19:53:33 (permalink)
0
Hello Rahul,
 
I tried compiling the model you attached with win7 64 bit with blockset version v3.30(with R2013a); Its compiling fine; Please refer the attached image;
I used xc16 compiler version - v1.21. Please cross check once from your end and share your findings.
 
Thanks,
urc

Attached Image(s)

#2
Rahul Singhal
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2014/06/16 02:21:57
  • Location: 0
  • Status: offline
Re: Compilation issue using Matlab 2013a (64 bit version) 2014/06/28 07:27:35 (permalink)
0
Dear Ullas,
Thanks for you help.
Although i installed xc16 compiler v1.21 and compiled the project, but still the same problem persist .
I am not able to figure out why elf-gcc.exe not able to find the file.
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.21libdsPIC33Flibp33FJ128MC802-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.21liblibpic30-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.21liblibm-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.21liblibc-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.21liblibq-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.21liblibq-dsp-elf.a: No such file or directory
gmake: *** [..\../led_blinking.elf] Error 255
 
Thanks,
Rahul
 
#3
Lubin
Moderator
  • Total Posts : 348
  • Reward points : 5
  • Joined: 2007/03/31 07:38:15
  • Location: Bayonne, France
  • Status: offline
Re: Compilation issue using Matlab 2013a (64 bit version) 2014/06/28 09:04:32 (permalink)
0
Hi Rahul,
 
Please try to re-install the compiler and check the checkbox that add it to the windows path. (This check box is unchecked by default with recent compiler versions.)
 
Let us know if you still have a problem then.
 
Thanks,
Lubin
#4
Rahul Singhal
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2014/06/16 02:21:57
  • Location: 0
  • Status: offline
Re: Compilation issue using Matlab 2013a (64 bit version) 2014/06/28 10:23:12 (permalink)
0
Dear Mr. Lubin,
Thank you for a very quick reply.
I am curently working with your old blockset v3.7 for R2012 64 bit , they are working absolutely fine.

I had reinstalled with the check for adding windows path, but the same problem persist.
It generate all the necessary *.c and *.h file, when i build project in MplabX it works absolutely fine, as also in command window
xc16-gcc.exe  is able to generate corresponding .c and .h file
problem lies with elf-gcc.exe as it is not able to find files . I had personally check the folder same coff and elf file lies in folder.
xc16-gcc.exe  -mcpu=33FJ128MC802 led_blinking_main.o led_blinking.o      
C:\PROGRA~2\MICROC~1\xc16\v1.21\lib\dsPIC33F\libp33FJ128MC802-elf.a
C:\PROGRA~2\MICROC~1\xc16\v1.21\lib\libpic30-elf.a
C:\PROGRA~2\MICROC~1\xc16\v1.21\lib\libm-elf.a
C:\PROGRA~2\MICROC~1\xc16\v1.21\lib\libc-elf.a
C:\PROGRA~2\MICROC~1\xc16\v1.21\lib\libq-elf.a
C:\PROGRA~2\MICROC~1\xc16\v1.21\lib\libq-dsp-elf.a -o ..\../led_blinking.elf -omf=elf -Xlinker --script="C:\PROGRA~2\MICROC~1\xc16\v1.21\support\dsPIC33F\gld\P3D789~1.GLD" -omf=elf -Xlinker -t -Xlinker --report-mem -Xlinker -Map=info.map -Xlinker --heap=0 -Xlinker -cref             
 
which shows the details of error in command line
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.21libdsPIC33Flibp33FJ128MC802-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.21liblibpic30-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.21liblibm-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.21liblibc-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.21liblibq-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.21liblibq-dsp-elf.a: No such file or directory
gmake: *** [..\../led_blinking.elf] Error 255

In v3.30 Blockset they are using elf binary format, well every thing work fine with lubin v3.7 Blockset they generate coff binary format.
When i try to build the project (with v3.30) compiler options to coff, it generate in elf as these features are disabled due to license .
 
Thanks,
Rahul
post edited by Rahul Singhal - 2014/06/28 12:13:23
#5
ric
Super Member
  • Total Posts : 22268
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: Compilation issue using Matlab 2013a (64 bit version) 2014/06/28 16:23:55 (permalink)
0
I know nothing about these tools, but it's plain all the backslashes are missing from the paths when you have a problem...
e.g.
C:\PROGRA~2\MICROC~1\xc16\v1.21\lib\libpic30-elf.a
becomes
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.21liblibpic30-elf.a: No such file or directory

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#6
Rahul Singhal
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2014/06/16 02:21:57
  • Location: 0
  • Status: offline
Re: Compilation issue using Matlab 2013a (64 bit version) 2014/06/29 01:32:05 (permalink)
0
Dear Ric,
Thanks for the reply,
I don't think '\' as issue as they are missing in displaying the error but as stated not is compilation
xc16-gcc.exe  -mcpu=33FJ128MC802 led_blinking_main.o led_blinking.o      
C:\PROGRA~2\MICROC~1\xc16\v1.21\lib\dsPIC33F\libp33FJ128MC802-elf.a
C:\PROGRA~2\MICROC~1\xc16\v1.21\lib\libpic30-elf.a
C:\PROGRA~2\MICROC~1\xc16\v1.21\lib\libm-elf.a
C:\PROGRA~2\MICROC~1\xc16\v1.21\lib\libc-elf.a
C:\PROGRA~2\MICROC~1\xc16\v1.21\lib\libq-elf.a
C:\PROGRA~2\MICROC~1\xc16\v1.21\lib\libq-dsp-elf.a -o ..\../led_blinking.elf -omf=elf -Xlinker --script="C:\PROGRA~2\MICROC~1\xc16\v1.21\support\dsPIC33F\gld\P3D789~1.GLD" -omf=elf -Xlinker -t -Xlinker --report-mem -Xlinker -Map=info.map -Xlinker --heap=0 -Xlinker -cref 
 
Also below line compilers fine  above the error line stated, which shows no issues with "\"
 
xc16-gcc.exe   -c -mcpu=33FJ128MC802  -omf=elf -g -O0 -fschedule-insns -fschedule-insns2   -I. -I..\.. -IC:\PROGRA~1\MATLAB\R2013a/simulink/include -IC:\PROGRA~1\MATLAB\R2013a/extern/include -IC:\PROGRA~1\MATLAB\R2013a/rtw/c/src -IC:\PROGRA~1\MATLAB\R2013a/rtw/c/ert -IC:\PROGRA~1\MATLAB\R2013a/rtw/c/src/ext_mode/common -IC:\Users\rahul\Documents\MATLAB\MicroshipWP\1.led\led_blinking.X\src -IC:\Users\rahul\Documents\MATLAB\MicroshipWP\1.led   -IC:\PROGRA~2\MICROC~1\xc16\v1.21\include -IC:\PROGRA~2\MICROC~1\xc16\v1.21\support\dsPIC33F\h -IC:\PROGRA~2\MICROC~1\xc16\v1.21\support\generic\h -IC:\PROGRA~2\MICROC~1\xc16\v1.21\support\PERIPH~2    led_blinking_main.c

xc16-gcc.exe   -c -mcpu=33FJ128MC802  -omf=elf -g -O0 -fschedule-insns -fschedule-insns2   -I. -I..\.. -IC:\PROGRA~1\MATLAB\R2013a/simulink/include -IC:\PROGRA~1\MATLAB\R2013a/extern/include -IC:\PROGRA~1\MATLAB\R2013a/rtw/c/src -IC:\PROGRA~1\MATLAB\R2013a/rtw/c/ert -IC:\PROGRA~1\MATLAB\R2013a/rtw/c/src/ext_mode/common -IC:\Users\rahul\Documents\MATLAB\MicroshipWP\1.led\led_blinking.X\src -IC:\Users\rahul\Documents\MATLAB\MicroshipWP\1.led   -IC:\PROGRA~2\MICROC~1\xc16\v1.21\include -IC:\PROGRA~2\MICROC~1\xc16\v1.21\support\dsPIC33F\h -IC:\PROGRA~2\MICROC~1\xc16\v1.21\support\generic\h -IC:\PROGRA~2\MICROC~1\xc16\v1.21\support\PERIPH~2    led_blinking.c

 
Thanks,
Rahul          
 



#7
Lubin
Moderator
  • Total Posts : 348
  • Reward points : 5
  • Joined: 2007/03/31 07:38:15
  • Location: Bayonne, France
  • Status: offline
Re: Compilation issue using Matlab 2013a (64 bit version) 2014/06/29 05:40:14 (permalink)
0
Hi Rahul,
 
I still tend to think this is a problem related to the windows path. When too long, it could create problems. Do you have a possibility to clean it up ?
From Matlab, you could to go to the generated "src" sub folder and start the compiler command starting with the "!" character. It might help to understand what is going on.:
>>!xc16-gcc.exe   -c -mcpu=33FJ128MC802  -omf=elf -g -O0 -fschedule-insns -fschedule-insns2   -I. -I..\.. -IC:\PROGRA~1\MATLAB\......
 
 
FYI, Our next blockset version (v3.35) will use complete path rather than rely on the windows path. It might fix such problems.
 
Lubin
#8
urc
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2014/02/06 00:01:38
  • Location: 0
  • Status: offline
Re: Compilation issue using Matlab 2013a (64 bit version) 2014/06/30 02:31:56 (permalink)
0
Hi Rahul,
 
Can you compile your model just by placing in "C" drive. I suspect the path what it is compiling is too long path "C:\Users\rahul\Documents\MATLAB\MicroshipWP\1.led\led_blinking.X". Try once..
 
Thanks,
urc
#9
Rahul Singhal
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2014/06/16 02:21:57
  • Location: 0
  • Status: offline
Re: Compilation issue using Matlab 2013a (64 bit version) 2014/07/04 00:20:09 (permalink)
0
Dear Mr. Lubin and Mr Ullas,
Thank you once again.
As recommended , i copied and generate code in C Drive, But still the problem is same.
 
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.21libdsPIC33Flibp33FJ128MC802-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.21liblibpic30-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.21liblibm-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.21liblibc-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.21liblibq-elf.a: No such file or directory
elf-gcc.exe: C:PROGRA~2MICROC~1xc16v1.21liblibq-dsp-elf.a: No such file or directory
gmake: *** [..\../led_blinking.elf] Error 255
### Build procedure for model: 'led_blinking' aborted due to an error.
 
File MatlabCommand.txt contains the total output generated on Matlab command Prompt.
 
I also try to use compiler command starting with the "!" character.It gives the following output.
!xc16-gcc.exe   -c -mcpu=33FJ128MC802  -omf=elf -O3 -g -fschedule-insns -fschedule-insns2   -I. -I..\.. -IC:\PROGRA~1\MATLAB\R2013a/simulink/include ....

elf-gcc.exe: led_blinking_main.c: No such file or directory
elf-gcc.exe: no input files

 
When will be next blockset version (v3.35) launching ?
 
Thanks,
Rahul
 
 
 
#10
Lubin
Moderator
  • Total Posts : 348
  • Reward points : 5
  • Joined: 2007/03/31 07:38:15
  • Location: Bayonne, France
  • Status: offline
Re: Compilation issue using Matlab 2013a (64 bit version) 2014/07/04 04:54:46 (permalink) ☼ Best Answerby Rahul Singhal 2014/11/20 05:10:50
0
Hi Rahul,
 
I would advise to edit the windows path, clean up all reference to old xc16 or c30 compiler and then, either add the path for your intalled xd16 v1.21, or reinstalling xc16 v1.21 checking the "add to windows path" check box option (unchecked by default) 
 
Please provide me your mail contact through PM. We might give a try to a beta of v3.35.
#11
Jump to:
© 2019 APG vNext Commercial Version 4.5