A little development automation tip
Hopefully this will be useful to some, and not clutter the forum...
I have automated these steps in the development process (shaves off a couple of seconds):
1. Truncate target program image hex file to prevent overwriting bootloader during programming.
2. Command BP to enter "wait for bootloader client" mode.
I specify a batch file as the MPLAB Custom Build Post-Build Step as follows:
"fullabsolutepathtoPostBuild.bat"
Edit: The Post-Build Step quotes kept disappearing (!) when reopening the workspace, so I edited the .mcp file and enclosed the command with double quotes. Seems to work.
The contents of PostBuild.bat is:
@echo off
echo Cropping hex file to avoid overwriting bootloader...
srec_cat busPirate.hex -Intel -crop 0 0x14ff8 -Output cropped.hex -Intel
echo Commanding BP to wait for bootloader client...
copy "fullabsolutepathtoWaitBootLoader.txt" \.com10:
Note that the Post-Build Step is executed in the project's Output directory.
The contents of WaitBootLoader.txt is:
$ryr
where r = 0x0d
The utility srec_cat is from http://http://srecord.sourceforge.net/
In use, I just hit the BP reset switch (I added one), build the project, press the ds30 Download button, then reset the BP again.
Enjoy.