John Passaniti

"Error 18" from CPROGHCS08 (Programming QE96 part.)

Discussion created by John Passaniti on Aug 13, 2010
Latest reply on Aug 15, 2010 by kef

My target is a QE96.  I've written an application for it using CodeWarrior's small memory model (so there is no banking).  Until recently, I've had zero problems compiling, linking, and programming the target. Please read that last sentence again.


Things started to go wrong when I needed to change the layout of objects in memory.  Specifically, my program crossed the 0x7FFF boundary and is now in the 0x8000 to 0xBFFF window.  And to be specific, I have placed a data structure at the end of that window (at 0xBF80).   The problem is during programming.  When it tries to write the data structure I placed at 0xBF80, it gives me an "Error 18" and notes the address.


I am not having any problems compiling or linking my code.  When I inspect the memory map and the resulting S19 file, it is *exactly* what I want (and expect).  The only thing that isn't working here is programming.  Please read this paragraph again.


I contacted P&E Micro, but the response I received doesn't match Freescale's data sheet for the QE96.  The representative claimed that it doesn't matter that I'm using the small memory model; he claims that the window between 0x8000 to 0xBFFF is set to the first bank.  Well, no.  Freescale's datasheet says that the PPAGE register is reset to 2 after every reset, which to me means that if nothing touches the MMU, the entire CPU address space between 0x0000 and 0xFFFF is simply the first four banks of flash (minus RAM, periphrials, and reserved areas).


So my questions:


1.  Can someone with experience with the QE family confirm that the part works as described above (and in the datasheet)?  Specifically, that if PPAGE is never touched, then 0x8000 to 0xBFFF is the third page (page #2) of flash?


2.  Can someone with experience using P&E Micro's USB Multilink Interface tell me if you've had any problems locating objects in the 0x8000 to 0xBFFF window, and if so, how you resolved them?