Configuring the P&E BDM to erase specific Flash sectors on HCS08GT60

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

Configuring the P&E BDM to erase specific Flash sectors on HCS08GT60

3,628 Views
alex_spotw
Contributor III
Hi:

I would like to know if there is a way to configure the P&E BMD USB Multilink to not erase all Flash Memory, but only parts of it.

I have an application that stores some information in some Flash Memory pages, but every time the MCU is reprogrammed, the information is erased.

Checking the Expert Mode Programmer, it is possible to see that there are some options to program byte ranges, but they seem to be disabled.

Thank you!

Alex.
Labels (1)
0 Kudos
5 Replies

669 Views
Francois
Contributor I

Hello,

I take this old subject, here is what I do and my question :

I use DZ32 and cv10.3

1) in debug mode, with cyclone pro, there is an option to preserve a specific range in Debug, Connection, advance settings

2) for programming (generating the sap file), i remove manually the address corresponding of data flash in the .sx file

for the sap generator configuration, I don't rase the whole chip but only all the segments of code data

(40 or more lines with the ES command) and then program the chip

Cyclone pro is slightly slower and indicates user function 2 and go on for programming.

My question is :

The software uses addresses in the data flash, I have to declare it but

Is there a way that the values of the data flash do not appear in the .sx file ?

(no lines with address 1600 and so on)

Best regards

fran cois

0 Kudos

669 Views
alex_spotw
Contributor III
P&E FAQ Website has a solution:

Question
I would like to preserve some data in my flash. However, when I erase the module I lose this data. What can I do?

Answer
Most P&E programming algorithms give you the option of erasing the whole flash module with one command-- "EM". This is highly advantageous because the erase time is so fast. However, a problem can arise when the user wishes to preserve data stored within the flash area. The following steps can be used to preserve any number of flash data ranges: 1) Use the UR- Upload Range command to read out your FLASH/EEPROM data. This command will save the Data as an .S19 on your harddrive. You can repeat this procedure for all the ranges that contain data you would like to preserve. 2) Do the EM- Erase Module 3) Do PM- Program Module for your main .S19 4) Do PM- Program Module for all the .S19s you uploaded in step 1. This procedure can be greatly simplified by using CPROG, which is the command line (script based) version of the programming software. This would allow you to perform all these steps with one mouseclick (after initial configuration).


Any other ideas?

Regards,

Alex
0 Kudos

669 Views
skip
Contributor I
I just ran into the same problem, but wanted to preserve flash within the project so other developers could do the same without changing any files on their systems.  This is a round about way to do it, but it works pretty well for our purposes:
 
Changes to Project files:
1.  In the PRM file, set aside a part of RAM:  STORAGE_RAM = READ_WRITE 0x0E00 TO 0x0E7F;
2.  In the PRM file, set aside a part of Flash: SAVE_DATA_ROM =  READ_ONLY    0x1080 TO 0x17FF;
3.  In the Preload.cmd file, add the following:  SAVE 0x0E00..0x0E7F XBEE_FLASH_DATA.S19
4.  In the Postload.cmd file, add the following:  SREC XBEE_FLASH_DATA.S19
 
So far what we have is duplicate data in the flash and RAM.  The only purpose for the RAM object is when you program, the data will be saved to a S19 file, the chip will be erased (RAM and Flash) and then the data will be re-written back into RAM.  It would be nice to do this directly to Flash, but unfortunately it does not work with flash.
 
Note:  In my data structure that has all the data to be stored, I have an initialzed byte that needs to be set to a predefined value (I use 0x24). 
 
In your code, do the following:
 
1.  In the code, create two pointers to your stored data structures; RAM and Flash.
2.  If the RAM has been initialized (0x24) and the flash has not been initialized (not 0x24), you know that you just programmed the chip.  Now you can program your data into flash from your RAM object.
 
Hope this helps!
0 Kudos

669 Views
jeremie_appy
Contributor I
I'm sorry, but I need to do exactly the same application with my GT60.
 
I do not really understand how you do to reprogram the Flash after a flash erasing and a flash programming with the postload..
I can save my flash data block with the preload in a file but I cannot program my Flash memory.
 
If you can help me, Thanks you
 
Regards,
0 Kudos

669 Views
alex_spotw
Contributor III
Thanks! I'll give it a try.

I understand that there are some other ways using a Cyclone Pro, but I haven't investigate them yet.

Regards,

Alex
0 Kudos