Dangerous Prototypes

Dangerous Prototypes => Bus Pirate Development => Topic started by: Sjaak on January 19, 2010, 09:35:23 pm

Title: How to compile the v4+ firmware
Post by: Sjaak on January 19, 2010, 09:35:23 pm
Since the bootloader is different (located at different adresses) the export step is a bit different then described in the wiki (at least what i was using)

I use the export, adresses 0 to 0xA7FF, uncheck the fuses

(is there a way to remember the mplab ide this setting? (since this was the inidirect cause of my brickage)
Title: Re: How to compile the v4+ firmware
Post by: ian on January 20, 2010, 08:01:06 am
That's how I do it. As far as I know, it's the only way. You can use the file output by MPLAB directly, but it still contains config fuses.
Title: Re: How to compile the v4+ firmware
Post by: Sjaak on January 20, 2010, 08:45:40 am
Ok, but there is no way for the export function to remember its settings? Bleh!
Title: Re: How to compile the v4+ firmware
Post by: ian on January 20, 2010, 11:56:03 am
I find it really annoying. Maybe if we take the config bits out of the linker file then they won't be placed in the regular compiled hex (no need for export?)?
Title: Re: How to compile the v4+ firmware
Post by: Sjaak on January 20, 2010, 01:48:25 pm
i hope :) i remember there was such a setting in the project settings. (i'm at work atm no mplab near :() could look it up tonight.

I didn't knew the basic hex would work, except the fuses.
Title: Re: How to compile the v4+ firmware
Post by: Sjaak on January 20, 2010, 07:39:44 pm
I found it!!! whoot whoot!

if you don't declare it in the code (the _CONFIG1(xx) and _CONFIG2(xx) macro's), you can turn it off in the menu: configure, configuration bits, deselect configuration bits in code
Title: Re: How to compile the v4+ firmware
Post by: EGHM on January 28, 2010, 08:54:07 am
Doing a lot of compiling of the firmware yesterday, I got rather tired of doing it all by hand, so today, I created a AutoIt v3 script to automate the process for what I was doing (which is using MPLAB as a compiler and exporter NOT as an editor):

Code: [Select]
Opt("WinTitleMatchMode", 2)

$titleText = "busPirate - MPLAB IDE"

$usage = '4 required paramaters, 1 optional parameter.  Parameters with spaces must be in double quotes.' & @CRLF
$usage = $usage & @CRLF & 'Usage Example: "C:Program FilesAutoIt3AutoIt3.exe"  E:BPSVNscriptsMPLAB.au3'
$usage = $usage & '"C:Program FilesMicrochipMPLAB IDECoreMPLAB.exe" "C:Program FilesMicrochipMPLAB IDECore"'
$usage = $usage & 'E:BPSVNsourceBP.hex 32000 60' & @CRLF & @CRLF
$usage = $usage & '1. fullpath to exe: "C:Program FilesMicrochipMPLAB IDECoreMPLAB.exe"' & @CRLF
$usage = $usage & '2. statup dir: "C:Program FilesMicrochipMPLAB IDECore"' & @CRLF
$usage = $usage & '3. output hex fullpath: E:BPSVNsourceBP.hex' & @CRLF
$usage = $usage & '4. time to wait for build to complete in milliseconds: 32000' & @CRLF
$usage = $usage & '5. option dialog box times in seconds: 60'
If ($CmdLine[0]  < 4) Then
MsgBox(4096, "Usage", $usage)
ConsoleWrite($usage)
EndIf

$msgTimeout = 0;
If ($CmdLine[0] == 5) Then $msgTimeout = $CmdLine[5]

$exe_array = StringRegExp($CmdLine[1], ".*\(.*exe)?", 1)
$wait = Number($CmdLine[4])

