MPLAB-X on Ubuntu 10.04

452 views
Skip to first unread message

markw

unread,
Dec 31, 2011, 1:21:25 PM12/31/11
to uavde...@googlegroups.com
To anyone creating a new project in MPLAB X from gentlenav SVN repository using File:New Project:Existing MPLAB IDE v8 Project:

you might have to fix a few errors which occur due to bad library settings and case sensitive filenames:

Compile Error:
"/opt/microchip/mplabc30/v3.30c/bin/pic30-as" ../../libUDB/traps_udb4_asm.s -o build/default/production/_ext/1077454706/traps_udb4_asm.o -omf=elf -p=33FJ256GP710A --defsym=__MPLAB_BUILD=1 -g -MD build/default/production/_ext/1077454706/traps_udb4_asm.o.d -I.. 
make[2]: Leaving directory `/home/markw/MPLABXProjects/gentlenav/trunk/MatrixPilot/MatrixPilot-udb4.X'
make[1]: Leaving directory `/home/markw/MPLABXProjects/gentlenav/trunk/MatrixPilot/MatrixPilot-udb4.X'
../../libUDB/traps_udb4_asm.s:2: Error: can't open p33fxxxx.inc for reading
Fix:
change p33fxxx.inc to p33Fxxx.inc (note uppercase F) in highlighted source file
(simply clicking on the error line in the MPLAB output window will take you straight to line 2 of the file)

You will also get a compile error in libUDB_defines.h dependent on which version of the UDB you select in options.h.
For the UDB4 the necessary change is on line 67:

#include "p33FJ256GP710A.h" (note that everything except the leading "p" and trailing "h" is UPPERCASE


Link Error:
/opt/microchip/mplabc30/v3.30c/bin/bin/../bin/pic30-elf-ld: cannot find -legacy-libc
Fix:
The default value for C30:pic30-ld:Libraries:System Libraries need to change from:




I hope the screenshots are readable. The System Library names are "lega-c" and "dsp".

--markw

markw

unread,
Feb 23, 2012, 6:10:36 PM2/23/12
to uavde...@googlegroups.com
Is anyone else using MPLAB-X with the C30 v3_30 compiler to build MatrixPilot?

I'm observing a problem when not linking with the legacy C library (liblega-c).
It seems that sometimes snprintf() burns a lot of CPU cycles (20 msec worth), unless you link with lega-c.

--markw

Netfoot

unread,
Feb 29, 2012, 12:38:40 AM2/29/12
to uavde...@googlegroups.com
I just installed MPLAB X v1.00 on my wee netbook, and the first thing I tried was to run the Debugger/Programmer Self-Test.  When I go to select the tool,  under PICkit3, it says Self Test Not Supported SN: xxxxxxxx and lists the correct serial number for my PK3. 

Obviously, it has correctly read the S/N from the PK3.  Is anyone else able to run the self-test on a PK3?   Uh...   I've not plugged the PICkit3 into a UDB4 or anything.

When I plug the PK3 I get Green/Power, then Blue/Active and Red/Status, then Status is extinguished.  When I try to run the self-test Blue/Active and Red/Status flicker, then Blue/Active comes full on, and Status changes to a colour I can only describe as White and goes full on.  After that, nothing I do including Disconnect from Debug Tool has any effect, and I have to disconnect the PK3.

Pointers welcome.
---
Angus

Mark Whitehorn

unread,
Feb 29, 2012, 9:11:34 AM2/29/12
to uavde...@googlegroups.com
Hi Angus,

I was beginning to wonder if I was the only UDB user running Linux; which OS do you have on your netbook? 

My Self-Test menu for the PICkit3 also says "self test not supported".

My status light is initially off after connecting the USB cable. I don't get a green status indication until after I download an image (e.g. "Make and Program Device"; but the green status occurs whether or not a target device is connected.  

I'll bet your PICkit3 is working correctly,
--markw
--
Mark Whitehorn
kd0...@gmail.com

Netfoot

unread,
Feb 29, 2012, 11:22:52 AM2/29/12
to uavde...@googlegroups.com
On Wed, Feb 29, 2012 at 10:11 AM, Mark Whitehorn <kd0...@gmail.com> wrote:
Hi Angus,

I was beginning to wonder if I was the only UDB user running Linux; which OS do you have on your netbook? 

