Tell debugger to mass erase only 1/2 flash before flashing new program (CW6.2, MCF51AC)

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Tell debugger to mass erase only 1/2 flash before flashing new program (CW6.2, MCF51AC)

ソリューションへジャンプ
5,497件の閲覧回数
Kopone
Contributor IV

Hi,

 

I am using the CW that came with the ACDEMO board, which is CW6.2 afaik, with the AC256 CPU.

 

Is it possible to somehow have the debugger mass erase only 50% (or any other fraction) of the 256k flash  memory in a MCF51AC256 before the new program code is then sent to the flash (which is only < 64k anyways).

Reason is, I flash a seperate .S19 file into the upper flash regions (containing data tables) and it doesnt really work that well when doing it via the postload.cmd because of delays, timeout issues and what have you. So I'd like to save the hazzle for only those moments when I really change anything within these data tables.

 

So if the debugger could just leave the upper e.g. 128k untouched when flashing new code, that would be a great relief. Any chance?

 

Regards,

 Sven

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
2,795件の閲覧回数
J2MEJediMaster
Specialist I

Please check out FAQ-28898 and FAQ-28563 for HCS12-specific information on how to selectively erase portions of flash memory.

 

---Tom

 

Message Edited by J2MEJediMaster on 2009-11-30 10:13 AM
Message Edited by J2MEJediMaster on 2009-11-30 10:15 AM

元の投稿で解決策を見る

0 件の賞賛
返信
8 返答(返信)
2,795件の閲覧回数
rocco
Senior Contributor II

Hi Sven and Alan,

 

We are having the same problem on an M9S08GB60 and an OSBDM. Our program code is in an .abs file, and resides below address 0x8000. Above that address we need to load an .s19 file, which is DSP code.

 

We can't seem to load one without erasing the other. The same architecture works fine on a MMEVS system with an older version of Hiwave, but not with the OSBDM.

 

We submitted a service request, but it's been sitting "unassigned".

 

mark

0 件の賞賛
返信
2,795件の閲覧回数
abartky
Contributor IV

Mark,

 

For your case, I believe that the Advanced Programming options will not be available as this is actually controlled by the burning software provided by P&E Micro which is executed from the Freescale debugger.  So for OSBDM, it is whatever their burner/driver can support.

 

The preserve options are in the .ini file that is loaded as arguments to the prog\hiwave.exe program and the .ini file is specified in the External Debugger settings under the Target Settings Panel under Build Extras.

 

I don't have an OSBDM myself so I probably can't help you there.

 

Maybe someone else who on the forum has an OSBDM and has gotten this to work (if it is possible) can chime in.

 

Alan

0 件の賞賛
返信
2,795件の閲覧回数
rocco
Senior Contributor II

Hi Sven and Alan.

 

My problem was resolved through a service-request.

 

It seems that the solution to this type of problem depends not only on whether it is S08 or S12, and which variant it is, but also what BDM adapter you use. The solution for a P&E BDM is not the same as the solution for a OSBDM.

 

In my case, I have to manually issue a command "flash aefskiperasing" in Hiwave to tell it to not automatically erase the flash memory prior to programming. I then need to manually erase the flash, and then program each of my .s19 files.

 

A little tedious, but it does work.

 

Thanks everybody for your help.

mark

0 件の賞賛
返信
2,796件の閲覧回数
J2MEJediMaster
Specialist I

Please check out FAQ-28898 and FAQ-28563 for HCS12-specific information on how to selectively erase portions of flash memory.

 

---Tom

 

Message Edited by J2MEJediMaster on 2009-11-30 10:13 AM
Message Edited by J2MEJediMaster on 2009-11-30 10:15 AM
0 件の賞賛
返信
2,795件の閲覧回数
Kopone
Contributor IV

Thanks Alan, thanks Tom, this looks like it's gonna solve all of my problems:-D

 

Regards,

 Sven

0 件の賞賛
返信
2,795件の閲覧回数
abartky
Contributor IV

Sven,

 

I'm pretty sure this is already addressed somewhere else in the forum, but to save you from hunting for it, here's how to do it.

 

You can protect addresses in the Real-Time Debugger.

 

Setup your BDM and target and select MultiCyclonePro->Connect

 

No go back to MultiCyclonePro and select MultiCyclonePro->Advanced Programming/Debug Options...

 

A new pop-up window "Advanced Options" will appear. 

 

Under Non-Volatile Memory Preservation, select "Preserve this Range (Memory Range 1) and enter From: $0000E000 To: $0000FFFF to preserve the entire 128K of upper Flash space.

 

Note however that if you are using any interrupts, you have to let the Flash burning program access to address FFC0 to FFFF.  There are also non-volatile registers from FFB0 to FFBF.  So in that case the "To:" value should be $0000FFAF (which would give you most of the 128K except for the interrupt vector table and non-volatile registers).

 

In setting this option, every time you "burn" the flash, it will preserve the range(s) that you set in this menu.

 

Hope this helps,

 

Best regards,

 

Alan

0 件の賞賛
返信
2,795件の閲覧回数
Kopone
Contributor IV

Hi Alan,

 