Run($CmdLine[1], $CmdLine[2])
WinWaitActive($titleText)
Sleep(1000)
Send("^{F10}",0)
Sleep($wait)
$text = WinGetText ( $titleText , "Output" )
If Not(StringInStr($text, "BUILD SUCCEEDED")) Then
MsgBox(4096, "busPirate build NOT successful.", "busPirate build NOT successful.", $msgTimeout)
Exit
EndIf
Send("!Ft", 0)     ; File - > Export
Sleep(1000)
Send("{TAB}", 0)
Send("{TAB}", 0)
Send("0xa7ff")    ; Program memory end
Send("{TAB}", 0)
Send("{TAB}", 0)
Send("{TAB}", 0)
Send("{SPACE}", 0) ; uncheck Configuration Bits checkbox
Send("{ENTER}", 0); click Ok button
Sleep(1000)
Send($CmdLine[3])
Sleep(1000)
Send("{ENTER}", 0)
Send("{TAB}", 0)  ; Overwrite existing file
Send("{ENTER}", 0); Overwrite existing file
Sleep(5000)
Send("!Fx", 0)     ; File - > Exit
ProcessWaitClose ( $exe_array[0])
MsgBox(64, "AutoIt BP build and export complete", "AutoIt BP build and export complete", $msgTimeout)
Title: Re: How to compile the v4+ firmware
Post by: Sjaak on January 28, 2010, 10:32:27 am
Good tip!

I also found removing the config bits as describes above works equally well (and produces smaller .hex's :))
Title: Re: How to compile the v4+ firmware
Post by: EGHM on January 28, 2010, 08:39:45 pm
Thanks, it was the info on this thread I used for the AutoIt script so it unchecks the configuration box (as well as using the new memory end).   
Title: Re: How to compile the v4+ firmware
Post by: sefee on August 21, 2014, 02:32:55 pm
Hello there,

I have a problem when I want to update my card Sparkfun V3.6.
I use DS30loader, and he said: The hex-file contains code That Will overwrite the bootloader.

Does anyone have a solution?

thank you in advance.
Title: Re: How to compile the v4+ firmware
Post by: tayken on August 24, 2014, 12:03:16 pm
You have to export a certain address range without config bits, did you do that? http://dangerousprototypes.com/docs/Com ... e_firmware (http://dangerousprototypes.com/docs/Compile_the_Bus_Pirate_firmware)
Title: Re: How to compile the v4+ firmware
Post by: sefee on August 26, 2014, 02:45:37 pm
Hello
I changed my PIC.
I loaded the bootloader (BPv3-Bootloader - v4.4.hex) with pickit 3.
I loaded the firmware (BPv3-Firmware - v5.9RC - r556 - MPLABX.hex) with DS30 LOADER by turning the mode with a jumper on PGC and PGD because from my console I cannot configure it to put it in the programming of the firmware mode.
And I still can't a dialogue.
Is that I was not mistaken in the softs?
If someone has a solution because the I loses me.
Thanks in advance
Title: Re: How to compile the v4+ firmware
Post by: tayken on August 26, 2014, 04:10:41 pm
Do you see any LEDs flashing when you type in commands. What about the status of the MODE LED? Also can you post the output of the DS30 loader?

I usually use pirate loader. Can you try that too? http://dangerousprototypes.com/docs/Pir ... Windows%29 (http://dangerousprototypes.com/docs/Pirate-Loader_console_upgrade_application_%28Linux,_Mac,_Windows%29)
Title: Re: How to compile the v4+ firmware
Post by: sefee on August 26, 2014, 04:59:14 pm
I have not yet tried it with pirate loader
When I send the command i on the map, the LED Tx will Flash.
The MODE LED is off view that the dollar command does not work.
So to put me in BOOT mode I strap PGC and PGD with a jumper.

On the DS30 when I do a Check for blank the result is:
Searching for bl.
Found PIC24FJ64GA002 fw ver. 1.0.2

When I download BPv3-Firmware - v5.9RC - r556 - MPLABX.hex here is the result
Initiating download...
      Searching for bl.
      Found PIC24FJ64GA002 fw ver. 1.0.2
      Waiting for bootloader to be ready... ok
      Writing flash... ok
      Download finished
      Tx 51.2 kB  / Rx 301 bytes / 9.8s

Thanks
Title: Re: How to compile the v4+ firmware
Post by: sefee on October 01, 2014, 11:44:29 am
hi,
I just tested program loader with pirate and walked.

thank you TAYKEN

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