chipKIT® Development Platform

Inspired by Arduino™

really slow to start.

Created Mon, 30 Nov 2015 20:49:49 +0000 by gromgsxr


gromgsxr

Mon, 30 Nov 2015 20:49:49 +0000

im using an uno32 for a project and compared to an arduino uno running the same sketch the uno32 takes an age to start, it appears to sit there flashing some led's for a good 4-5 seconds before it even starts is there a way to avoid this?


majenko

Mon, 30 Nov 2015 22:34:42 +0000

That's called the bootloader, and is necessary for uploading the program through the USB port.

You can do away with the bootloader if you invest in a hardware programmer and program the chip direct with the ICSP port.

Otherwise you just have to live with it.


EmbeddedMan

Tue, 01 Dec 2015 02:09:59 +0000

Note that some chipKIT boards (like the Fubarino Mini and Fubarino SD and chipKIT-DP32) do not have this delay when rebooting. They use a separate button to enter bootloader mode, so they can start running their sketch immediately on boot rather than waiting for several seconds to see if the PC has a new sketch to upload to the bootloader (which is what your board is doing).

*Brian


gromgsxr

Tue, 01 Dec 2015 10:34:05 +0000

That's called the bootloader, and is necessary for uploading the program through the USB port. You can do away with the bootloader if you invest in a hardware programmer and program the chip direct with the ICSP port. Otherwise you just have to live with it.

if the bootloader was removed and a hardware programmer was used would i still be able to use the same sketch and upload it via chipkit ide??

or is there a way to edit the bootloader to reduce this time and still use the usb?


EmbeddedMan

Tue, 01 Dec 2015 14:17:13 +0000

Unfortunately the answer to both questions is no, as of right now.

MPIDE can't currently upload sketches via hardware programmer without a bit of fiddling under the hood to use a different computer-side application to talk to the hardware programmer.

And reducing the time in the bootloader will make it harder for the PC to reliably send new sketches up to the chipKIT board.

There is another way - you could modify the bootloader code to use the "hold down a button to get into bootloader mode" rather than the "wait for several seconds on each boot for a new sketch from the PC" method, then re-compile it, and program that new bootloader into your board with a hardware programmer.

*Brian


gromgsxr

Tue, 01 Dec 2015 14:50:35 +0000

There is another way - you could modify the bootloader code to use the "hold down a button to get into bootloader mode" rather than the "wait for several seconds on each boot for a new sketch from the PC" method, then re-compile it, and program that new bootloader into your board with a hardware programmer.

that could work the uno32 is going to be mounted permanently in a car as a can-bus display and i/o extender for an after market ecu so once its all finished im not likely to need to re program it again. on a down side it does mean purchasing a programmer that im unlikely to use again after i have loaded the bootloader oh and the bit you mentioned about having to modify the bootloader which i have no clue about.


gromgsxr

Wed, 02 Dec 2015 18:18:45 +0000

so what is the process for uploading a sketch that was created in mpide via a hardware programmer??


majenko

Wed, 02 Dec 2015 23:16:52 +0000

First you need to compile the sketch in the right way. To do that you need to change the compilation so it uses the right linker script - add "-nobootloader" into the ldscript entry in the board config file for your board (just before the .ld so it ends up "...whatever...-nobootloader.ld").

Then you need to take the compiled .HEX file and you can burn it with whatever tool you are using.


gromgsxr

Thu, 03 Dec 2015 22:17:45 +0000

what software would i use for that?


majenko

Thu, 03 Dec 2015 22:33:22 +0000

I use "vi", but then I'm a Linux power user. You can probably use Notepad. Look around in the hardware folder in MPIDE for the variant folder for your board - in there should be a boards.txt file with the settings for that board including an ldscript entry.


gromgsxr

Thu, 03 Dec 2015 22:53:00 +0000

so i would change: uno_pic32.ldscript=chipKIT-application-32MX320F128.ld

to

uno_pic32.ldscript=nobootloader.ld?

could i then compile it in mpide holding shift to save the outputted hex file and use mplab ipe to upload the hex file to the uno32 and remove the bootloader if i use a pickit3?


majenko

Thu, 03 Dec 2015 23:06:42 +0000

No, you insert the nobootloader, so it becomes chipKIT-application-32MX320F128-nobootloader.ld

Sent from my SM-T555 using Tapatalk


gromgsxr

Thu, 03 Dec 2015 23:29:51 +0000

Ok got that bit. > could i then compile it in mpide holding shift to save the outputted hex file and use mplab ipe to upload the hex file to the uno32 and remove the bootloader if i use a pickit3?

is that going to work? or am i way off there to?


majenko

Thu, 03 Dec 2015 23:48:31 +0000

That bit you should be fine with.


gromgsxr

Thu, 03 Dec 2015 23:56:13 +0000

fantastic i have ordered a programmer so i will see how i get on when it turns up.


gromgsxr

Mon, 07 Dec 2015 19:41:20 +0000

it worked!! no bootloader waiting time now thanks