How can i definition a const var in Banked Flash memory?

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

How can i definition a const var in Banked Flash memory?

1,338 Views
xiaoli
Contributor I

in prm file,

PAGE_38 = READ_ONLY 0x3880000 To 0x388FFF;

 

PLACEMENT:

constSec INTO PAGE_38;

 

Source Code:

constSec: SECTION

     FDB     $1234

     FCB     $55

 

Question:

     Why at CSW,  I can't see memory at addr 0x3880000, the value must be 0x123455.

 

Thank for your answer.

Labels (1)
0 Kudos
Reply
7 Replies

1,053 Views
trytohelp
NXP Employee
NXP Employee

Hi,

Probably you're using CW for HC12 v5.1.

I've create a short example using the simulator and it seems to be working on my side.

Extract of the map file:

*********************************************************************************************

SECTION-ALLOCATION SECTION

Section Name                    Size  Type    From      To      Segment

---------------------------------------------------------------------------------------------

.init                            11    R    0xC000    0xC00A  ROM_C000

.startData                        10    R    0xC00B    0xC014  ROM_C000

.copy                              2    R    0xC015    0xC016  ROM_C000

.text                            56    R  0x208000  0x208037  PAGE_20

constSec                        102    R  0x388000  0x388065  PAGE_38

.stack                          256  R/W      0x800      0x8FF  RAM

Attached you will find the example.

Have a great day,
Pascal
NXP Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,053 Views
xiaoli
Contributor I

i have my own project.  can you help?

My project is try to get a value from addr ppage = 0x38

more detial::::pleas kick. Flash Problem

0 Kudos
Reply

1,053 Views
trytohelp
NXP Employee
NXP Employee

Hi,

In your asm file you defined:

    EEPROM_DATA: SECTION

    DEFAULT_4000:    SECTION

    DEFAULT_C000:    SECTION

    OTHER_ROM: SECTION

In prm file there are:

      DEFAULT_4000 and DEFAULT_C000

                        INTO  ROM_4000,ROM_C000;                        /* ROM_4000*/

      OTHER_ROM              INTO  PAGE_38, PAGE_39, PAGE_3A, PAGE_3B, PAGE_3C, PAGE_3D;

    EEPROM_DATA            INTO    EEPROM;

Extract of the map file:

*********************************************************************************************

SECTION-ALLOCATION SECTION

Section Name                    Size  Type    From      To      Segment

---------------------------------------------------------------------------------------------

.init                            35    R    0x4000    0x4022  ROM_4000

.startData                        14    R    0x4023    0x4030  ROM_4000

.text                            18    R    0x4031    0x4042  ROM_4000

DEFAULT_4000                      17    R    0x4043    0x4053  ROM_4000

.copy                              2    R    0x4054    0x4055  ROM_4000

OTHER_ROM                        21    R  0x388000  0x388014  PAGE_38

....

memzero                           388000 C 12 2  OTHER_ROM
here3                             38800C 6 6 0  OTHER_ROM
VAR00004                           388012 2 2 0  OTHER_ROM
VAR00005                           388014 1 1 0  OTHER_ROM

The page 0x38 is used.

This is the debugger launched in simulator mode:

pastedImage_7.png

      
Have a great day,
Pascal
NXP Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,053 Views
xiaoli
Contributor I

Thanks for your answer.

i have try ,and let the debugger launched in simulator mode. The result is the same as what you said.

But the same project, the debugger launched in "debug" mode, The result is the same as what i said before. There is nothing(even have,just 0xFFFF) ad addr page0x38. so, That's the point.

so, What can i do,  i need to into debug mode, and get the right value what i wanted, the right value as the debuger show.

waiting for your answer.

Thank you again.

0 Kudos
Reply

1,053 Views
trytohelp
NXP Employee
NXP Employee

Hi,

I've a 9s12DP512 device and P&E USBMultilink interface.

Using your project, I selected the P&E USB BDM Multilink and build the project.

After that I launched the debugger and select my device ... it's working fine.

Please have a look to the video attached.


Have a great day,
Pascal
NXP Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,053 Views
xiaoli
Contributor I

Dear Pascal Irrle:

      i have read the *.mp4, Thank you very much. But my project it's truly have problem. and i check the cmd window.

There is a Red line like this:

FP: All_PPAGES flash module is bad or protected.

executing .\cmd\P&E_Multilink_CyclonePro_vppoff.cmd.

and maybe that's the problem.

and i have try another project in the same hardware, there havn't this red line. So, did you know how can i fixed this?

Thank's a lot.

