Codewarrior IDE 4.6: Erases all pages automatically

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Codewarrior IDE 4.6: Erases all pages automatically

1,440 Views
lak
Contributor I
Hi all,
 
I am trying to selectively erase flash pages when the IDE loads the program code.
 
I have the entry in the .ini file as NVMAEFSKIPSELECTION=FLASH AEFSKIPERASING  1 2 as I donot want the pages FF , FE (0xC000, 0x8000) to get erased as boot loader resides there.
But still the IDE erases all the pages
 
However, in my boot code, I have used the same option as
NVMAEFSKIPSELECTION=FLASH AEFSKIPERASING  0 3  and this works perfectly fine and does not erase any other page than FF and FE
 
I am using the micro MC9S12XEP100.
 
Is there any other numbering (exp. 3 - ppages) i should follow to get the first case working. please advice
Also, what is the most reliable way of resetting the micro through software.
I tried to enable cop and invalidate it by the following instructions
 
COPCTL = 0x83;
ARMCOP = 0x00;
 
But this is not very consistent and sometimes resets to address FFFF and halts there.
 
with regards,
Lak
Labels (1)
0 Kudos
Reply
2 Replies

521 Views
bottom_down_pro
Contributor II
I notice the OP was about 6 weeks ago and no one has commented on the first (and presumably main) query raised there. If it's any pointer towards a solution, I have exactly the same problem with the PE Micro PROG 12Z programming package, which I use with the BDM Multilink device.

My current project uses a 9S12XDT512, and the intention at the outset was to make a clear distinction between resident firmware and application software. The system is of the type that has extensive firmware, both low-level (direct hardware interface functions) and high-level (TCP/IP stack), which is common to all applications. This can be packaged up as a ROM Library, which is a very useful provision in CW. Actual operating software is 'bespoke', ie each app'n package is prepared for customers individually (quantity per customer typically 500-1000).

This project is my first experience with HCS12X (and HS12 anything), and with Code Warrior. It struck me at the outset that firmware installation would be a separate exercise from application software installation. The production people are keen on this idea too, as the production run of boards can be done and the boards tested with firmware installed, while the software guys are still producing the application package to run on it -- much like an RTOS. The PE Micro set-up, with the PROG 12Z package to handle dowloading to the board, seemed a good approach. I use BDM Multilink for experimenting and development, but we'll probably go for the Cyclone Pro for production.

So that's what we're doing, but like the OP, I cannot make the PROG 12Z programmer erase and re-write the application program code selectively. It insists on erasing everything, including the firmware in page $FF (0xC000 up), even though I select 'Erase Module' in the menu (a 'module' being a downloadable S-record file). The 'Erase Module' menu item seems to mean 'Bulk Erase Flash'.

This is clearly the same problem the OP has experienced. Perhaps my comments might shed some light on the cause, since evidently the same thing happens whether you're using CW IDE, or a separate programming utility.

0 Kudos
Reply

521 Views
kef
Specialist I
Regarding your second question. How do you detect it halts at ffff? Don't forget it's a reset and debugging over reset is not possible. What you see in debugger is not necessarily what happens in MCU, which after reset runs with all breakpoints disabled.
Another way to reset, if you are running in single chip, then just read unimplemented memory. Don't know XE100 memory map, if it's similar to XD512, then read for example global address 0xE0000'G. Of coursen this will work only in normal mode, not when you debug it via BDM in special mode.
0 Kudos
Reply