Fw: Problems when doing building the project,please help.

649 views
Skip to first unread message

John McClelland

unread,
Dec 19, 2010, 4:59:32 PM12/19/10
to uavde...@googlegroups.com
I am forwarding this to the UAV dev board....there are a lot of experts that
might be able to help.


----- Original Message -----
Hi All,

When I try to build the heli project I received the following message
at the very end:

c:\program files\microchip\mplab c30\bin\bin\..\bin/pic30-coff-ld.exe
Error: A heap is required, but has not been specified
c:/program files/microchip/mplab c30/bin/bin/../../lib\libc-
coff.a(vsnprintf.o)(.libc.vsnprintf+0x1e):fake: undefined reference to
`assert'
c:/program files/microchip/mplab c30/bin/bin/../../lib\libc-
coff.a(vsnprintf.o)(.libc.vsnprintf+0x22):fake: undefined reference to
`alloc'
BUILD FAILED: Mon Dec 20 05:49:10 2010

Does anyone know how to fix these problems?
I am using the C30 compiler v3.25 and MPLAB v7.5.
Thanks.

Steven


From: <stev...@live.cn>
To: "UAVHeliBoard" <UAVHel...@googlegroups.com>
Sent: Sunday, December 19, 2010 2:48 PM
Subject: Re: Problems when doing building the project,please help.


> Hi John,
>
> I am still getting the same errors. Is there any other way to solve
> these problems? Thank you.
>
> Regards,
> Steven

Tom Pittenger

unread,
Dec 19, 2010, 5:08:54 PM12/19/10
to uavde...@googlegroups.com

That's a pretty old version of mplab. I would suggest upgrading that. It includes a default heap. Otherwise you have to set it manually in project settings.

On Dec 19, 2010 2:01 PM, "John McClelland" <mcclell...@gmail.com> wrote:

John McClelland

unread,
Dec 19, 2010, 5:08:57 PM12/19/10
to uavde...@googlegroups.com
I was able to compile with 7.5 without any manual setting of the heap early on.  That was a couple versions back from what I use now.  It is possible something was added that generated an incompatibility.
 
Worth trying.
 
John

stev...@live.cn

unread,
Dec 19, 2010, 5:15:32 PM12/19/10
to uavdevboard

Hi Tom,

I have manually set the value of the heap in the build option. This
solve the first error. but the latter two still exists...
I am still searching a way of solving these two "undefined" errors...
have something to do with the assest and alloc... someone on the
microchip form said these might be a bug in the latest v3.25 C30
compiler. but I dont think so, maybe some of you have successfully
compile using this version of compiler, is it ture?
Thanks.

Steven

stev...@live.cn

unread,
Dec 19, 2010, 5:29:53 PM12/19/10
to uavdevboard
Hi John,

I did upgrade to the newest version of MPLAB but it seems not working
properly with ICD2 then I downgrade to the old version... I am still
using the ICD2 now.

Steven

On 12月20日, 上午9时08分, "John McClelland" <mcclelland.j...@gmail.com>
wrote:
> On Dec 19, 2010 2:01 PM, "John McClelland" <mcclelland.j...@gmail.com> wrote:

John McClelland

unread,
Dec 19, 2010, 5:29:07 PM12/19/10
to uavde...@googlegroups.com
Steven

I was able to compile with 7.5 early on, but have upgraded quite a while ago
and I made ite a few changes in the heli code since then.
Tom's suggestion to upgrade is a good one.

----- Original Message -----
From: <stev...@live.cn>
To: "uavdevboard" <uavde...@googlegroups.com>
Sent: Sunday, December 19, 2010 3:15 PM
Subject: Re: Fw: Problems when doing building the project,please help.

John McClelland

unread,
Dec 19, 2010, 5:45:00 PM12/19/10
to uavde...@googlegroups.com
I am using MPLAB v8.10 and it compiles fine (as have others). Is the ICD2
the one from Sparkfun? I had a board that worked with 7.5 but not 8.x.
They made some mods and sent me a new one that now works fine.

It looks like your errors are both associated with vsnprintf used to output
to the serial port. This is called in serialIO.c. You might check your
options.h file and set

#define SERIAL_OUTPUT_FORMAT SERIAL_NONE

Then comment out the vsnprintf block.

This is not a fix, but might shed light on the problem.

stev...@live.cn

unread,
Dec 19, 2010, 6:11:06 PM12/19/10
to uavdevboard
Hi John,

I just upgrade to MPLAB v8.6 but unfortunately, the same trouble still
exist...


