FP: ALL_PPAGES flash module is bad or protected.

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

FP: ALL_PPAGES flash module is bad or protected.

3,834 Views
JimDon
Senior Contributor III
I have a project that uses flash.
How come I get this error message?
FP: ALL_PPAGES flash module is bad or protected.


As far as I know this is not correct.
Labels (1)
Tags (1)
0 Kudos
9 Replies

782 Views
CrasyCat
Specialist III
Hello
 
- Which CPU are you targeting (HC08, HC12, Coldfire, ..)
- Which version of CodeWarrior are you using?
  To retrieve that info:
    - Start CodeWarrior
    - Select Help -> About Freescale CodeWarrior
    - Click on "Install Products"
    - CodeWarrior version used is displayed on top in the Installed Products dialog.
 
CrasyCat
0 Kudos

782 Views
JimDon
Senior Contributor III
- HCS12 Dx 256/512
- 4.6 Special
0 Kudos

782 Views
CrasyCat
Specialist III
Hello
 
Looks like the FLASH is secured somehow.
can you please try to unsecure the flash?
There is a menu entry to unsecure the flash (in the Multilink menu as far as I remember).
 
Another question are you programming something at address 0xFF0E-0xFF0F in your application?
This is the location where the secure byte is programmed. So do not program it while you are debugging.
 
If neither of the above is helping, can you check the messages written to the command window. Is the debugger reporting a connection problem. 
 
CrasyCat
0 Kudos

782 Views
JimDon
Senior Contributor III
- The flash is not secured. It erases fine and I can burn it with 'noice' no problem.

- There is no problem connecting to the target board. After failing to burn, the ram portion of the porject down loads and runs just fine.

- I'll have to check for 0xFF0E-0xFF0F, but I doubt it. My code is only in page 31 and ram.
0 Kudos

782 Views
J2MEJediMaster
Specialist I
1) Have you tried downloading the latest drivers from the PE Micro web site and installing them? (http://www.pemicro.com/support/download_processor.cfm).

2) Can you build and download any of the example programs that came with the CW installation without difficulty? If so, there's something out of whack with your linker command files.

3) Are you using the standard start-up code file (start12.c), or a custom one that may not configure the page registers properly?

---Tom

Message Edited by J2MEJediMaster on 2007-02-05 10:21 AM

0 Kudos

782 Views
JimDon
Senior Contributor III
>1) Have you tried downloading the latest drivers from the PE Micro web site and installing >them? (http://www.pemicro.com/support/download_processor.cfm).

There were up to date, but I did as you asked anyway. No help.

2) Can you build and download any of the example programs that came with the CW installation without difficulty? If so, there's something out of whack with your linker command files.

Yes, I can. As previously stated, the project builds and runs fine (after I use NOICE to burn the flash part of the code) which CW seems unable to do (burn flash).

3) Are you using the standard start-up code file (start12.c), or a custom one that may not configure the page registers properly?

Actaully, the starup code really has nothing what so ever to do with a far call in the code to execute the routines in flash. Nor does have anything to do with CW burning flash.

In fact the startup code is in ram not flash and there are no vectors involved. After I burn the flash portion of the project using noice, I remove the AUTOERASEANDFLASH so no attempt is made to erase and burn, then CW loads ands runs the ram protion of the code fine. The ram code calls routines in the flash code and that all works. With the AUTOERASEANDFLASH command in the .ini, flash gets erased but when the script trys to program flash, I get the error message which is the title of this thread.

The .s19 file gets generated properly etc. As I said, if I burn the .s19 file with NOICE everything is fine.


Now that we have established that the BDM is 100% functional, the project is correct, any idea why I get that error message.

FP: ALL_PPAGES flash module is bad or protected.

Message Edited by JimDon on 2007-02-0511:46 AM

0 Kudos

782 Views
Lundin
Senior Contributor IV
Perhaps it could have something to do with memory mapping. Are you using another memory map than the default one in CW?

If move EEPROM and RAM around you might get trouble. CW3.1 or later is using a stupid thing called fpp-file. Depending on which device you are using, it will try to upload bootloader/debugger things in the RAM at startup. If it doesn't find RAM where it expects it to be, strange things will happen. In that case you will have to ask Freescale to generate a new fpp-file for you. The moronic thing is that you have to use the same fpp-file and therefore the same memory mapping for all projects using a certain device.
0 Kudos

782 Views
JimDon
Senior Contributor III
Here is my prm file. I moved STARTUP into RAM using MY_PSEUDO_ROM.

I think you could be correct, that CW thinks that it should try and burn RAM. NOICE has tables so that it always "knows" where to burn and where to load just from .s19 file.

I tried relocating startup code using CODE_SEG pragmas, but that didn't work for me.
How do you set set this? Is there any way to define what should be burned and not?

One problem is it seems that only one .text segment is allowed, so if you have code in a given segement, you can't have code in other segments. Is this correct?



/* This is a linker parameter file for the MC9S12DG256 */
NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */
http://forums.freescale.com/freescale/board/post?board.id=CWCOMM&message.reply_to_id=3833#
Submit Post
SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */
// MY_RAM = READ_WRITE 0x1000 TO 0x17FF;
MY_PSEUDO_ROM = READ_ONLY 0x1FD7 TO 0x3BFF;

