Partitioning D-Flash MC9S12XE

Discussion created by timcuff on Jun 8, 2012
Latest reply on Jul 6, 2012 by Szymon Mroczek

I am having trouble with D-Flash on a  mc9s12xeq512caa .


I have a manufacturer build up the board, load an initial program (with a boot loader), test the boards and then pot the boards.


The bootloader is responsible to partition D-Flash the first time the board runs.


The bootloader code is robust and has been proven to function on other similar hardware designs (similar because they also use the 9s12xe.


I am getting a mix of board from the manufacturer that have had d-flash properly partitioned and some that seem to have incorrect partitioning.


When a board has had its d-flash properly partitioned, I can enable RAM emulation, and the d-flash/ram emulation works as I expect it to.


Boards that are not working cannot enable RAM emulation and do not retain their values through a power-cycle.


I am conjecturing it is a problem with partitioning because when I executed a d-flash query, DFPART = 0xffff and ERPART = 0xFFFF .  


If I detect that DFPART and ERPART both equal 0xffff, I attempted to issue the partition command (0x20).  This command indicates a failure - it returns with a status of 3 (MSGSTAT1 and MSGSTAT0 both equal 0).


I have examined the contents of D-Flash, and it looks like it's all 0xffff 's .


I am not running with a debugger connected.


My questions are :


1. Are there any suggestions on how to diagnose faults or errors associated with d-flash?


2. Is there a way, using software, to reset the board to a factory default state so I can attempt to issue the partition commands with the hardware in the factory default state?  (the boards are potted, so there is no way to connect a debugger).