Dangerous Prototypes

Dangerous Prototypes => Bus Pirate Development => Topic started by: ajray on April 21, 2010, 04:49:32 am

Title: pirate-loader.c patch to not require jumper
Post by: ajray on April 21, 2010, 04:49:32 am
Hey all,

I was having trouble earlier using the v4 bootloader to load new firmware, and after posting on the BP Support forum it was suggested that pirate-loader could be modified to send the '$' character to drop the BP into the bootloader.

I had some trouble with this, and I dont understand exactly how/when things are getting written.  I'd like some feedback in the code, its really weird.
It has some delays and debugging print messages, but if I take out any of them it ceases to work.

For long-term use I think there should be a smarter way to do this (possibly another --flag to pirate-loader), but for now this works for me.

~Alex

PS: it is really weird magic.  I'm still trying to figure out why removing the random print messages causes it to fail.

svn diff of pirate-loader.c (from trunk/bootloader-v4/pirate-loader/source/) is attached.
Title: Re: pirate-loader.c patch to not require jumper
Post by: Sjaak on April 21, 2010, 08:47:47 am
.you should  entering the $ on the bp  commandline and see what happens ;)

When removing debug statements breaks things it is either a timing or a bad pointer issue

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