chipKIT® Development Platform

Inspired by Arduino™

port code compiled w MPIDE to MPLAB for an embedded app?

Created Sun, 06 Apr 2014 15:12:28 +0000 by greatnorthern


Sun, 06 Apr 2014 15:12:28 +0000

sorry if this is in the wrong place, I've been trying all night to no avail to take the compiled Blink.cpp.hex over to MPLAB X and program the Uno32 with my PICkit 3.. it programs, verifies, but does not appear to work.. what am I missing?

I'm really brand new to the ChipKit scene, I wanted something faster and beefier to work with than the Atmega328, but not so much as the ARM in the Due.. I felt this was a good compromise.

my applications for this will need to be programmed from MPLAB via ICSP in the end. I am hoping this is simple and I'm just not catching on yet :)



Sun, 06 Apr 2014 17:02:45 +0000

You will have to compile the .hex using a special non-bootloader .ld script. The config settings are held in the bootloader - when you write the .hex with a PK3 you will be replacing the bootloader, and hence all the config settings.

You will need to make your own custom board definition in MPIDE and change the ld script it uses (non-bootloader scripts are provided).


Mon, 07 Apr 2014 00:09:42 +0000

Hi Majenko, thanks so much for the reply. I have found the non-bootlaoder .ld script in the "cores" folder. How would I proceed to compile the .hex with this?

Also, what does making my custom board definition entail? is it in the "boards.txt" file? sorry but I am a noob to all of this backend stuff :) thanks!!


Mon, 07 Apr 2014 00:33:36 +0000

Yes, you need to edit the boards.txt file. Copy the section for your board and rename it (for the UNO32 you'd find all the entries starting uno_pic32.* and copy them renaming them to something else, like uno_pic32nb.*). Change the name of the board ( UNO32 Without Bootloader) and change the uno_pic32nb.ldscript entry to use the non-bootloader version of the linker script. Load MPIDE, and you should have a new board.

This is what you might end up with: UNO32 No Bootloader

... or just copy and paste that lot into your boards.txt file ;)

And here's the result - just select that board, compile the sketch, and you should have a .hex you can work with: [attachment=0]nobootloader.png[/attachment]


Mon, 07 Apr 2014 00:56:03 +0000

thanks again! I will try this too, but what I have just figured out in the mean time is that this: method works, apparently. I simply imported the .elf and added the newest bootloader to the "loadables" folder in MPLAB and hit "make and program" and it worked, it loaded the bootloader as well as the .hex on, as I'm still able to update the board in MPIDE.. any caveats to doing it this way other than the size of the bootloader?


Tue, 08 Apr 2014 16:16:51 +0000

Hi, there is something what would help.

I have a document in my hand (on CD) which describes the MPIDE MPLABX integration, also supplied with MPLABX sample project files. You can see the abstract in this document on page 13 under Class 17007:

I couldn't find on the net the files itself, and unfortunately I can't upload to the forum, it is preventing to upload pdfs. If you need it, I can send by email.

I haven't tried it yet. I use Uecide for developing, but it should not be a problem to go back to mpide for the debugging. Maybe Majenko will explain how to apply this knowledge from uecide?!


Tue, 08 Apr 2014 16:39:13 +0000

Well, under the hood UECIDE and MPIDE are the same from a compilation PoV. They use different techniques to do the compiling, but the source code they use and the end result are the same - UECIDE just uses multiple libraries (libXXX.a) whereas MPIDE uses one "core.a" file plus lots of object files.

I have no clue what the documented method of using MPLAB-X with MPIDE sketches is.

If you want to send me the PDF(s) you could upload them to my FTP server - (login anonymously as ftp) and place them in the "incoming" folder.


Tue, 08 Apr 2014 16:57:41 +0000

I have uploaded.

Please comment, should I start to struggle with the integration?


Tue, 08 Apr 2014 17:53:44 +0000

By all means go for it. The main thing MPIDE does (by the look of things) is build an elf file - that is the same in UECIDE. It's simpler there though as you have the Sketch menu entry "Show Build Folder" which will open the location where the elf file is for you to get at it easier.


Tue, 08 Apr 2014 19:58:31 +0000

For more info on the board variant mechanism in MPIDE, have a look at the instructions here:



Thu, 10 Apr 2014 20:04:08 +0000 ... mechanism/ Cheers

It's heavy, but gooooood. Needs energy to digest.

Egeszsegedre (Cheers in Hungarian :D )


Wed, 23 Apr 2014 09:52:18 +0000

I was able to debug MPIDE sketch, using uC32 board, PGM programmer in MPLABX. :) see here: