Hi,
I'm currently trying to implement a linux - bootloader programmer for the bus pirate.
In this thead I want to report my progress - and if you would like to help, feel free to contact me.
Another reason I post my progress here is that you can tell me if I do something horribly wrong.
I checked out the svn repo and had a look at the sources.
-> The bootloader is based on the an851 - Application Note can be found here:
http://ww1.microchip.com/downloads/en/AppNotes/00851b.pdfMore information could be found here:
http://www.microchip.com/Stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en012031I also found a linux programmer
http://cockpit.varxec.net/software/pic.html - but unfortunately it does not work that well - starting it without any params results in a segfault:
(gdb) r
Starting program: /data/an851/an851host
To read from flash Memory:
Program received signal SIGSEGV, Segmentation fault.
0x00007f994b1be480 in strlen () from /lib/libc.so.6
--> I will investigate these issues later on and provide a patch, but as I want to write a portable client I stick with python an pyserial, using the programms source-code as a reference.
Let's start:
* According to the source the bootloader operates at 9600 baud, 8N1 (however it should have an autobaud feature)
* According to AN p.3 the format is <STX><STX>[<data><data>...]<CHKSUM><ETX>
where STX = 0x0f , ETX=0x04 , CHECKSUM is the 2's complement of the lower byte of the sum of all data.
* On page 9 the read bootloader version information is 0x00 0x02
So my source looks like
import serial
ser = serial.Serial('/dev/ttyUSB0', 9600,bytesize=8, parity='N', stopbits=1, timeout=None, xonxoff=0, rtscts=0)
ser.write("\x0F\x0F\x00\x02\xFE\x04")
print "reading?"
print ser.read(4)
However I don't receive any data :/
Can somebody perhaps log what the original pic programmer sends over the serial line? - would be cool.