usb BDM. How to program flash & leave Eeprom as is

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

usb BDM. How to program flash & leave Eeprom as is

Jump to solution
10,533 Views
mDavid
Contributor I
Hello,
I am working on a MC9S12DG128B. We are in the developement phase of the project so we program constanly the chip with the USB multilink from PE.. The problem I have is that we need to keep some information on the chip EEProm. This information is generated buy the code itself so we can not have a S19 file to program each time . It is crutial for the debuging of the code that the memory of the EEprom is not erase each time we program the Chip with the USB multilink.
Is there a setting in codewarrior that can tell the USB multilink BDM not to erase the EEprom memory space when reprogramming the chip.
Thank's for the Help
 
David
Labels (1)
Tags (1)
0 Kudos
1 Solution
3,235 Views
CrasyCat
Specialist III
Hello
 
I assume you are using CW HC12 V4.5. AM I right?
 
There is a command AEFSKIPERASING available allowing you to do that.
 
Extract from {Install}\Release_Notes\HC12\Notes_debugger_icd12.txt:
 
" The new command AEFSKIPERASING has been created to specify non volatile memory blocks
 to protect from mass erasing at application loading.
 The command should be placed in a "Startup" command file.
 The command syntax is:
 FLASH AEFSKIPERASING <blockNo>
 with blockNo = {number["-"number][","]}
 
 For example, "FLASH AEFSKIPERASING 0,2-4" avoids erasing flash blocks 0,2,3,4.
 
 Reminder: Flash (and non volatile memory) modules and numbers can be displayed when
  typing the FLASH command in the Command window. Also the Flash/Non Volatile Memory
  dialog list displays all modules starting from block number 0."
 
So basically do the following:
 - Start the debugger
 - Enter command FLASH
 - Check which is the block number associated with the EEPROM block.
 - Edit your startup.cmd file and add the AEFSKIPERASING command there.
 
I hope this helps.
CrasyCat
 

View solution in original post

0 Kudos
36 Replies
850 Views
Sanahuja
Contributor I
Hello,

Im' trying to do the same thing.
I'm using CW for microcontrollers 6.1 and BDM (DEMOQE board).
I don't have "Advanced programming/Debugging Options" in the Multilink/CyclonePro menu as CrazyCat said.
The only options is "debugging memory map". I tried to change the end address of the flash to keep the datas in uppers address but it is not working.
There is another option "flash" in Multilink/CyclonePro menu, but there I can't change anything.

Do you have an idea?
Thanks.

0 Kudos
850 Views
CrasyCat
Specialist III
Hello
 
I would recommend you to upgrade to CodeWarrior for MCU V6.2.
 
There was an issue with "Advanced programming/Debugging Options" in V6.1.
 
CrasyCat 
0 Kudos
850 Views
Sanahuja
Contributor I
Thanks for your answer CrazyCat. I will try 6.2 as soon as possible, and post here the results.
0 Kudos
850 Views
Sanahuja
Contributor I
Options in 6.2 are exactly the same as in 6.1.
I still don't have "Advanced programming/Debugging Options" in the Multilink/CyclonePro menu.

In the options  "debugging memory map", I can change the flash address (start and end).If tried to put a lower end address (to keep my datas there) but then the debugger can't read addresses upper than the flah end address...

0 Kudos
850 Views
CrasyCat
Specialist III
Hello
 
Are you connected to the board when you try to use the entry?
The menu entry is only available after you have successfully connected to the hardware board.
 
CrasyCat
0 Kudos
850 Views
Sanahuja
Contributor I
Yes I'm connected to the board. After downloading my code, I have the following menu:

In debugging memory map, I tried to add the section TEST:

And in TEST I put:

I tried all options in access kind but it doesn't change anything. When it is not writtable, the program can't write to the memory.

Am I doing something wrong?

0 Kudos
850 Views
stanish
NXP Employee
NXP Employee
Hello Sanahuja,

It seems that the "Advanced programming/Debugging Options" are not available for ColdFire V1 derivatives. I'd suggest you to submit a Service Request to be sure.

Anyway, this workaround might help you:

1) Save EEPROM memory section each time you program the MCU. You can achieve it by adding debugger command "save ..." into *_Preload.cmd command file. This .cmd file is usually located here:

{Project directory}\cmd\CFV1_BDM_P&E_Multilink_CyclonePro_Preload.cmd

// Before load the commands written below will be executed
//SAVE EEPROM
save 0x01FC00..0x01FFFF eeprom.s19


2) In order to restore EEPROM content erased by Mass Erase command flash the "eeprom.s19" file back to the MCU as soon as the application is loaded. This could be done by the sequence of debugger commands below placed into *_Postload.cmd command file. This cmd file is usually located here:
 {Project directory}\cmd\CFV1_BDM_P&E_Multilink_CyclonePro_Postload.cmd

// After load the commands written below will be executed

flash
flash select 0
flash arm
srec eprom.sx
flash disarm
flash unselect
reset


Stanish

0 Kudos
850 Views
stanish
NXP Employee
NXP Employee
Hello,
sorry there is a typo in Postload script.

// After load the commands written below will be executed

flash
flash select 0
flash arm
srec eeprom.s19  // corrected line
flash disarm
flash unselect
reset

Stanish
0 Kudos
850 Views
Sanahuja
Contributor I
Thanks Stanish.
This seems to work very well ! I just have a little problem, because now I can't see the memory while debugging... I may have made a mistake somewhere...


0 Kudos
850 Views
stanish
NXP Employee
NXP Employee
Sanahuja,

I'd suggest you to check settings of the "Debugging Memory Map" options.
Is the memory section you can't see enabled? (Check boxes "Enable memory module (active)" have to be enabled)
I'd recommend you also to enable the check box named "refresh memory when halting". If you then modify any value within your "EEPROM" section of flash the value will be updated in memory view when debugger halts.

If this doesn't help could you possibly describe your issue more in detail (screenshots, etc.)?

Stanish
0 Kudos
850 Views
Sanahuja
Contributor I
You're right Stanish. I forget to put "refresh memory when halting" when I changed.
Thanks for your help!!


Message Edited by Sanahuja on 2008-11-13 12:57 PM
0 Kudos
850 Views
Alban
Senior Contributor II
Gonzalo,
As you demonstrate by showing the file content, this is not Freescale things but
 
Copyright P&E Microcomputer Systems, www.pemicro.com
Freescale does not design P&E Micro software.
 
Regards,
Alban.
0 Kudos
850 Views
GonzaloVictorio
Contributor I
Yes Alban, that file is P&E Micro stuff, but Hiwave.exe is from Freescale and I would've though that Freescale support people can figure out stuff like this because they should know (in my opinion) how their things work. I mean... didn't they know that the debugger calls the FLASH Programming Algorithms from files within the CodeWarrior folder?
0 Kudos
850 Views
peg
Senior Contributor IV
Hi Gonzalo,
 
I presume CrasyCat meant PROGHCS08 and not PROG08SZ.
 
If you don't want to use this from within the Hiwave debugger of CW then you can purchase a standalone version of it from P&E Micro.
 
Regards
Peg
 
0 Kudos
850 Views
bigmac
Specialist III
Hello CrasyCat,
 
Isn't there a problem using PROG08SZ program with a 9S08 device - I thought this utility was applicable to HC08 devices only.
 
Regards,
Mac
 
0 Kudos
850 Views
mDavid
Contributor I
Thank you for the vital information, It did the job. Im using CWH12 3.1 buy the way.
 
Yours truly,
 
David
0 Kudos