Helpful ReplyHot!Harmony + DSP Libraries + PIC32MZ2048EC

Page: 12 > Showing page 1 of 2
Author
VictorCL
New Member
  • Total Posts : 8
  • Reward points : 0
  • Joined: 2014/03/20 03:41:28
  • Location: 0
  • Status: offline
2017/09/20 05:43:45 (permalink)
0

Harmony + DSP Libraries + PIC32MZ2048EC

Hi, 
I am having issues compiling the code using the standard FFT functions of the DSP library using harmony. Apparently, there is a problem with the function: DSP_TransformFFT16_setup(fftc, LOG2N); Please find below the build output:
 
It seems that the problem is in the header file fdlmath.h, which can not find _cosx or _sinx functions. However, I do not know how to fix this as seems to be part of the library dsp_pic32mz.a. 
 
Any help will be much appreciated!
Thanks in advance.
 
Configuration details: 
   - Harmony v2.04
   - MPLAB X v4.01
   - XC32 v1.44
   - Legacy Peripheral Libraries from XC32 v1.40
#1
VictorCL
New Member
  • Total Posts : 8
  • Reward points : 0
  • Joined: 2014/03/20 03:41:28
  • Location: 0
  • Status: offline
Re: Harmony + DSP Libraries + PIC32MZ2048EC 2017/09/20 06:16:23 (permalink)
0
Here the build output:
 
\dsp_pic32mz.a(dsp_transform_fft16_setup.o): In function cos:
v1.40/pic32mx/include/fdlmath.h:289: undefined reference to _cosx
\dsp_pic32mz.a(dsp_transform_fft16_setup.o): In function sin:
v1.40/pic32mx/include/fdlmath.h:343: undefined reference to _sinx
error: ld returned 255 exit status
#2
MikeinAZ
Administrator
  • Total Posts : 295
  • Reward points : 0
  • Joined: 2014/06/03 07:25:32
  • Location: Chandler, AZ
  • Status: offline
Re: Harmony + DSP Libraries + PIC32MZ2048EC 2017/09/20 13:29:14 (permalink)
0
Hello,
 
I don't know the answer straight away, but I see you have loaded the legacy PLIBs.  These are not needed certainly, since you are using Harmony PLIBs.  I have not seen these tested recently to see if dual installations interfere with each other.  
 
The legacy PLIBs are used for MLA projects, and are exclusive to PIC32MX.
 
I believe you are using PIC32MZ EC, so this should not have much of an impact.
 
It seems you are using the correct API, did you also load the library from MHC?
#3
VictorCL
New Member
  • Total Posts : 8
  • Reward points : 0
  • Joined: 2014/03/20 03:41:28
  • Location: 0
  • Status: offline
Re: Harmony + DSP Libraries + PIC32MZ2048EC 2017/09/21 00:24:36 (permalink)
0
Hi MikeinAZ,
Thank you for your response. Yes, I loaded the libraries using MHC (DSP and LibQ Fixed-Point Libraries). I have the legacy libraries because I usually work with PIC32MX. However, I uninstalled them by uninstalling the XC32 v1.40 and deleting the folder, I guess this should do it as the legacy libraries are not installed with higher versions. For some reason the compiler still tries to find some files on the v1.40...I use the XC32 v1.44, so I don't understand why it tries to use those...
 
c:\program files (x86)\microchip\xc32\v1.42\bin\bin\...
..\dsp\dsp_pic32mz.a(dsp_transform_fft16_setup.o): In function `cos':
c:/program files (x86)/microchip/xc32/v1.40/pic32mx/include/fdlmath.h:289: undefined reference to `_cosx'
..\dsp\dsp_pic32mz.a(dsp_transform_fft16_setup.o): In function `sin':
c:/program files (x86)/microchip/xc32/v1.40/pic32mx/include/fdlmath.h:343: undefined reference to `_sinx'
 
Any ideas?
Thanks again!
#4
Michael.W.Mann
Super Member
  • Total Posts : 277
  • Reward points : 0
  • Joined: 2011/01/24 09:58:24
  • Location: Chandler, Arizona
  • Status: offline
Re: Harmony + DSP Libraries + PIC32MZ2048EC 2017/09/21 09:39:09 (permalink)
3 (1)
You say that your configuration is:
Configuration details: 
   - Harmony v2.04
   - MPLAB X v4.01
   - XC32 v1.44
   - Legacy Peripheral Libraries from XC32 v1.40
 
But the error messages listed above reference files from the 1.42 and 1.40 versions of the compiler.  This should not be happening.  If the compiler is V1.44 then only files within the directory should be referenced.   I can't really know what is wrong with your project, but I would start by looking at the Include Directories listed under the project's configurations, xc32-gcc tab, Preprocessing and Messages.

Michael W. Mann
Principal Applications Engineer
MCU32 Applications, Microchip
#5
NKurzman
A Guy on the Net
  • Total Posts : 15722
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: offline
Re: Harmony + DSP Libraries + PIC32MZ2048EC 2017/09/21 10:04:28 (permalink)
0
Are you using MHC V2.04.XX also?
#6
VictorCL
New Member
  • Total Posts : 8
  • Reward points : 0
  • Joined: 2014/03/20 03:41:28
  • Location: 0
  • Status: offline
Re: Harmony + DSP Libraries + PIC32MZ2048EC 2017/09/21 10:16:07 (permalink)
0
Thanks guys for the responses.
 
The configuration I put on the first post is the one I have been using. However, I did try a different compiler version and pasted the wrong build output. Please find the one using XC32 v1.44 below (same outcome):
 
xc32\v1.44\bin\...
dsp\dsp_pic32mz(dsp_transform_fft16_setup.o): In function `cos':
xc32/v1.40/pic32mx/include/fdlmath.h:289: undefined reference to `_cosx'
dsp\dsp_pic32mz(dsp_transform_fft16_setup.o): In function `sin':
xc32/v1.40/pic32mx/include/fdlmath.h:343: undefined reference to `_sinx'
 
Thanks again.
BR
 
PS: The build output it has been cut down due to posting issues (very annoying BTW)
#7
VictorCL
New Member
  • Total Posts : 8
  • Reward points : 0
  • Joined: 2014/03/20 03:41:28
  • Location: 0
  • Status: offline
Re: Harmony + DSP Libraries + PIC32MZ2048EC 2017/09/21 10:18:07 (permalink)
0
The configuration used:
    - Harmony v2.04
    - MHC v2.04
    - MPLAB X v4.01
    - XC32 v1.44
    - Legacy Peripheral Libraries from XC32 v1.40
 
Thanks
 
#8
Michael.W.Mann
Super Member
  • Total Posts : 277
  • Reward points : 0
  • Joined: 2011/01/24 09:58:24
  • Location: Chandler, Arizona
  • Status: offline
Re: Harmony + DSP Libraries + PIC32MZ2048EC 2017/09/21 10:21:27 (permalink)
0
So why would dsp_transform_fft16_setup in V1.44 reference an include header file (fdlmath.h) in V1.40?  It doesn't make sense.  There is a version of fdlmath.h in V1.44.  Why aren't you using it?
 

Michael W. Mann
Principal Applications Engineer
MCU32 Applications, Microchip
#9
VictorCL
New Member
  • Total Posts : 8
  • Reward points : 0
  • Joined: 2014/03/20 03:41:28
  • Location: 0
  • Status: offline
Re: Harmony + DSP Libraries + PIC32MZ2048EC 2017/09/21 10:28:19 (permalink)
0
Well, in one of my posts I mentioned I don't understand why that is happening, so asking for help. This is all code generated from the MHC...and assumed it should work straight away. 
I had a look at the libraries and all are pointing at PIC32MZ libraries, but that ones generating the error at compiling time are pointing at PIC32MX (which I believe are using the legacy peripheral libraries?).
 
Thanks in advance for your help. 
BR
#10
Michael.W.Mann
Super Member
  • Total Posts : 277
  • Reward points : 0
  • Joined: 2011/01/24 09:58:24
  • Location: Chandler, Arizona
  • Status: offline
Re: Harmony + DSP Libraries + PIC32MZ2048EC 2017/09/21 10:30:24 (permalink)
0
Did you check the project's list of include directories as I suggested earlier?

Michael W. Mann
Principal Applications Engineer
MCU32 Applications, Microchip
#11
VictorCL
New Member
  • Total Posts : 8
  • Reward points : 0
  • Joined: 2014/03/20 03:41:28
  • Location: 0
  • Status: offline
Re: Harmony + DSP Libraries + PIC32MZ2048EC 2017/09/21 13:14:06 (permalink)
0
Hi Michael, 
 
Sorry I couldn't reply earlier (European time). I did check the include directories suggested. I couldn't find any include directory related with PIC32MX (and, therefore, fdlmath.h) for either v1.40 or v1.44. So I added manually the following include directory: ..\xc32\v1.44\pic32mx\include. That seems to get rid of the error when compiling (thank you guys for suggesting it). However, still not sure why that happen and I would like to understand better...please, could you help me understand?
 
  1) Why does it automatically look at "..\xc32\v1.40\pic32mx\include" when the compiler used is XC32 v1.44?
  2) Why is even looking at PIC32MX rather than PIC32MZ include files?
  3) Is that how it is suppose to work when creating a project through MHC?
 
Thanks a lot for your patience and your answers. 
BR
#12
CinziaG
morite
  • Total Posts : 3142
  • Reward points : 0
  • Joined: 2016/12/07 14:20:36
  • Location: Wien
  • Status: offline
Re: Harmony + DSP Libraries + PIC32MZ2048EC 2017/09/21 13:22:27 (permalink)
0
VictorCL
 
  1) Why does it automatically look at "..\xc32\v1.40\pic32mx\include" when the compiler used is XC32 v1.44?
  2) Why is even looking at PIC32MX rather than PIC32MZ include files?
 



These could be (could) because 1.40 was the latest version shipping with Peripheral Libraries - I still have it installed still, too.

get my books!
lulu.com search.ep?keyWords=greggio&type=
 
#13
Michael.W.Mann
Super Member
  • Total Posts : 277
  • Reward points : 0
  • Joined: 2011/01/24 09:58:24
  • Location: Chandler, Arizona
  • Status: offline
Re: Harmony + DSP Libraries + PIC32MZ2048EC 2017/09/21 13:45:51 (permalink)
0
The file <Project>.X/nbproject/configuartions.xml show what files are actually in the project.  You can look in there and search for stuff that is outside of the V1.44 directory tree.

Michael W. Mann
Principal Applications Engineer
MCU32 Applications, Microchip
#14
VictorCL
New Member
  • Total Posts : 8
  • Reward points : 0
  • Joined: 2014/03/20 03:41:28
  • Location: 0
  • Status: offline
Re: Harmony + DSP Libraries + PIC32MZ2048EC 2017/09/28 06:50:57 (permalink)
0
Thanks guys for the help. 
I looked in the configurations.xml file and found nothing on v.1.40. So I don't know why it automatically looks at that compiler version, even though I compile with the v1.44. 
Anyway, I got it working now. 
Thanks. 
BR
#15
charbelkeyrouz
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2016/06/13 08:43:28
  • Location: 0
  • Status: offline
Re: Harmony + DSP Libraries + PIC32MZ2048EC 2018/03/13 07:34:24 (permalink)
0
 
Hello All,
I am having the same issue and that couldn't be solved by adding manually the following include directory: ..\xc32\v1.44\pic32mx\include.
 
can anyone help me with this issue? the controller I m using for the FFT calculation is pic32MZ2064DAB288
 
"C:\Program Files (x86)\Microchip\xc32\v1.44\bin\xc32-gcc.exe" -mprocessor=32MZ2064DAB288 -o 
c:\program files (x86)\microchip\xc32\v1.44\bin\bin\gcc\pic32mx\4.8.3\..\..\..\..\bin/xc32-ld.exe: Warning: ..\..\..\..\..\..\..\bin\framework\math\dsp\dsp_pic32mz.a(dsp_transform_fft16_setup.o) uses FPU hard float, dist/pic32mz_da_sk_intddr/production/adchs_3ch_dma.X.production.elf uses soft float
..\..\..\..\..\..\..\bin\framework\math\dsp\dsp_pic32mz.a(dsp_transform_fft16_setup.o): In function `cos':
c:/program files (x86)/microchip/xc32/v1.40/pic32mx/include/fdlmath.h:289: undefined reference to `_cosx'
..\..\..\..\..\..\..\bin\framework\math\dsp\dsp_pic32mz.a(dsp_transform_fft16_setup.o): In function `sin':
c:/program files (x86)/microchip/xc32/v1.40/pic32mx/include/fdlmath.h:343: undefined reference to `_sinx'
#16
MikeinAZ
Administrator
  • Total Posts : 295
  • Reward points : 0
  • Joined: 2014/06/03 07:25:32
  • Location: Chandler, AZ
  • Status: offline
Re: Harmony + DSP Libraries + PIC32MZ2048EC 2018/03/13 08:47:27 (permalink)
0
[removed answer as this was not correct]
 
PIC32MZ DA does have DSP ASE extensions for fixed point DSP library.
post edited by MikeinAZ - 2018/03/13 13:40:08
#17
charbelkeyrouz
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2016/06/13 08:43:28
  • Location: 0
  • Status: offline
Re: Harmony + DSP Libraries + PIC32MZ2048EC 2018/03/13 09:13:27 (permalink)
0
Dear MikeinAZ,
 
 
I have compared both documentation and I found no difference in their DSP ASE Extension, can you please give me more information about that library ?
 
#18
MikeinAZ
Administrator
  • Total Posts : 295
  • Reward points : 0
  • Joined: 2014/06/03 07:25:32
  • Location: Chandler, AZ
  • Status: offline
Re: Harmony + DSP Libraries + PIC32MZ2048EC 2018/03/13 13:37:59 (permalink)
0
Hello,
 
I did some careful review, and I stand corrected.  Sorry about the confusion.  This *does* include the DSP ASE functions.  We have never used it as such (in our applications for DA), but there it is.  Good on you for double checking.
 
For your issue, I see it is an interaction with math libraries.  It is somewhat odd looking, I understand.  Let me try to walk you through this.
 
You are dealing with 2 kinds of issues here.  First, you have the hard float (hardware floating point) unit turned on.  Generally speaking, combining floating point math with fixed point math is not a good idea.  This is what the first warning is about.  You might be able to ignore this, but we have been challenged on occasion by it so we have turned it off when doing fixed point DSP.  The DSP ASE extensions are for fixed point.
 
Second, the setup function that you are using (through the API) is written in C.  It has simple calls back to the DSP.h file, which is expected.  It also used SIN and COS functions from the standard math library.  This is where things may get tricky from the floating point implementation above.
 
The dsp_transform_fft16_setup function does NOT use DSP extensions (or assembly at all).  So it runs in the standard PIC32 instruction set.  The math library for that instruction set is referred by the compiler to the directory <compiler dir>/xc32/v1.40/pix32mx/include.  The compiler does the reference to the fdlmath.h file automatically.  I do not know for sure, but the compiler may have a different library path if the hardware floating point unit is enabled.
 
By the way, this file also seems to be included properly in the latest version of XC32 compiler (v1.44), but it is the compiler that is checking and directing to this older version.  I am sure that will be corrected in future compiler versions.
 
So a few things you can check / do:
 
1) Verify that you have the file in question at all.  The fdlmath.h seems to have a very specific directory, and if you have not installed that before it could be the problem.  Installation of the the XC32 component extension may be one source for this.  I can walk you through more options if this is missing.
 
2) Turn off the floating point hardware (FPU) using the compiler options in MPLAB X.
 
Thanks for your patience.  Let me know what you find.
#19
charbelkeyrouz
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2016/06/13 08:43:28
  • Location: 0
  • Status: offline
Re: Harmony + DSP Libraries + PIC32MZ2048EC 2018/03/14 02:50:17 (permalink)
0
Dear  MakeinAZ ,
 
in what concern the 1st point  :  the fdlmath.h  was found in both libraries <compiler dir>/xc32/v1.40/pix32mx/include and  <compiler dir>/xc32/v1.44/pix32mx/include
 
and for the 2nd point : the only thing I see there is under the general tab, "exclude floating point libraries"  which doesn't sound at all like turning off the FPU.  And checking it doesn't stop the warning.
 
 
#20
Page: 12 > Showing page 1 of 2
Jump to:
© 2018 APG vNext Commercial Version 4.5