I'm using MC9S12A128 and A256 micros with a USB BDM Multilink. I recently moved my Bootloader to a non-sector boundary. I can no longer simply use a sector erase before loading non-bootloader code since this will erase my bootloader. So I can't figure out how to load my non-bootloader code using the BDM without erasing my Bootloader.
I have tried to use the "copymem" command to try to copy the flash values before erasing and then restore them after erasing but the copymem does not seem to be able to copy back to flash. If I could somehow store values into a variable and then write them back to flash that would work.
How can read values into variables using a command script? Any help would be appreciated.