The S08 manual doesn't seem to contain any BDC command to erase the flash. Every time I need to write something through the BKGD pin onto the S08, I need to erase the flash through the BDM port. I believe if the BDC protocol can exist independently, it should also able to erase the FLASH via a command sequence too right?
Any help would be grateful
The datasheet for the HCS08 controllers has the information and sequence spelled out in the FLASH memory section of the document (for example, reference MC9S08AC60 datasheet Page 52). To write those registers and flash memory locations using Background Debug Mode connection, reference AN3335 document that explains the commands available, which will have read and write commands to use with the appropriate flash controller reg addresses to erase the flash blocks. Depending on your device, you may have to erase multiple blocks separately, I think.
Hi, Thanks a lot! That actually helped. I'll go ahead with the sequence now. Hope it works