That was it. I unchecked the configuration bit in export and changed the export range and it works fine now. I tried the generated hex in the output subdirectory but I get the checksum error mentioned above. Haven't figured out why that is but as long as one method works I'm happy Also, as an FYI MPLAB/C30 works pretty well under wine. No real big issues. Thanks for the help!
I tried exporting from 0 to 0xa7fe, 0xa7fd, 0xa4fe, 0xa4fd, etc. No matter what I try it continues to try and erase the page at 0xa800. When I try to bootload the generated busPirate.hex from the compile I get a bootloader error:
Parsing HEX file [busPirate.hex] Checksum does not match, line 4 ...
I have a suspicion this may be related to running MPLAB under wine... although line endings on the hex file look right (x0d x0a) for windows. Would this mess up pirate-loader_lnx in any way? I tried converting the hex file to unix style line endings but that didn't help. I guess I'll try and install MPLAB on my windows box and see if that helps.
I just pulled down the latest source from svn to add support for ISO 7816-3 ATR for async cards (T=0, T=1). The first thing I did was to compile the source (unchanged) using MPLAB and C30. Compilation went fine. I then exported it using the settings: "Program Memory"=checked Start:0 End:0xabfa "Configuration bits"=checked "File format"=INHX32
I then tried using pirate-loader_lnx to flash the resulting hex file. The output I get is:
root@ebuller-linux:/home/ebuller/bus-pirate/the-bus-pirate-read-only/source/output# ./pirate-loader_lnx --dev=/dev/ttyUSB1 --hex=bpv42.hex +++++++++++++++++++++++++++++++++++++++++++ Pirate-Loader for BP with Bootloader v4+ Loader version: 1.0.1 OS: Linux +++++++++++++++++++++++++++++++++++++++++++
Parsing HEX file [bpv42.hex] Found 22016 words (66048 bytes) Fixing bootloader/userprogram jumps Opening serial device /dev/ttyUSB1...OK Configuring serial port settings...OK Sending Hello to the Bootloader...OK
The bootloader on the device is the latest 4.2 bootloader. When I try flashing Ians pre-compiled firmware from v4-nightly it completes fine (stops after writing page 41). Now I'm assuming the bootloader resides in page 42 which is why the bootloader refuses to erase that page. My question is why is my compiled code (with no changes) larger that the stock firmware? I tried adding -O3 as a compile option but that didn't seem to help... Here is the MPLAB mem map: