UBW32 with XC32 compiler...

USB PICs and the UBW

Moderator: phalanx

Post Reply
jbuszkie
Posts: 2
Joined: Sat Jan 26, 2013 12:02 pm

UBW32 with XC32 compiler...

Post by jbuszkie » Sat Jan 26, 2013 12:34 pm

I'm trying to get the generic 1.63 firmware to compile on MPLAB-X 1.6 with the new
XC compiler and the MAL from 10-15-2012

After changing some of the includes after sleecting the XC32 compiler it starts to work. but now it seems to
be complaining about some of the "built ins"?

Code: Select all

build/MX460/production/D32.o: In function `parse_BL_packet':
C:\Documents and Settings\Administrator\My Documents\Downloads\UBW32_v1_6_3.X/D32.c:985: undefined reference to `INTDisableInterrupts'
build/MX460/production/D32.o: In function `CoreTimerHandler':
C:\Documents and Settings\Administrator\My Documents\Downloads\UBW32_v1_6_3.X/D32.c:488: undefined reference to `UpdateCoreTimer'
build/MX460/production/D32.o: In function `UserInit':
C:\Documents and Settings\Administrator\My Documents\Downloads\UBW32_v1_6_3.X/D32.c:594: undefined reference to `OpenCoreTimer'
C:\Documents and Settings\Administrator\My Documents\Downloads\UBW32_v1_6_3.X/D32.c:600: undefined reference to `INTEnableSystemMultiVectoredInt'
build/MX460/production/main.o: In function `OSCSetPBDIV':
c:/program files/microchip/xc32/v1.20/bin/../lib/gcc/pic32mx/4.5.2/../../../../pic32mx/include/peripheral/osc.h:175: undefined reference to `INTDisableInterrupts'
c:/program files/microchip/xc32/v1.20/bin/../lib/gcc/pic32mx/4.5.2/../../../../pic32mx/include/peripheral/osc.h:183: undefined reference to `INTRestoreInterrupts'
build/MX460/production/main.o: In function `SYSTEMConfigWaitStatesAndPB':
c:/program files/microchip/xc32/v1.20/bin/../lib/gcc/pic32mx/4.5.2/../../../../pic32mx/include/peripheral/system.h:232: undefined reference to `INTDisableInterrupts'
c:/program files/microchip/xc32/v1.20/bin/../lib/gcc/pic32mx/4.5.2/../../../../pic32mx/include/peripheral/system.h:234: undefined reference to `INTRestoreInterrupts'
What am I missing?

jbuszkie
Posts: 2
Joined: Sat Jan 26, 2013 12:02 pm

Re: UBW32 with XC32 compiler...

Post by jbuszkie » Sun Jan 27, 2013 1:50 pm

Ok.. I think I've found the answer on the microchip forums...

here

but basically
Make sure that you use the linker scripts provided with XC32. Note that there is a new "OPTIONAL" linker-script directive that calls the peripheral library. In C32, the pic32-gcc driver always linked the peripheral library and required it to exist. In XC32, the new OPTIONAL linker-script directive allows the link to continue even if the plib for the specified device does not exist. If you have a custom linker script, you can copy these OPTIONAL directives from the XC32 linker script to your custom linker script.
These were the lines I had to add to the procdefs.ld file...

Code: Select all

/*************************************************************************
 * Processor-specific peripheral libraries are optional
 *************************************************************************/
OPTIONAL("libmchp_peripheral.a")
OPTIONAL("libmchp_peripheral_32MX460F512L.a")
Change the 32MX460512L to the 795 I imagine to use it for the 795 part.
There's probably a way to make it clean for both.. like adding something to the linker command line.. but I haven't got that far yet.

But after I added both lines I was able to compile. Now I just have to test it out.

I haven't gone back to 2.01 to see if it breaks.. but it works now with the XC32 compiler...

Jim

KC7NOA
Posts: 1
Joined: Fri Jan 23, 2015 10:22 pm

Re: UBW32 with XC32 compiler...

Post by KC7NOA » Fri Jan 23, 2015 10:25 pm

Jim ...

Can you post your project some where .... ??

Id like to work on the ubw32 with XC32 / MplabX under Linux/Ubuntu ....

Hope you still have it .. its been a while since you posted this ....

Post Reply