EmbeddedRelated.com
Forums

Quick Flash Advice

Started by Jonathan Masters February 19, 2006
Hi,
 
I have a system (DP256) under test where the code is located in physical
space from 0x4000-0x7fff and 0xc000-0xffff. The code downloads data int
0x8000-0xBFFF in page 0x3A which it uses to run the system. During the
testing, the data is static, the code is changing as it is being
debugged.
 
I can save a lot of time if the flash in the paged area is not erased
whenever I invoke the debugger. I have spent a couple of hours trying to
figure out the burner documentation in CodeWarrior and am loosing more
time than I would save. Has anyone solve a similar problem - a recent
thread on BootLoaders seems along these lines.
 
Jonathan.
	
	
Jonathan Masters wrote:
> Hi,
>  
> I have a system (DP256) under test where the code is located in physical
> space from 0x4000-0x7fff and 0xc000-0xffff. The code downloads data int
> 0x8000-0xBFFF in page 0x3A which it uses to run the system. During the
> testing, the data is static, the code is changing as it is being
> debugged.
>  
> I can save a lot of time if the flash in the paged area is not erased
> whenever I invoke the debugger. I have spent a couple of hours trying to
> figure out the burner documentation in CodeWarrior and am loosing more
> time than I would save. Has anyone solve a similar problem - a recent
> thread on BootLoaders seems along these lines.
>  
> Jonathan.
>  
> 
> 
> 
> 
> 
> 
>  
Jonathan

Here is how it is done in the EEPROM section..

You need to edit the file P&E_ICD_Startup.cmd which is under the 
Debugger Cmd Files folder in the CW project window. Then you have to 
go into the Hiware Debugger, and find the page that your memory 
segment is in. I can't remember the exact command but I think it was 
invoked from a command window. Once you have the page number you enter 
the following into the P&E_ICD_Startup.cmd file adjusted for your 
area. You should be able to  find this is the doc set; if you can't 
let me know and I will hunt it out on Monday. Not entirely obvious is 
it?!!!

// At startup the commands written below will be executed
FLASH AEFSKIPERASING 0                        // don't erase flash

Regards

Robert Lewis
iMn
	
Hi Jonathan.
	First:
-----

The new command "FLASH 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 "Preload" command file of your
project.
	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.

When used, the "FLASH AEFSKIPERASING" command should be placed in the
"Preload" command file.
	Then:
-----

I will send you directly a new flash driver library (only valid for ICD12 
v6.1.11 and later revisions) that features a clear separation between range 
$4000-7FFF and $C000-FFFF.

The driver lists, for DP256:

    0  EEPROM
    1  FLASH_4000
    2  FLASH_C000
    3  ALL_PPAGES
    4  FLAT8000_P30
	"FLASH AEFSKIPERASING 3" will avoid erasing all PPAGES, but sectors
in 
$4000 and in $C000 will be erased, and eeprom (there is no erasing 
implemented in FLAT8000_P30).

Installation:

-debugger closed.
-in CodeWarrior installation, "prog" folder, rename the
"fpp" folder.
-create a new "fpp" folder and unzip all file I sent you in this
folder.

Regards,
Gilles
	At 04:55 AM 2/19/2006, you wrote:
>Hi,
>
>I have a system (DP256) under test where the code is located in physical
>space from 0x4000-0x7fff and 0xc000-0xffff. The code downloads data int
>0x8000-0xBFFF in page 0x3A which it uses to run the system. During the
>testing, the data is static, the code is changing as it is being
>debugged.
>
>I can save a lot of time if the flash in the paged area is not erased
>whenever I invoke the debugger. I have spent a couple of hours trying to
>figure out the burner documentation in CodeWarrior and am loosing more
>time than I would save. Has anyone solve a similar problem - a recent
>thread on BootLoaders seems along these lines.
>
>Jonathan.
>
>
>
>
>
>
>
>
>Yahoo! Groups Links
>
>
>
>
	
Hi,

As you can see in the "P&E_ICD_Erase_unsecure_hcs12.cmd" debugger 
command file of your codewarrior project there are some statements that 
make mass erase flash

Comment the line "wb 0x102 0x10    // set the WRALL bit in FTSTMOD to 
affect all blocks" in order to
erase only the block 0

But first of all you must ensure that your code is not programmed at 
paged memory out of block 0

This is part of my "P&E_ICD_Erase_unsecure_hcs12.cmd"
//mass erase flash
wb 0x100 CLKDIV  // set FCLKDIV clock divider
wb 0x103 0       // FCFNG select block 0
wb 0x102 0x10    // set the WRALL bit in FTSTMOD to affect all blocks
wb 0x104 0xFF    // FPROT all protection disabled
wb 0x105 0x30    // clear PVIOL and ACCERR in FSTAT register
ww 0x108 0xD000  // write to FADDR address register
ww 0x10A 0x0000  // write to FDATA data register
wb 0x106 0x41    // write MASS ERASE command in FCMD register
wb 0x105 0x80    // clear CBEIF in FSTAT register to execute the command
wait 20          // wait for command to complete

