chipKIT® Development Platform

Inspired by Arduino™

Bootloader for Cerebot 32MX4

Created Wed, 01 Jun 2011 04:02:37 +0000 by RockyMountainCoder


Wed, 01 Jun 2011 04:02:37 +0000

Oh this is such a cool project, I love the Arduino compatible PIC32. The only thing that would be better would be the bootloader working on my Cerebot 32MX4 board. I pulled the bootloader and I see the define ready to go for it... but nothing put in yet. I would do it my self... but I dont know how. :(

Please let me know when I can use my Cerebot 32MX4 with the bootloader!!!!

I can just program the bootloader with the USB on the Cerebot board right? I wouldnt need ISP would I? I dont even own one.

Thanks, RockyMountainCoder


Thu, 02 Jun 2011 06:08:56 +0000

Ok, so I modified the bootloader and all of the supporting mpide files so this would work. To my delight much of the work had been done and was hidden by not configuring various things. The next point I am stuck on is that mpide expects to program using a com port... but the Cerebot does not have one. Is this why no support for mpide has been added? Thoughts, suggestions?


Thu, 02 Jun 2011 23:03:34 +0000

Well, I know that I am really just talking to my self here, but in case someone else ever wants to know the progress of this I will keep posting.

I took a closer look at the boot loader and realized it was using UART1 on the pic32, so all I have to do is plug in an FTDI adapter to the UART1 pins on the Cerebot board and I should be good to go. LED1 just keeps flashing, and that is an indication that it didnt get anything from serial. I will try this tonight. I just have to modify my 5v FTDI Breakout from sparkfun to use 3.3v.


Fri, 03 Jun 2011 01:11:02 +0000


You have it exactly correct, use the FTDI cable or adapter connected to UART1.

I started the development on the Cerebot board. It works just fine. I think I have support in the bootloader code specifically for that. If I dont I will add it.

I also am adding all of the Microchip pic32 [edit] starter kit boards.

Actually you can use the bootloader on any chip without modification. The only thing special that needs to be done is the definition of the LED pin for bootloader status.

I will try to get the specific Cerebot support in the released code within the next week.



Fri, 03 Jun 2011 16:44:38 +0000

I also am adding all of the Microchip starter kit boards. Mark

Does that include the pic18f starter. It would be awesome to eventually be able to use this on other families of PIC.


Sat, 04 Jun 2011 12:51:56 +0000

The current implementation only supports the PIC32 architecture. Therefore any starter kit or any board that does not use pic32 will not work.

If a gcc compiler becomes available for the pic18, then I will port it to pic18 as well. Until that happens it wont work.



Mon, 06 Jun 2011 15:14:28 +0000 Would this work.


Mon, 06 Jun 2011 21:34:05 +0000

sdcc is not a C++ compiler, it only supports C.

MPIDE could easily be made to use SDCC but it would not support the normal Arduino tool chain, i.e. Serial.begin, Serial.print, or any of the other routines that rely on C++

Therefore it is not worth the effort at this point to try to support sdcc since it would only be a partial solution.



Tue, 07 Jun 2011 11:31:14 +0000

@Mark Would you mind sharing the changes you've made to make this work?

I have added

#elif defined(__32MX460F512L__)
		#define	_CPU_NAME_	"32MX460F512L"
		#define	FLASHEND	       (512 * 1024L)
		#define	RAMEND	       (16 * 1024L)

to cpudefs.h.

pic32bootloader.c seems a bit tricky. Added

#elif defined(__32MX460F512L__)
        #define _BOARD_CEREBOT_32MX4_
        #define _USE_RELEASE_OPTIONS_
        #define _ENABLE_PORT_BLINK_

and added support for blinking the led on portb bit 10. However I don't know what to add to the configuration part starting around line 110-ish. Thinking about copy/pasting stuff from the Cerebot LED Demo but afraid to mess things up :roll: