Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - broeggle

17
Bus Pirate Support / Re: Linux - Bootloader-Programmer
I asked one of my university teachers if he has one for me - maybe I'm lucky.

Isn't it possible to set the config vars using the windows-programmer? (unfortunately I don't have the menu for it?)
18
Bus Pirate Support / Re: Linux - Bootloader-Programmer
yeah -it's the same for every location - of course I've tried erasing the board, but the values still remain the same.

I experimented a bit using my api - and made the following observations
I can read flash. EEDATA and CONFIG - i.e. the values remain the same after wrting.
I can't write flash , EEDATA but I can write to config - however if I unplug the bp the values are resetted.

--> maybe I have enabled some write protection by setting (random) values to the config?
19
Bus Pirate Support / Re: Linux - Bootloader-Programmer
hmm bad news - I tried flashing again and had a look at the error report :/

[tt:]Verify Error at 0x4 should be: 0x82EC but read: 0xFFFFFF
Verify Error at 0x6 should be: 0x82EC but read: 0xFFFFFF
Verify Error at 0x8 should be: 0x82EC but read: 0xFFFFFF
.....
Verify Error at 0x82E6 should be: 0x6 but read: 0xFFFFFF
Verify Error at 0x82E8 should be: 0x0 but read: 0xFFFFFF
Verify Error at 0x82EA should be: 0x0 but read: 0xFFFFFF
Verify Error at 0x82EC should be: 0xFE0000 but read: 0xFFFFFF
Verify Error at 0xABFC should be: 0xF9DF but read: 0xFFFFFF
Verify Error at 0xABFE should be: 0x3F7F but read: 0xFFFFFF[/tt:]
20
Bus Pirate Support / Re: Linux - Bootloader-Programmer
no problem ian, don't worry - we'll find the solution:)
can you perhaps make a dump (i.e. read device in the windows programmer) and post it somewhere?
Then I can compare it to my dump and spot the differences and start guessing :)

Thanks,
22
Bus Pirate Support / Re: Linux - Bootloader-Programmer
@ian:
hi - is there any posibility that I could have messed up the bootloader ?
I mean it still reports its version - however even after uploading the current firmware with windows I can't access the bus pirate's menu :/ - The update proceedure seems to work quite fine.

Are there any special values that don't get written via the programmer that are necessary? ( eeprom, flash, data memory config memory) ?

Would be nice if you/someone could give me any hints how I can revive my bus-pirate :)


Thanks,
23
Bus Pirate Support / Re: Linux - Bootloader-Programmer
hehe - no flowcontrol -> it works!

Code: [Select]
import serial
ser = serial.Serial('/dev/ttyUSB0', 9600,bytesize=8, parity='N', stopbits=1, timeout=None, xonxoff=0, rtscts=0)
ser.write("x55x550x02xFEx04")
#ser.write("x55x55x01x00x00xFFx47x05x04")
print "reading!"
x=ser.read(8);
for i in x:
    print hex(ord(i)),

print
Results in
[tt:]0x55 0x55 0x0 0x2 0x2 0x1 0xfb 0x4[/tt:]
-> the bootloader version is 0x1 0x2
which is defined in the config.h
Code: [Select]
//Bootloader Operation Configuration
#define MAJOR_VERSION       0x01    //Bootloader FW version
#define MINOR_VERSION       0x02

--> It works! yeah.
Now I can implement the rest of the bootloader :)
24
Bus Pirate Support / Re: Linux - Bootloader-Programmer
hmm - I changed it - but it still does not work :/
Seems I have to read the AN more throughly  and perhaps study the code.

Do you perhaps know if the bootloader uses any hardware/software flowcontrol?

Thanks
25
Bus Pirate Support / Re: Linux - Bootloader-Programmer
Thanks ian - very nice.

Especially thanks for the link - there stx is defined in this AN as 0x55 instead of 0x02 :)
--> Now it's obvious why it didn't work :)
I'll continue hacking on the programmer and report my progress here - thanks!
26
Bus Pirate Support / Re: Linux - Bootloader-Programmer
And here's the patch - but programming/erasing still not possible :/
Is there anything else I have to do than to put a jumper between PGD and PGC?
Code: [Select]
diff -uNpr an851host.c{,.orig}
--- an851host.c 2009-07-24 17:07:17.000000000 +0200
+++ an851host.c.orig    2009-07-24 17:06:23.000000000 +0200
@@ -260,7 +260,7 @@ void setline(int fd, int flags, int spee
        tcsetattr(fd, TCSANOW, &t);
 }

-void usage(char* argv0)
+void usage(argv0)
 {
        printf("To read from flash Memory: n");
        printf("tusage: %s --readflash --bytes <n> --startaddr <x>n", argv0);
@@ -280,7 +280,7 @@ void usage(char* argv0)
        printf("t  eg: %s --rows 3 --startaddr 0x01320nn", argv0);

        printf("nTo reset PIC via bootloader: n");
-       printf("tusage: %s --resetn",argv0);
+       printf("tusage: %s --resetn");
        close(fd);
        exit(-1);
 }
27
Bus Pirate Support / Linux - Bootloader-Programmer
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/A ... 00851b.pdf
More information could be found here:
http://www.microchip.com/Stellent/idcpl ... e=en012031

I 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 [...]
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
Code: [Select]
import serial
ser = serial.Serial('/dev/ttyUSB0', 9600,bytesize=8, parity='N', stopbits=1, timeout=None, xonxoff=0, rtscts=0)

ser.write("x0Fx0Fx00x02xFEx04")

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.
29
Bus Pirate Support / Problems with 1-wire
Hi,

as I already have [s:]spammed[/s:] written in the hackaday comments section http://hackaday.com/2009/07/20/parts-unboxing-the-bus-pirate/ I have some problems with the 1-wire bus.

The search (240) and the read rom macros (51) work quite fine - however if I want to write/read something from the device I receive not the expected values

Code: [Select]
1-WIRE>(240)
1WIRE ROM COMMAND: SEARCH (0xF0)
Found devices at:
Macro 1WIRE address
1.0×2D 0xB7 0xDC 0xEF 0×00 0×00 0×00 0xF9
*DS2431 1K EEPROM
Found 0×01 devices.
The first 10 device IDs are available by MACRO, see (0).

1-WIRE>(85)(1) 0xf0 0×00 0×00 0 1 2 3 4 5 6 7
1WIRE BUS RESET OK
1WIRE WRITE ROM COMMAND: MATCH (0×55) *follow with 64bit address
1WIRE ADDRESS MACRO 1: 0×2D 0xB7 0xDC 0xEF 0×00 0×00 0×00 0xF9
WRITE: 0xF0
WRITE: 0×00
WRITE: 0×00
WRITE: 0×00
WRITE: 0×01
WRITE: 0×02
WRITE: 0×03
WRITE: 0×04
WRITE: 0×05
WRITE: 0×06
WRITE: 0×07

1-WIRE>(85)(1) 0xaa r:3 r:8 R:2 r:2
1WIRE BUS RESET OK
1WIRE WRITE ROM COMMAND: MATCH (0×55) *follow with 64bit address
1WIRE ADDRESS MACRO 1: 0×2D 0xB7 0xDC 0xEF 0×00 0×00 0×00 0xF9
WRITE: 0xAA
BULK READ 0×03 BYTES:
0xFF 0xFF 0xFF # WRONG – should be 0×00 0×00 0×07;
BULK READ 0×08 BYTES:
0xBF 0xE7 0×83 0xFF 0xFF 0xFF 0xFF 0xFF
BULK READ 0×02 BYTES:
0xFF 0xFF
BULK READ 0×02 BYTES:
0xFF 0xFF


I tried it with a 1k and 2.2k and 4.7kohm external pullup, I use the same ds2431 as hackaday
http://hackaday.com/2008/12/24/parts-1k-1-wire-eeprom-ds2431/

Any ideas?

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01612451440session_write_close ( )...(null):0
20.01642583048ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01642583824Database_MySQL->query( ).../DatabaseHandler.php:119
40.06342722576Database_MySQL->error( ).../Db-mysql.class.php:273