I hope this helps

Jonathan Masters escribi
> Hi,
>
> I have a system (DP256) under test where the code is located in physical
> space from 0x4000-0x7fff and 0xc000-0xffff. The code downloads data int
> 0x8000-0xBFFF in page 0x3A which it uses to run the system. During the
> testing, the data is static, the code is changing as it is being
> debugged.
>
> I can save a lot of time if the flash in the paged area is not erased
> whenever I invoke the debugger. I have spent a couple of hours trying to
> figure out the burner documentation in CodeWarrior and am loosing more
> time than I would save. Has anyone solve a similar problem - a recent
> thread on BootLoaders seems along these lines.
>
> Jonathan.
>
>
>
> 
>
>
>
> SPONSORED LINKS
> Microcontrollers 
>
<http://groups.yahoo.com/gads?t=ms&k=Microcontrollers&w1=Microcontrollers&w2=Technical+support&w3=Intel+microprocessors&w4=Pic+microcontrollers&c=4&s&.sig=q-PdRfkxidENbzuw47QXfA>

> 	Technical support 
>
<http://groups.yahoo.com/gads?t=ms&k=Technical+support&w1=Microcontrollers&w2=Technical+support&w3=Intel+microprocessors&w4=Pic+microcontrollers&c=4&s&.sig=nHWQ5UhrHVhjHBmJ-PV5Gg>

> 	Intel microprocessors 
>
<http://groups.yahoo.com/gads?t=ms&k=Intel+microprocessors&w1=Microcontrollers&w2=Technical+support&w3=Intel+microprocessors&w4=Pic+microcontrollers&c=4&s&.sig=oK28VUt7GmzAuSiQ2LOclQ>

>
> Pic microcontrollers 
>
<http://groups.yahoo.com/gads?t=ms&k=Pic+microcontrollers&w1=Microcontrollers&w2=Technical+support&w3=Intel+microprocessors&w4=Pic+microcontrollers&c=4&s&.sig=2wsTvt1KStqtPr3fLb1rqw>

>
>
>
> 
> >.
>
>
> 
>

-- 
------------
Agustin Pedroso Rizaldos
Software Engineer
R&D deparment
SEDECAL, S.A.
Tel. (+34)91 628 92 35
Fax. (+34)91 628 05 74
C/ Pelaya 9
Polono Ind. "Rio de Janeiro"
28110 Algete (Madrid)- Espa
-----------
	
Thanks Gilles.
 
Jonathan.
 
-----Original Message-----
From: 68HC12@68HC... [mailto:68HC12@68HC...] On Behalf
Of Gilles Blanquin
Sent: Monday, 20 February 2006 9:38 PM
To: 68HC12@68HC...
Subject: Re: [68HC12] Quick Flash Advice
 
Hi Jonathan.
	First:
-----

The new command "FLASH 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 "Preload" command file of your
project.
	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.

When used, the "FLASH AEFSKIPERASING" command should be placed in the
"Preload" command file.
	Then:
-----

I will send you directly a new flash driver library (only valid for
ICD12 
v6.1.11 and later revisions) that features a clear separation between
range 
$4000-7FFF and $C000-FFFF.

The driver lists, for DP256:

    0  EEPROM
    1  FLASH_4000
    2  FLASH_C000
    3  ALL_PPAGES
    4  FLAT8000_P30
	"FLASH AEFSKIPERASING 3" will avoid erasing all PPAGES, but sectors
in 
$4000 and in $C000 will be erased, and eeprom (there is no erasing 
implemented in FLAT8000_P30).

Installation:

-debugger closed.
-in CodeWarrior installation, "prog" folder, rename the
"fpp" folder.
-create a new "fpp" folder and unzip all file I sent you in this
folder.

Regards,
Gilles
	At 04:55 AM 2/19/2006, you wrote:
>Hi,
>
>I have a system (DP256) under test where the code is located in
physical
>space from 0x4000-0x7fff and 0xc000-0xffff. The
code downloads data int
>0x8000-0xBFFF in page 0x3A which it uses to run the system. During the
>testing, the data is static, the code is changing as it is being
>debugged.
>
>I can save a lot of time if the flash in the paged area is not erased
>whenever I invoke the debugger. I have spent a couple of hours trying
to
>figure out the burner documentation in CodeWarrior
and am loosing more
>time than I would save. Has anyone solve a similar problem - a recent
>thread on BootLoaders seems along these lines.
>
>Jonathan.
>
>
>
>
>
>
>
>
>>  Terms of Service. 
 
  _____