/* Register space */
/* IO_SEG = PAGED 0x0000 TO 0x03FF; intentionally not defined */

/* EPROM */
EEPROM = READ_ONLY 0x0400 TO 0x0FEF;

/* RAM */
RAM = READ_WRITE 0x1000 TO 0x17ff;

/* non-paged FLASHs */
ROM_4000 = READ_ONLY 0x4000 TO 0x7FFF;
ROM_C000 = READ_ONLY 0xC000 TO 0xFEFF;
/* VECTORS = READ_ONLY 0xFF00 TO 0xFFFF; intentionally not defined: used for VECTOR commands below */
//OSVECTORS = READ_ONLY 0xFF8C TO 0xFFFF; /* OSEK interrupt vectors (use your vector.o) */

/* paged FLASH: 0x8000 TO 0xBFFF; addressed through PPAGE */
PAGE_30 = READ_ONLY 0x308000 TO 0x30BFFF;
// PAGE_31_DATA = READ_ONLY 0x318000 TO 0x31BFFF;
PAGE_31 = READ_ONLY 0x318100 TO 0x31BFFF;
PAGE_32 = READ_ONLY 0x328000 TO 0x32BFFF;
PAGE_33 = READ_ONLY 0x338000 TO 0x33BFFF;
PAGE_34 = READ_ONLY 0x348000 TO 0x34BFFF;
PAGE_35 = READ_ONLY 0x358000 TO 0x35BFFF;
PAGE_36 = READ_ONLY 0x368000 TO 0x36BFFF;
PAGE_37 = READ_ONLY 0x378000 TO 0x37BFFF;
PAGE_38 = READ_ONLY 0x388000 TO 0x38BFFF;
PAGE_39 = READ_ONLY 0x398000 TO 0x39BFFF;
PAGE_3A = READ_ONLY 0x3A8000 TO 0x3ABFFF;
PAGE_3B = READ_ONLY 0x3B8000 TO 0x3BBFFF;
PAGE_3C = READ_ONLY 0x3C8000 TO 0x3CBFFF;
PAGE_3D = READ_ONLY 0x3D8000 TO 0x3DBFFF;
/* PAGE_3E = READ_ONLY 0x3E8000 TO 0x3EBFFF; not used: equivalent to ROM_4000 */
/* PAGE_3F = READ_ONLY 0x3F8000 TO 0x3FBEFF; not used: equivalent to ROM_C000 */
END

PLACEMENT /* here all predefined and user segments are placed into the SEGMENTS defined above. */
_PRESTART, /* Used in HIWARE format: jump to _Startup at the code start */
STARTUP, /* startup data structures */
STRINGS, /* string literals */
VIRTUAL_TABLE_SEGMENT, /* C++ virtual table segment */
//.ostext, /* OSEK */
NON_BANKED, /* runtime routines which must not be banked */
COPY /* copy down information: how to initialize variables */
/* in case you want to use ROM_4000 here as well, make sure
that all files (incl. library files) are compiled with the
option: -OnB=b */
INTO MY_PSEUDO_ROM/*, ROM_4000*/;

// DEFAULT_ROM INTO PAGE_30, PAGE_31, PAGE_32, PAGE_33, PAGE_34, PAGE_35, PAGE_36, PAGE_37,
// PAGE_38, PAGE_39, PAGE_3A, PAGE_3B, PAGE_3C, PAGE_3D ;
ROM_VAR, /* constant variables */
DEFAULT_ROM INTO PAGE_31 ;

//.stackstart, /* eventually used for OSEK kernel awareness: Main-Stack Start */
SSTACK, /* allocate stack first to avoid overwriting variables on overflow */
//.stackend, /* eventually used for OSEK kernel awareness: Main-Stack End */
DEFAULT_RAM INTO RAM;

//.vectors INTO OSVECTORS; /* OSEK */
END

ENTRIES /* keep the following unreferenced variables */
/* OSEK: always allocate the vector table and all dependent objects */
//_vectab OsBuildNumber _OsOrtiStackStart _OsOrtiStart
END

STACKSIZE 0x100

//VECTOR 0 _Startup /* reset vector: this is the default entry point for a C/C++ application. */
//VECTOR 0 Entry /* reset vector: this is the default entry point for an Assembly application. */
//INIT Entry /* for assembly applications: that this is as well the initialization entry point */
0 Kudos

782 Views
CrasyCat
Specialist III
Hello
 
This should work.
There might be a problem in your application or configuration.
Are you remapping the RAM to another address in your startup or reset command file?
 
You need to submit a service request  for that.
 
To log the issue with Freescale please go to following URL:
    http://www.freescale.com/webapp/sps/site/homepage.jsp?nodeId=054670&tid=FSH
and click on "Submit a service request"
Make sure to provide the whole project reproducing the trouble.
To make sure you provide all relevant information to our support personal, you can use the Pack and Go wizard to collect the information.
 
The wizard can be started from Help -> "Pack and Go" in the IDE:
 
CrasyCat
0 Kudos