Hi, Mark!  It's Slackware 13.1 and it runs just fine.  I did a few experiments with X Beta 5 some while ago, and got it all working after a bit of sweating, but resolved to wait until it was formally released. 

I'll bet your PICkit3 is working correctly,

Probably.

I used the built-in subversion tool to retrieve the latest code from the repository, and converted the project for the RPY-udb4 project.  Then trying to clean and build, I get

In file included from ../../libUDB/libUDB.h:28,
                 from ../../libUDB/libUDB_internal.h:22,
                 from ../../libUDB/background.c:22:
../../libUDB/libUDB_defines.h:61:22: error: p30f4011.h: No such file or directory

Turns out options.h defined BOARD_TYPE = UDB3_BOARD so I altered that and tried again.  This time, it can't locate  p33fj256gp710a.h probably because /usr/bin/find can't locate it either.  I suppose this means I have to upgrade C30 to something later than 3.24?  I shudder at the prospect.  Installing 3.24 was a bit of a nightmare. 

I wonder if Pete would still have a copy of that script I bodged together?
---
Angus

Mark Whitehorn

unread,
Feb 29, 2012, 1:36:28 PM2/29/12
to uavde...@googlegroups.com
Angus,

Take a look at my first post on this topic; the problem you're getting below is described there and is due to case sensitive file names, such as "p33fj256gp710a.h" vs "p33FJ256GP710A.h". The version of C30 I have is 3.30, but I'm sure the case issue is OS dependent, not compiler dependent.

What's the RPY-udb4?

good luck,
--mark
--
Mark Whitehorn
kd0...@gmail.com

Netfoot

unread,
Feb 29, 2012, 4:06:35 PM2/29/12
to uavde...@googlegroups.com
Brain not in gear today.  I read and took note of your earlier post when it first appeared, but seem to have forgotten all about it just when I needed to remember. 

I simply symlinked the existing file to the file named in the header.  now the named file can be found, the source code remains unchanged,

Peter Hollands

unread,
Feb 29, 2012, 4:12:34 PM2/29/12
to uavde...@googlegroups.com
Angus,

If you MPLAB_X is now working, I'll not go looking for those scripts that you mentioned. (unless you really really want them).

Best wishes, Pete

Netfoot

unread,
Feb 29, 2012, 4:30:15 PM2/29/12
to uavde...@googlegroups.com
Ok, I installed the newer compiler C30 v3.30c, switched legacy-libc OFF and did a clean/build.  Everything compiled, but the linker complained about undefined reference to `VectorDotProduct', `VectorAdd', `MatrixMultiply', `VectorScale', and `VectorMultiply'.  Do I have to install the matrix math library separately?

RPY-udb4 is just my shorthand referencce to the RollPitchYaw demo for the UDB4.
---
Angus



Netfoot

unread,
Feb 29, 2012, 4:35:05 PM2/29/12
to uavde...@googlegroups.com
Hey, Pete!

I downloaded the linux ".run" installer for C30 v3.30c and ran it as root, and it just worked! (But see earlier post wrt matrix libraries.)  For now, better let the old scripts gather some more dust, where ever they are.

Cheers...
---
Angus

Mark Whitehorn

unread,
Feb 29, 2012, 7:22:41 PM2/29/12
to uavde...@googlegroups.com
Angus,

You need to link with the "dsp" library; it's mentioned in my first post above.

--markw
--
Mark Whitehorn
kd0...@gmail.com

Netfoot

unread,
Feb 29, 2012, 8:30:33 PM2/29/12
to uavde...@googlegroups.com
Did that and:

BUILD SUCCESSFUL (total time: 20s)

Haven't tried programming the device, though.  PK3 will only supply 3.5v max to the target.  I recall using 5.0v with UDB2.  I know the supply voltage range of the cpu is 3v to 3.6v; will the UDB4 itself run on 3.5v?

Mark Whitehorn

unread,
Feb 29, 2012, 9:54:52 PM2/29/12
to uavde...@googlegroups.com
The 3.3V regulator on the UDB4 supplies the CPU and sensors; the only thing the 5V regulator supplies is the EM406.

ICSP connector JP2 on the UDB4 has pin 5 tied to 3.3V, so it should be possible to power it from the PICkit3. It doesn't look to me like it should be a problem backfeeding 3.3V to the onboard regulator, but I power mine separately on the bench from a 5V regulated supply connected to VCC.

--markw
--
Mark Whitehorn
kd0...@gmail.com

Netfoot

