Sonsivri

Electronics => Hardware and Tools => Topic started by: Cain on May 28, 2013, 06:30:04 18:30



Title: PIC bootloader with Linux software?
Post by: Cain on May 28, 2013, 06:30:04 18:30
Anyone recommending a good bootloader for PIC16F/PIC18F with working Linux software?

I've been testing the Tiny Bootloader and it works great to download new HEX-files on Windows but trying to find a working Linux software have been proving to be hard. Piklab supports Tiny Bootloader but have problems compiling/running on headless machines (relies on KDE) and when testing the Windows build of piklab-prog it's slow as hell, takes ~30 second before it finds the PIC and starts downloading anything...

Are there anything that works as good as OptiBoot and avrdude for the PIC?


Title: Re: PIC bootloader with Linux software?
Post by: Gallymimu on May 29, 2013, 03:57:53 15:57
Did you see these lists?

Supposedly these have linux host programs:
http://www.microchip.com/forums/m424874-print.aspx

the next one claims to have a shell script for bootloading but this is an HID bootloader (USB)
http://elco.crsndoo.com/wordpress/2011/03/microchip-hid-bootloader-from-linux/

Here is one for tiny bootloader written in python if you haven't tried it yet.
http://sourceforge.net/projects/tinybldlin/



Title: Re: PIC bootloader with Linux software?
Post by: Sideshow Bob on May 29, 2013, 06:35:25 18:35
Would it not be more easy to get a PICKIT or clone. And then use MPLABX that now are supported by Linux. As this solutions also offer some debugging. I think MPLABX now support PICKIT2. And PICKIT2 clones are quite cheap now. PICKIT2 do not support all PICs. But still the support list is more than adequate


Title: Re: PIC bootloader with Linux software?
Post by: Gallymimu on May 29, 2013, 07:32:22 19:32
I assumed he actually needed a bootloader for an application, but otherwise Bob you are quite right, much easier!


Title: Re: PIC bootloader with Linux software?
Post by: Cain on May 30, 2013, 06:00:12 06:00
Thanks for the input but as mentioned above I need to be able to flash the PIC via serialports on a headless machine (i.e CLI only) running Debian. I have PICKit2 and 3 but doesn't solve this problem and MPLABX requires X to run.

I do this with AVR's using avrdude and it works great and was hoping to find a simlilar working "picdude" sofware. Preferable in plain C since flash space is very limited so trying to avoid heavy packages like Phyton/Perl etc.

Last night I found C code for a CLI program (written by Joseph Heenan) but unfortunately it does not work! It compiles OK on Debian (armel) but fails to detect the PIC18F2620 running Tiny Bootloader, same HW works in Windows when I try it there using tinybldWin.exe.

Anyone have this working on Linux?

http://code.google.com/p/pic-bootloaders/downloads/list (http://code.google.com/p/pic-bootloaders/downloads/list)



Title: Re: PIC bootloader with Linux software?
Post by: Sideshow Bob on May 30, 2013, 08:48:55 08:48
I am not a linux person. But I think Microchip have made a command line tool to run under Linux for both PICKIT 2 and PICKIT 3. Just google "pickit 2 command line" or "pickit 3 command line"


Title: Re: PIC bootloader with Linux software?
Post by: Gallymimu on May 30, 2013, 02:35:13 14:35
Thanks for the input but as mentioned above I need to be able to flash the PIC via serialports on a headless machine (i.e CLI only) running Debian. I have PICKit2 and 3 but doesn't solve this problem and MPLABX requires X to run.

I do this with AVR's using avrdude and it works great and was hoping to find a simlilar working "picdude" sofware. Preferable in plain C since flash space is very limited so trying to avoid heavy packages like Phyton/Perl etc.

Last night I found C code for a CLI program (written by Joseph Heenan) but unfortunately it does not work! It compiles OK on Debian (armel) but fails to detect the PIC18F2620 running Tiny Bootloader, same HW works in Windows when I try it there using tinybldWin.exe.

Anyone have this working on Linux?

http://code.google.com/p/pic-bootloaders/downloads/list (http://code.google.com/p/pic-bootloaders/downloads/list)

Anyone recommending a good bootloader for PIC16F/PIC18F with working Linux software?

I've been testing the Tiny Bootloader and it works great to download new HEX-files on Windows but trying to find a working Linux software have been proving to be hard. Piklab supports Tiny Bootloader but have problems compiling/running on headless machines (relies on KDE) and when testing the Windows build of piklab-prog it's slow as hell, takes ~30 second before it finds the PIC and starts downloading anything...

Are there anything that works as good as OptiBoot and avrdude for the PIC?



Where exactly did you mention needing to use the serial port in your original post?

Kinda frustrating to offer help when you don't even ask the right question!

Good luck.


Title: Re: PIC bootloader with Linux software?
Post by: Cain on May 31, 2013, 06:00:59 18:00
Where exactly did you mention needing to use the serial port in your original post?

My bad! As you spotted I did not specifiy serial port in my first post but we all make misstakes, sorry ;)

Anyway, thanks for the input so far to both of you but the PICkit 2/3 is not the solution! After some more testing the PIC Tiny Bootloader work nicely on Windows all I need to find is some software that runs equally well on Linux (Debian).

Wished I had the C skill to fix whats broken in Joseph Heenan's program...



Title: Re: PIC bootloader with Linux software?
Post by: ChumKiuFoshan on August 30, 2019, 05:39:06 17:39
Just for future reference, if someone have interest in this stuff, here below a link for a Python script that is able to work (tested practically) with the TinyBootloader under Linux.

https://sourceforge.net/projects/tinybldlin/files/ (https://sourceforge.net/projects/tinybldlin/files/)

I've tested it in a RPi2 model B with Python 2.7, connection was through the serial port.

This link was already written above but this is just to put in evidence that this is able to work nicely inside a RPi environment.

Bye