Re: Compiling Bus Pirate firmware
Reply #1 –
-- 1) When you said, "I recommend you use the hex-file that is outputted by the C30 tool chain.
Do not use MPLAB export unless you have a good reason to" -- what's the process of "activating" or using the C30 tool chain? Is this just building/compiling the project? I noticed that a .hex file is made even before I manually do "export"--however, I think it is too big so that when I try to bootload with the DS30 Loader, it tells me that I'm going to overwrite the bootloader.. (in "export," the Pirate Bus manual suggests changing the size of the .hex file and also to unselect "configuration bits"... how would you do the equivalent with the C30 tool chain??)
The toolchain is just the collection of programs you use to compile the firmware.
He's saying just use the .hex MPLAB makes instead of exporting a specific memory range (my instructions on the wiki). I always follow the wiki procedure, but I think Sjaak has it hooked up to work with the generated .hex file.
-- 2) You also asked if my hardware is set up correctly (in relevance to my second question from my previous email).
So with the BPv3-Firmware-v4.1.hex that I found available on the Pirate Bus website as is, all I have to do with it is bootload it with the DS30 Loader, reset (plug/unplug), open Terminal, and then Terminal responds and displays stuff properly with commands.
so I think the error might be in the MPLAB/compiling/.hex-ing steps that I do pre-bootloading or maybe there's something else in code that would make BPv3-Firmware-v4.1.hex different somehow from the .hex that I make out of the .c/.h projects.
I'm just not sure what.
I would guess it's a problem with your compile or export steps. Could be a compiler difference, but I kind of doubt it. Do you have any optimization enabled for the build? That will make it fail. Have you changed any of the project settings and locations from the source code download defaults?
-- 3) When you said, "I'd guess you don't have the correct versions of the hardware set in base.h"--I do recall that instructions somewhere said that I had to go into base.h to change the versions and such... but I never found where I'm supposed to do that?
There isn't any "hardware version" indication in base.h.. Is there any more specific place I'm supposed to change with the versions I have now?
There is a line here:
http://code.google.com/p/the-bus-pirate ... /base.h#20
like this:
//this sets the hardware version
//#define BUSPIRATEV0A //http://hackaday.com/2008/11/19/how-to-the-bus-pirate-universal-serial-interface/
//#define BUSPIRATEV2A
//#define BUSPIRATEV25 //AKA Bus Pirate v2go
//#define BUSPIRATEV1A //http://hackaday.com/2009/01/22/how-to-bus-pirate-v1-improved-universal-serial-interface/
#define BUSPIRATEV3
Looks to be v3 by default in v4.3 source.
And also, would the 4.1 versions be ok as a jumping board off into my own project and coding, or are there things I need to watch out for with them?
Sure, probably better than using v5. v5 has some funky additions.