Wayne,
I should correct you a bit. I agree with you warning "don't read the flash while burning it". But I don't agree with the details. S12 flash is not readable while it's being programmed/erased/blank checked etc. It's not only not readable to you via BDM but also not readable to the CPU that may keep fetching instructions from "disconnected" memory. No wonder it will runaway immediately.
Refreshing the memory window doesn't matter. Reading flash locations being programmed isn't illegal but just doesn't make sense.
Single stepping or putting the breakpoint immediately past the "clear the command buffer is empty flag" can make you fealing that it's OK to run program/erase routine from the same bank of flash. This works because CPU gets stopped for long enough to complete flash command.
Hollaborst,
I'm not familiar with 56xxx but I scaned it's docs and 56xxx memory looks very similar to S12. I didn't find the warning about "not readable while being programmed" flash but I guess that it should be there. I would try to move your whole flash erase/program routine, or at least this piece of code
// launch command
FM_USTAT |= B7_SET;
while ((FM_USTAT & B6_SET) == 0)
{
}
to the RAM.
Sorry for bad English