Output Messages:
-------------------
Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-gcc.exe" -
mcpu=30F4011 "altitudeCntrl.o" "analog2digital.o" "background.o"
"cameraCntrl.o" "estYawDrift.o" "getCollective.o" "gpsParseCommon.o"
"gpsParseSTD.o" "gpsParseUBX.o" "main.o" "mathlibNAV.o" "navigate.o"
"pitchCntrl.o" "radioIn.o" "rmat.o" "rollCntrl.o" "serialIO.o"
"servoMix.o" "servoOut.o" "states.o" "variables.o" "waypoints.o"
"yawCntrl.o" "C:\Program Files\Microchip\MPLAB C30\lib\dsPIC30F
\libp30F4011-coff.a" "C:\Program Files\Microchip\MPLAB C30\lib\libdsp-
coff.a" "C:\Program Files\Microchip\MPLAB C30\lib\libpic30-coff.a" -
o"UAVHeliCode.cof" -Wl,--script="..\..\h file\p30f4011.gld",--
defsym=__MPLAB_BUILD=1,-Map="UAVHeliCode.map"


c:\program files\microchip\mplab c30\bin\bin\..\bin/pic30-coff-ld.exe
Error: A heap is required, but has not been specified
c:/program files/microchip/mplab c30/bin/bin/../../lib\libc-
coff.a(vsnprintf.o)(.libc.vsnprintf+0x1e):fake: undefined reference to
`assert'
c:/program files/microchip/mplab c30/bin/bin/../../lib\libc-
coff.a(vsnprintf.o)(.libc.vsnprintf+0x22):fake: undefined reference to
`alloc'
Link step failed.
----------------------------------------------------------------------
Release build of project `C:\Users\Steven Xie\Desktop\Code\UAVHeliBoard
\UAVHeliCode\UAVHeliCode.mcp' failed.
Language tool versions: pic30-as.exe v3.25, pic30-gcc.exe v3.25, pic30-
ld.exe v3.25, pic30-ar.exe v3.25
Mon Dec 20 10:06:15 2010
----------------------------------------------------------------------
BUILD FAILED

-----



Regards,
Steven










On 12月20日, 上午9时29分, "John McClelland" <mcclelland.j...@gmail.com>
wrote:

John McClelland

unread,
Dec 19, 2010, 6:14:55 PM12/19/10
to uavde...@googlegroups.com
Is it possible to send a screen shot of your mcw window?

So I take it that your ICD2 now works with v8.x?

John

John McClelland

unread,
Dec 19, 2010, 7:02:25 PM12/19/10
to uavde...@googlegroups.com
I think once the compiler gurus log in and look at this they will figure it
out.

I did notice that in later versions of MatrixPilot (v2.5 for instance) where
they use libDCM they add the definition:

#define _ADDED_C_LIB 1 // Needed to get vsnprintf()

to telemetry source (equivalent to our serialIO).

MP-H does not utilize libDCM (yet), and it has compiled fine. I wonder if
you have been using a recent version of Matrix Pilot and somehow the
references got confused?

Is MP-H the only code you have been using?

Shot in the dark,
John

stev...@live.cn

unread,
Dec 20, 2010, 9:04:58 PM12/20/10
to uavdevboard
Hi John,

I comment out the vsnprintf as following:

// add this text to the output buffer
void serial_output( char* format, ... )
{
..........
..........
..........
if (remaining > 1)
{
// int wrote = vsnprintf( (char*)(&serial_buffer[start_index]),
(size_t)remaining, format, arglist) ;
// end_index = start_index + wrote;
}
...............
...............

return ;
}

And it built successfully without any warnning ...
I could not get the ICD2 works with v8.6, the MPLAB v8.6 could not
recognize the target ID of the board.
so I just have to switch back to v7.5.
Maybe the compiler does not work well with the vsnprintf funtion. Btw,
are you using v3.25?
Thank you.

Regards,
Steven



On 12月20日, 上午11时02分, "John McClelland" <mcclelland.j...@gmail.com>
wrote:

John McClelland

unread,
Dec 20, 2010, 9:22:50 PM12/20/10
to uavde...@googlegroups.com
Hi Steven

As I said, disabling serial output and commenting out the vsnprintf code is
not a fix, but it does confirm that this is the problem.

I had hoped that one of the compiler gurus would chime in on this for a real
fix.

It sounds like you are stuck on 7.5 because of your ICD2. I had this
problem, but Sparkfun fixed it for me. Others have gone with other
programmers like the PicKit.

Be sure to check out Bill's tutorial on programming the UDB at:
http://gentlenav.googlecode.com/files/PICProgrammingGettingStarted.pdf

I am using MPLAB v8.10 with the ICD2 with no issues.

At this stage, you might try the demo program to see if the UDB behaves as
expected. I forget which board you have but there are some testing code on
the MatrixPilot site:

http://code.google.com/p/gentlenav/wiki/Home?tm=6

Best,
John


----- Original Message -----
From: <stev...@live.cn>
To: "uavdevboard" <uavde...@googlegroups.com>

John McClelland

unread,
Dec 20, 2010, 9:28:46 PM12/20/10
to uavde...@googlegroups.com
Steven

I think I answered the wrong question...I am using v3.22 C30 compiler.

John


----- Original Message -----
From: <stev...@live.cn>
To: "uavdevboard" <uavde...@googlegroups.com>

Tom Pittenger

unread,
Dec 20, 2010, 9:31:22 PM12/20/10
to uavde...@googlegroups.com

Does your project settings have an include or lib folder that it points to?

John McClelland

unread,
Dec 20, 2010, 9:41:38 PM12/20/10
to uavde...@googlegroups.com
Tom
 
MP-H has libdsp-coff.a Library File.
 
I see that another user had this problem with the C30 v3.25 compiler, but there was no follow up that I could find.  Here is the thread:
 

Tom Pittenger

unread,
Dec 20, 2010, 9:45:13 PM12/20/10
to uavde...@googlegroups.com

I know this doesn't help now.. but a version of telemetry.c without vsprintf is on the to do list.

John McClelland

unread,
Dec 20, 2010, 9:48:26 PM12/20/10
to uavde...@googlegroups.com
Tom
 
The problem is that MP-H compiles fine on my setup and I sure it worked for Jerry, Bill, Marc and Justin at a minimum.   So this is specific to Steven's setup. 
 
Best,
John
> > On 12��20��, ����11ʱ02��, "John McClelland" <mcclelland.j...@gmail.com>
> >> On 12��20��, ����9ʱ29��, "John McClelland" <mcclelland.j...@gmail.com>

John McClelland

unread,
Dec 20, 2010, 10:26:52 PM12/20/10
to uavde...@googlegroups.com
Steven

Look at this thread...it is your problem and has a fix....or just get the
earlier version of the C30 compiler.
http://www.microchip.com/forums/m535514-print.aspx

John
----- Original Message -----

From: <stev...@live.cn>
To: "uavdevboard" <uavde...@googlegroups.com>

stev...@live.cn

unread,
Dec 21, 2010, 9:08:13 PM12/21/10
to uavdevboard
Hi John,

Could I ask you for a copy of v3.24 evaluation package or lower? I
can't find any free version of v3.24 or lower.
Thank you.

Regards,
Steven




On 12月21日, 下午2时26分, "John McClelland" <mcclelland.j...@gmail.com>
wrote:
> Steven
>
> Look at this thread...it is your problem and has a fix....or just get the
> earlier version of the C30 compiler.http://www.microchip.com/forums/m535514-print.aspx

stev...@live.cn

unread,
Dec 21, 2010, 9:29:54 PM12/21/10
to uavdevboard
Hi John,

Could I ask you for a copy of v3.24 evaluation package or lower? I
can't find any free version of v3.24 or lower.
Thank you.

Regards,
Steven




On 12月21日, 下午2时26分, "John McClelland" <mcclelland.j...@gmail.com>
wrote:
> Steven
>
> Look at this thread...it is your problem and has a fix....or just get the
> earlier version of the C30 compiler.http://www.microchip.com/forums/m535514-print.aspx

stev...@live.cn

unread,
Dec 21, 2010, 9:57:13 PM12/21/10
to uavdevboard
Hi All,

I have switch back to v3.21 beta and the problem solved !
THANK YOU !!!

Regrads,
Steven



On 12月21日, 下午2时26分, "John McClelland" <mcclelland.j...@gmail.com>
wrote:
> Steven
>
> Look at this thread...it is your problem and has a fix....or just get the
> earlier version of the C30 compiler.http://www.microchip.com/forums/m535514-print.aspx

John McClelland

unread,
Dec 21, 2010, 11:43:26 PM12/21/10
to uavde...@googlegroups.com
Steven

Glad that worked for you...good luck. We should probably document this
compiler issue and it's solution.

Best,


John
----- Original Message -----

From: <stev...@live.cn>
To: "uavdevboard" <uavde...@googlegroups.com>

Reply all
Reply to author
Forward
0 new messages