and i have Baidu, someone has the same problem like :see http://bbs.eeworld.com.cn/thread-323665-1-1.html .

so, can you help?

0 Kudos
Reply

1,053 Views
trytohelp
NXP Employee
NXP Employee

Hi,

Unfortunately I don't have a DP256 device.

Now if I select the DP256 device (MCUID 0x3c6), I got similar error with my DP512 device.

********************************************************************

Loading Target ...

IO registers loaded for MC9S12DP256 from E:\Freescale\CWS12v5.1\prog\REG\MCU03C6.REG

USB HCS08/HCS12 MULTILINK detected - Flash Version 5.84

executing .\cmd\P&E_Multilink_USB_startup.cmd

!// At startup the commands written below will be executed

Target Ready

done .\cmd\P&E_Multilink_USB_startup.cmd

Startup command file correctly executed.

executing .\cmd\P&E_Multilink_USB_preload.cmd

!// Before load the commands written below will be executed

done .\cmd\P&E_Multilink_USB_preload.cmd

Preload command file correctly executed.

FP: FLASH parameters loaded for MC9S12DP256B_V11(NVMIF2 rev 2,3,3,3,2) from E:\Freescale\CWS12v5.1\prog\FPP\mcu03C6.fpp

USB HCS08/HCS12 MULTILINK detected - Flash Version 5.84

executing .\cmd\P&E_Multilink_USB_reset.cmd

!// After reset the commands written below will be executed

done .\cmd\P&E_Multilink_USB_reset.cmd

Reset command file correctly executed.

      MCU clock speed: 8000000 Hz

Block Module Name      Address Range   Status

   0  EEPROM             400 -   FFF   Blank - Unselected

   1  FLASH_4000        4000 -  7FFF   Programmed - Unselected

   2  FLASH_C000        C000 -  FFFF   Programmed - Unselected

   3  ALL_PPAGES      308000 -3FBFFF   Programmed - Unselected

   4  FLAT8000_P30      8000 -  BFFF   Blank - Unselected

FP: The UNPROTECT command is not available for the EEPROM flash module => Skipped.

FP: The UNPROTECT command is not available for the FLASH_4000 flash module => Skipped.

FP: The UNPROTECT command is not available for the FLASH_C000 flash module => Skipped.

FP: The UNPROTECT command is not available for the ALL_PPAGES flash module => Skipped.

FP: The UNPROTECT command is not available for the FLAT8000_P30 flash module => Skipped.

executing .\cmd\P&E_Multilink_USB_vppon.cmd

!// Before programming the flash, the commands written below will be executed

done .\cmd\P&E_Multilink_USB_vppon.cmd

Vppon command file correctly executed.

executing .\cmd\P&E_Multilink_USB_vppoff.cmd

!// After programming the flash, the commands written below will be executed

done .\cmd\P&E_Multilink_USB_vppoff.cmd

Vppoff command file correctly executed.

FP: Arm FLASH for loading.

executing .\cmd\P&E_Multilink_USB_vppon.cmd

!// Before programming the flash, the commands written below will be executed

done .\cmd\P&E_Multilink_USB_vppon.cmd

Vppon command file correctly executed.

FP: ALL_PPAGES flash module is bad or protected.

executing .\cmd\P&E_Multilink_USB_vppoff.cmd

!// After programming the flash, the commands written below will be executed

done .\cmd\P&E_Multilink_USB_vppoff.cmd

Vppoff command file correctly executed.

FP: FLASH disarmed.

USB HCS08/HCS12 MULTILINK detected - Flash Version 5.84

executing .\cmd\P&E_Multilink_USB_reset.cmd

!// After reset the commands written below will be executed

done .\cmd\P&E_Multilink_USB_reset.cmd

Reset command file correctly executed.

executing .\cmd\P&E_Multilink_USB_postload.cmd

!// After load the commands written below will be executed

RESET

done .\cmd\P&E_Multilink_USB_postload.cmd

Postload command file correctly executed.

main 0x403E T

STARTED

RUNNING

Breakpoint

********************************************************************

I've found an old message with a colleague regarding the Dx256 devices.

In fact the DT256, DP256, DJ256,  ... were very similar.

Different MCU_ID were used but the files are similar.

Please have a look to the \CWS12v5.1\Prog\fpp folder.

     DP256 -> Mcu03c6.fpp

     DJ256 -> Mcu03d8.fpp

     DT256 -> Mcu02ea.fpp

     DT256B -> Mcu03d7.fpp

You can open them using notepad for instance and you can see all files are identical.

I've a DT256 and I tried with this device.

