Dangerous Prototypes

Other projects => Past projects => Web platform => Topic started by: JimNarem on July 18, 2011, 09:34:25 pm

Title: using pirate-loader with the web platform?
Post by: JimNarem on July 18, 2011, 09:34:25 pm
Has anyone hacked up the linux BP tool pirate-loader to upload firmware for the
web platform?  It seems like a vast overkill to install mono just to run the ds30 GUI;
all it's really doing is shoving a HEX file across a serial port.  Clearly pirate-loader
has been hand-hacked specifically for the BP, but isn't the protocol the same?

When pirate-loader is pointed at the web platform and run it says:

Code: [Select]
compute% pirate-loader --dev=/dev/webplatform --hello
+++++++++++++++++++++++++++++++++++++++++++
+ Pirate-Loader for BP with Bootloader v4 +
+++++++++++++++++++++++++++++++++++++++++++

Opening serial device /dev/webplatform...OK
Configuring serial port settings...OK
Sending Hello to the Bootloader...OK

Device ID: UNKNOWN [ab]
Bootloader version: 1,02
Unsupported device (ab:UNKNOWN), only 0xD4 PIC24FJ64GA002 is supported

After a quick look at the pirate-loader.c code, it looks like some careful crafting of the
defines might make it work but I'm an AVR dude and know nothing about PICs.
Title: Re: using pirate-loader with the web platform?
Post by: ian on July 19, 2011, 02:14:41 pm
Hi Jim,

I think you're right, it probably could be updated.

The key variables would be the ID, flash size, and the number of bytes that are sent in each packet.

.ifdef __33FJ128GP204
   .include   "p33FJ128GP204.inc"
   .equ      VALID_DEV, 1
   .equ      FLASHSIZE,   0x15800
   .equ      HAS_UART2,   1
   .equ      DEVICEID,   171
   .equ      HAS_PPS,   1
.endif

Looks like only ID (171) and flashsize (0x15800) differ.
Title: Re: using pirate-loader with the web platform?
Post by: ian on July 19, 2011, 02:16:26 pm
actually though - the flash config bit location is different, so be careful or you could overwrite that region. In Bus pIrate it is last page, in web platform it is next to last page.

The bootloader author did a bunch of crazy stuff with it, maybe there is more info here:
http://dangerousprototypes.com/2010/02/ ... er-hacking (http://dangerousprototypes.com/2010/02/16/web-platform-bootloader-hacking)

( ! ) 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.00952058984session_write_close ( )...(null):0
20.00982190576ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.00982191352Database_MySQL->query( ).../DatabaseHandler.php:119
40.05522330088Database_MySQL->error( ).../Db-mysql.class.php:273