unread,
Mar 1, 2012, 12:23:07 AM3/1/12
to uavde...@googlegroups.com
Ok, I switched to LedTest-udb4 as being the easiest to confirm proper operation.  Did a Clean/Build followed by a Make/Program.  Powered UDB4 from PK3 at 3.25v and got

Target device was not found. You must connect to a target device to use PICkit 3.

several times, sometimes I had to run Make/Program again, but sometimes the message would immediately be followed by the

Connecting to MPLAB PICkit 3...
Firmware Suite Version.....01.26.92
Firmware type..............dsPIC33F/24F/24H

Target detected
Device ID Revision = 3003

Programming...
Programming/Verify complete

After programming the LedTest ran OK on PK3 power and on a separate 4-cell NiMh pack.

Tomorrow, I'll go back and give the RollPitchYaw demo another shot.

Thanks for all your help and hand-holding!
---
Angus

Mark Whitehorn

unread,
Mar 1, 2012, 9:25:45 AM3/1/12
to uavde...@googlegroups.com
Congrat's, your PICkit3 output tab reads the same as mine. 

I only get the "device not found" message if I forget to connect the target cable or target power is off. Maybe it's best to use the separate power source.

Glad you're making progress, it's nice to hear from someone else using Linux.
--markw
--
Mark Whitehorn
kd0...@gmail.com

ben levitt

unread,
Mar 1, 2012, 11:08:21 AM3/1/12
to uavde...@googlegroups.com
You guys are ahead of me!  I'm running MPLabX on OSX and it sort of recognizes my PK3, but shows a corrupted ID string, and fails to connect to the PK3 whether or not it's connected to a UDB...

Ben

Art Martin

unread,
Mar 1, 2012, 12:26:26 PM3/1/12
to uavde...@googlegroups.com, uavde...@googlegroups.com
FYI, I am running MPLabX on OSX with PicKit 3 with no problems. 

Sent from my iPhone

Mark Whitehorn

unread,
Mar 1, 2012, 12:53:31 PM3/1/12
to uavde...@googlegroups.com
Hi All,

Good to see interest in MPLAB-X and *NIX .

I'm still wondering if anyone else has observed different behavior of MatrixPilot with and without  liblega-c linked in. I've seen problems with sprintf apparently taking more cpu cycles if lega-c isn't linked.

--markw
--
Mark Whitehorn
kd0...@gmail.com

Wouter van Verre

unread,
Mar 1, 2012, 2:08:29 PM3/1/12
to uavde...@googlegroups.com
Hi Mark,

While I haven't noticed it with MatrixPilot (I dont have a UDB board atm), I have noticed differences in behavior with some other projects I've been working on. The functions I noticed it mostly with are printf and calloc. 
Things I noticed were differences in code size and once I even had a project that would only work when linked with legacy-libc. So yeah, I'd say there are some strange differences when compiling with and without legacy-libc. 
I tried to find something like release notes from microchip, documenting the differences, but I can't seem to find anything like that.

Just my 2 cents,
Wouter


From: kd0...@gmail.com
Date: Thu, 1 Mar 2012 10:53:31 -0700
Subject: Re: MPLAB-X on Ubuntu 10.04
To: uavde...@googlegroups.com

j

unread,
Mar 1, 2012, 3:09:52 PM3/1/12
to uavde...@googlegroups.com
I build mine on ArchLinux and do not appear to have the same issues as seen here. I actually just set mine up like normal, link the proper files, maybe I missed something in this thread just skimmed it. But I have been using UDB on Arch since UDB2 and have really seen no problems, and have not run into anything really abnormal. Maybe I am just lucky or do not know since I have always just built on Nix. Do remember most Nix's such as Ubuntu, Fedora and similar put their own layer on things, and it could be that OS's patching giving you issues. I love being as close to vanilla on my system as possible, I tend to have way less issues, I did try building my first couple times years ago on Ubuntu then Fed and gave up on both of those do to, to much patching I had to do to bring back functionality.


Mark Whitehorn

unread,
Mar 1, 2012, 4:05:58 PM3/1/12
to uavde...@googlegroups.com
Wouter and j,

Thanks for your replies. I just found this thread in a Microchip C30 forum:

It seems the new C library does burn (a lot) more cpu cycles in printf than the legacy library.

--markw
--
Mark Whitehorn
kd0...@gmail.com

Reply all
Reply to author
Forward
0 new messages