chipKIT® Development Platform

Inspired by Arduino™

Chipkit max32 Start-up from reset or POWER ON

Created Wed, 12 Nov 2014 15:01:11 +0000 by roger


roger

Wed, 12 Nov 2014 15:01:11 +0000

Good afternoon everyone

I am relatively new the use of chipkit max32, but I already have experience in PIC18 MCU's. My question though related to some already posted is a bit more specific, that's why I decided to create a topic. (I hope you do not mind)

I wonder if it's possible to program your chipkit max32 with chipKIT PGM Programmer / Debugger within (using) the MPIDE, because I know that the programmer will erase the bootloader.

And right now you ask me why use a programmer with MPIDE instead of using the common method-USB BOOTLOADER ???

The reason is that the bootloader makes the MCU (PIC32) takes about 5 seconds to turn on after powered by an external source or by USB power and I would like it starts up almost instantly after getting power, just like a simple PIC18.

If this is not possible with the PGM chipkit or PICkit3 or pickit2 also i would like to know if it is possible to decrease start-up time of bootloader without having to delete it ??

CONCLUSION, I just like to use all the advantages and POWER of the fantastic world of chipkit and all the facilities in terms of code and libraries such as with a SD memory card and their libraries (unfortunately I do not have the capacity or time to learn and building code in MPLAX) but would like the bootloader starts up much faster.

I do not know if this is possible and therefore I would like to know your opinion and if it is possible what steps to follow, because I think this topic can be useful for other members.

I hope not be breaking any rules of the forum because this is my FIRST POST (of many I hope) and is fairly extensive.

From already, thank you very much!!


majenko

Wed, 12 Nov 2014 16:28:39 +0000

It's perfectly possible, though not simple.

The main problem here is that you need to link the program with a different linker script that doesn't rely on the bootloader being there. The linker script is included in with MPIDE, and has the suffix -nobootloader.ld.

You will need to create yourself a custom board in boards.txt and change the linker script used to the -nobootloader.ld one. Then you can compile your sketch into a .HEX and upload it using the programmer of your choice. You won't be able to do the uploading direct in MPIDE though as it doesn't support either of those programmers.

There is also the option of using UECIDE, which does support (at least partly) the pickit2 for programming, and would even automatically use the -nobootloader.ld linker script for you.


roger

Wed, 12 Nov 2014 22:24:36 +0000

Thanks for your quick response!!

I already had installed UECIDE and by chance I forgot to mention it (It´s amazing by the way, very fast the modular conception to simply add boards is very cool!).

Majenko so you mean that I can simply use the UECIDE selecting chipkit board max32 and in "programmer" i select the pickit2 and them i can send the sketch to the MCU without problems ??

What do you mean with "at least partly" ??

With this: "and would even automatically use the -nobootloader.ld linker script for you" do you mean that it is not necessary to change the linker script nobootloader.ld, right ??

Thank you


majenko

Wed, 12 Nov 2014 22:38:39 +0000

By "at least partly" I mean I haven't fully tested it on anything other than Linux.

And yes, it changes the linker script for you:

ldscript=chipKIT-application-32MX795F512${upload.${prefs:board.${prefs:board}.programmer}.ldsuffix}.ld

roger

Wed, 12 Nov 2014 22:54:09 +0000

Any body else that already have tested this approach??

So...it should result... 8-)

I guess i can try it without any danger to the board (with exception of bootloader)


roger

Wed, 12 Nov 2014 23:29:27 +0000

I have already tested and got nothing :?


majenko

Thu, 13 Nov 2014 10:16:37 +0000

Hum...

Which version of UECIDE are you on?


roger

Thu, 13 Nov 2014 21:52:18 +0000

The last one, not de beta version but the official: 0.8.7j

Should i power the chipkit max32 with an external power source, or from the USB or not power it at all??


majenko

Thu, 13 Nov 2014 22:39:45 +0000

I couldn't remember quite when I added the support for the variable bootloader selecting. It looks like it was after 0.8.7j, so you will need the beta version for it to work.

You can power the board any way you like.


roger

Thu, 13 Nov 2014 23:17:15 +0000

And about power?? Will the pickit2 provide 5V to chipkit or i need to power it externally or with serial usb??

What do you think about compile the sketch and upload the hex file in mplabX with pickit3??


majenko

Thu, 13 Nov 2014 23:59:36 +0000

As I said, you can power it however you like. The PK2 should provide power, but I'm not sure if that is enabled by the upload program or not (mine is a clone with permanent power). If it doesn't even begin to program then it has no power.

Yes, you can take the HEX file and use MPLAB-X, or MPLAB IPE to upload with a PK3. That won't cure the fact that you need the beta version of UECIDE to get the right HEX file compiled in the first place.