Programming via ICSP (Fubarino Mini)

Post Reply
BobEdge
Posts: 7
Joined: Wed Dec 07, 2016 11:24 am

Programming via ICSP (Fubarino Mini)

Post by BobEdge » Wed Dec 07, 2016 12:09 pm

Hello,

I received a couple of Fubarino Mini boards yesterday. Working great with LCD display, and blinking LED.
Then I tried programming using the ICSP, PicKit 3, and MPLAB IPE. This did not work, and bricked the Fubarino.
I did eventually (link on chipKit products page not working) find the correct boot loader, and programmed it via ICSP, and the board is ok again.
I suspect that the configuration bits are not correct, and the oscilator is not working.

Can anyone please instruct me how to program the board using the ICSP?

Kind regards
Bob.

User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Programming via ICSP (Fubarino Mini)

Post by majenko » Wed Dec 07, 2016 4:25 pm

What exactly did you try programming? Was it the output from the Arduino IDE, or did you write your own program in MPLAB-X?
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

EmbeddedMan
Posts: 597
Joined: Tue May 24, 2011 9:24 pm
Location: Minneapolis, MN
Contact:

Re: Programming via ICSP (Fubarino Mini)

Post by EmbeddedMan » Wed Dec 07, 2016 5:19 pm

Yeah, majenko is on the right track (as usual). The chipKIT development environment depends on the bootloader to be there.

If you want to take your sketch and use ICSP to program it, you'll have to merge the bootloader hex file with your sketch output before programming.

*Brian

BobEdge
Posts: 7
Joined: Wed Dec 07, 2016 11:24 am

Re: Programming via ICSP (Fubarino Mini)

Post by BobEdge » Thu Dec 08, 2016 10:22 am

Thank you both for your answers.
I was just trying to program the hex file from a sketch.
I have heard before of merging hex files. I know it is not as simple as copy paste sketch hex at end of boot loader hex.
I seem to remember something about some software which does this. I'll google it.

Regards
Bob.

User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Programming via ICSP (Fubarino Mini)

Post by majenko » Thu Dec 08, 2016 11:08 am

The chipKIT core comes with "bootloaderless" variants of the linker scripts for most boards. It's not easy switching to using them with the Arduino IDE, since it requires editing the boards.txt file and adding "-nobootloader" before the ".ld" of the board specific linker script.

It's easier with UECIDE though which even has an experimental system (using "mdb" which comes with MPLAB-X) to directly program through the likes of a PICkit3. Just install the right programmer plugin, select it in the menu, and set the location of the mdb.jar file in the preferences, and the rest should happen magically.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

BobEdge
Posts: 7
Joined: Wed Dec 07, 2016 11:24 am

Re: Programming via ICSP (Fubarino Mini)

Post by BobEdge » Thu Dec 08, 2016 11:32 am

I have found a very easy solution. None of the complicated mucking about with hexmate, and command lines.
Load your program, or sketch in the normal usb way. Then using MPLAB IPE read the contents of the chip.
Export the hex file, and there you have it. A merged hex file that can be programmed using ICSP.

Regards
Bob.

User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Programming via ICSP (Fubarino Mini)

Post by majenko » Thu Dec 08, 2016 11:49 am

The down side of that though is that you end up with a HEX file that is full of almost nothing. You end up with an image of the entire 128K of flash, not just the bits that are used. Not a problem as such, but does take longer to re-program on a blank chip than just the bits you actually use.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

Post Reply