first of all thank you very much for your assistance. Yes, the topic is probably already covered somewhere else, but it seems I just can't find the appropriate search terms.

 

Well, I tried what you said, but I am either too blind, dumb or maybe we are talking about different software here. The thing is, my menu has no "Advanced Programming/Debug Options" entry. Here's the menu:

 

 

I tried to define two memory partitions (0x0000 0000 - 0x0001 FFFF for the lower 128k and 0x0002 0000 - 0x0003 FFFF for the upper) in the "Debugging Memory Map" dialog. Usually I would only find one region here, called FLASH, spaning the range from 0 to 0x3ffff. I changed this to these settings:

 

 

I also found that the only place where I can define regions to be erased before flashing, seems to be the "File->Configuration->Load" dialog, but my defined regions wont appear there, it sticks with the single FLASH partition:

 

 

 

 

 

What's more, the "MultiCyclonePro -> Flash..." menu entry brings up this dialog and I assume that the memory partitions found here are those that can be selected in the Load-config dialog above.

 

 

 

However I can't change these partitions via this dialog. From what I found, I guess that I had to make up a  .fpp file defining the memory partitions to my needs, but taking a look at these files it seems to me that it takes severe knowledge instead of just wild guessing to come up with any changes here.

 

So yeah, maybe I just haven't found the right menu entry yet or I am doing something wrong, so any help is still much appreciated.

 

Thanks again, 

Sven

0 件の賞賛
返信
2,795件の閲覧回数
abartky
Contributor IV

Sven,

 

First let me say that some of my instructions were wrong in that I gave the incorrect ranges for addresses in my response.  For Flash the chip I'm using is the QE32 which has 32K of flash so its max address is 0xFFFF.  In your case, you have a chip with a larger flash space.

 

Anyway, the key to getting it so you can get the Advanced Programming/Debug Options in the drop down menu is you must physically connect to your target via the BDM pod cable etc. from the PC to the target and you then also make sure that you are logically connected from the debug application.  Normally this is done when you select Debug from codewarrior, it automatically pops up the connect window where the software asks if you want to connect, hotsync or abort.  If this is not how you are setup, then you may have it setup where you have to manually do the connect command.  If so, then as I said in my previous post, this is under MultiCyclonePro drop down.

 

The key is if you do not do the logical connect procedure and/or it isn't setup right, then the Advanced Progamming/Debug Options will not display as an option.

 

Also at least for my case (working with the QE32) I've found that you do not want to mess with the Debugging memory map as that is used by the real time debugger to know what areas are RAM, registers, FLASH and invalid memory.  If you change that, it will confuse the debugger.  Also when you select different chip targets, the tool will automatically update that as well.

 

If you still can't get to the GUI Advanced options menu, then your other option is to manually edit the .ini file, but you do have to be careful.  The Advanced Options GUI basically allows you to edit the addresses in a more friendly way, but in general what is does is update the .ini file.

 

The default .ini file that is used for the P&E BDM (at least for my environment QE32, P&E BDM and CodeWarrior 6.2) is the file BDM_P&E_Multilink_CylconePro.ini 

 

In that .ini file is a section that defines microcontroller specific info, including which areas of Flash to "Preserve".  Here are the default values for my configuration of that file for the QE32:

 

[9S08QE32]
PROGRAMMING_ALGORITHM=0
DOTRIM=1
PRESERVE1_START=0
PRESERVE1_END=0
PRESERVE1_ACTIVE=0
PRESERVE2_START=0
PRESERVE2_END=0
PRESERVE2_ACTIVE=0
PRESERVE3_START=0
PRESERVE3_END=0
PRESERVE3_ACTIVE=0
PRESERVE_EEPROM=0
CUSTOM_TRIM=0
NGS_TRIM_OVERRIDE_REFERENCE_FREQUENCY=3125000
ALTERNATIVE_ALGORITHM_PATH=
ALTERNATIVE_ALGORITHM_CHECKBOX=0

 

To preserve flash memory, you can manually enter values for Start and End and also whether it is active or not (1 if active).  Notice how I said "values" and not "addresses" as these values are start and end for each block you want to preserve relative to the start of Flash memory.  The values (at least as filled in by the GUI) are also in decimal, not hex (it may be supported by the tool, but I've not seen any examples).

 

So for example, lets say I wanted to preserve the first 4K of flash on a QE32 (adresses 0x8000-0x8FFF), I would edit the file to keep the preserve address as relative decimal flash offsets start as 0 and end as 4095 as follows:

 

PRESERVE1_START=0
PRESERVE1_END=4095
PRESERVE1_ACTIVE=1

 

You can then either save the file as the same name or alternatetively save it as a different name .ini file.  That way you can load either a full erase option or protect options with different .ini files.  You can also then select which .ini file you default load at debugger tool startup from CodeWarrior IDE by changing the "Arguments" options under the Target Settings Panel Build Options menu.

 

To conclude, and so you don't feel bad, I had similar problems that you are going through getting this to work.  At least for me, the key thing was finding out that I could not get the advanced options without both physically connecting to the target and also performing the logical connect command from the debugger (otherwise the advanced options menu does not even show up in the pull down menu).

 

Hope this helps and best regards,

 

Alan 

0 件の賞賛
返信