I got the in Command component:

++++++++++++++++++++++++++++++++++++++++++++

Loading Target ...

IO registers loaded for MC9S12DP256 from E:\Freescale\CWS12v5.1\prog\REG\MCU03C6.REG

USB HCS08/HCS12 MULTILINK detected - Flash Version 5.84

IO registers loaded for MC9S12DP256 from E:\Freescale\CWS12v5.1\prog\REG\MCU03C6.REG

USB HCS08/HCS12 MULTILINK detected - Flash Version 5.84

USB HCS08/HCS12 MULTILINK detected - Flash Version 5.84

IO registers loaded for MC9S12DP256 from E:\Freescale\CWS12v5.1\prog\REG\MCU03C6.REG

USB HCS08/HCS12 MULTILINK detected - Flash Version 5.84

executing .\cmd\P&E_Multilink_USB_startup.cmd

!// At startup the commands written below will be executed

Target Ready

done .\cmd\P&E_Multilink_USB_startup.cmd

Startup command file correctly executed.

executing .\cmd\P&E_Multilink_USB_preload.cmd

!// Before load the commands written below will be executed

done .\cmd\P&E_Multilink_USB_preload.cmd

Preload command file correctly executed.

FP: FLASH parameters loaded for MC9S12DP256B_V11(NVMIF2 rev 2,3,3,3,2) from E:\Freescale\CWS12v5.1\prog\FPP\mcu03C6.fpp

USB HCS08/HCS12 MULTILINK detected - Flash Version 5.84

executing .\cmd\P&E_Multilink_USB_reset.cmd

!// After reset the commands written below will be executed

done .\cmd\P&E_Multilink_USB_reset.cmd

Reset command file correctly executed.

      MCU clock speed: 8005000 Hz

Block Module Name      Address Range   Status

   0  EEPROM             400 -   FFF   Blank - Unselected

   1  FLASH_4000        4000 -  7FFF   Blank - Unselected

   2  FLASH_C000        C000 -  FFFF   Programmed - Unselected

   3  ALL_PPAGES      308000 -3FBFFF   Programmed - Unselected

   4  FLAT8000_P30      8000 -  BFFF   Programmed - Unselected

FP: The UNPROTECT command is not available for the EEPROM flash module => Skipped.

FP: The UNPROTECT command is not available for the FLASH_4000 flash module => Skipped.

FP: The UNPROTECT command is not available for the FLASH_C000 flash module => Skipped.

FP: The UNPROTECT command is not available for the ALL_PPAGES flash module => Skipped.

FP: The UNPROTECT command is not available for the FLAT8000_P30 flash module => Skipped.

executing .\cmd\P&E_Multilink_USB_vppon.cmd

!// Before programming the flash, the commands written below will be executed

done .\cmd\P&E_Multilink_USB_vppon.cmd

Vppon command file correctly executed.

executing .\cmd\P&E_Multilink_USB_vppoff.cmd

!// After programming the flash, the commands written below will be executed

done .\cmd\P&E_Multilink_USB_vppoff.cmd

Vppoff command file correctly executed.

FP: Arm FLASH for loading.

executing .\cmd\P&E_Multilink_USB_vppon.cmd

!// Before programming the flash, the commands written below will be executed

done .\cmd\P&E_Multilink_USB_vppon.cmd

Vppon command file correctly executed.

executing .\cmd\P&E_Multilink_USB_vppoff.cmd

!// After programming the flash, the commands written below will be executed

done .\cmd\P&E_Multilink_USB_vppoff.cmd

Vppoff command file correctly executed.

FP: FLASH disarmed.

USB HCS08/HCS12 MULTILINK detected - Flash Version 5.84

executing .\cmd\P&E_Multilink_USB_reset.cmd

!// After reset the commands written below will be executed

done .\cmd\P&E_Multilink_USB_reset.cmd

Reset command file correctly executed.

executing .\cmd\P&E_Multilink_USB_postload.cmd

!// After load the commands written below will be executed

RESET

done .\cmd\P&E_Multilink_USB_postload.cmd

Postload command file correctly executed.

main 0x403E T

++++++++++++++++++++++++++++++++++++++++++++

The project using DP512 generates similar problem whereas with DT256 device it's working fine.

I don't think there is a problem with the fpp file as it's working fine on my side.

Does the problem is linked to the interface ?

Please can you provide me the same command dialog you get on your side.

It could be interesting to compare the flash version used.

Another test you can do: select DP512 instead of DP256.

Regards

Have a great day,
Pascal
NXP Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply