@alexdresko - Funny you should mention :) I could use some PC side help on this (and several other) Bus Pirate projects. Keep reading ;)
@Sjaak - I don't know any ASM either, not a drop. I'm feeling my way in the dark, but it's all pretty straight forward.
I actually sat down and read the memory section of the datasheet last night, now I feel like an expert (or more confused than ever). (EDIT: it was more confused than ever, not expert :p). Actually the smallest erase block is 512 (0x200) words (1592bytes, FTIW). The bootloader is supposed to go in the next-to-last block. The 64ga002 has 0xac00 words of memory, so it should be located at 0xa800. Instead, it's located at 0xa400. I was wrong about this. Each address counter unit is 2, so a full page is 0x400 (1024) ACU, not 0x200 (512) like I had assumed. Looking at line 142 of de30Loader.s, there's this:
.equ STARTADDR, ( FLASHSIZE - 2 * (PAGESIZE * 2) ) /*place bootloader in 2nd last program page*/
That clearly locates it 4 pages from the end. It's actually the next-to-last page with the ACU conversion. We still need to change it to save to the last page though:
.equ STARTADDR, ( FLASHSIZE - (2*(PAGESIZE * 1)) ) /*place bootloader in last program page*/
I believe the strategy is to place BL one page from the end so the config bits page is still erasable. I never plan to renew the config bits, so this shouldn't be a problem. The ds30loader doesn't do config bits except in advanced mode (not sure of this).
Now, here's the problem: since the software does all the sanity checks (the firmware does have a CRC check to prevent accidental runaway programming on an error), it also has this fourthsecond-page-from-the-end location hard-coded. In advanced mode you can check a box that allows overwriting of the bootloader, in our case it wouldn't be the actual bootloader, just this blank memory space. It would be great if we could enter the bootloader location in the ds30loader configuration .xml.
I got the newer version, I'll start working with that, but it does have the same problem. I've been in contact with the author, so I'm going to write him now and see what his thoughts are on the matter. Maybe I'm missing something really simple.