Loading Code in the Paged RAM Area in S12XEP100

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

Loading Code in the Paged RAM Area in S12XEP100

Jump to solution
2,831 Views
RahulBakshi
Contributor I
Hi,
 
My application code size is more than 8 KB. So full code is not getting allocated in the unpaged RAM region i.e. 0x2000 to 0x3FFF. So i tried to load the code in the Paged RAM region. I made appropiate changes in the prm file. I allocated DEFAULT_ROM to  But while debugging the code debugger window for C code is not getting updated (I mean not reflecting currently which part of code is running).
 
Prm file:
 
 Code:
    CPU_ROM       = READ_ONLY     0x2100 TO   0x39FF;     CPU_RAM       = READ_WRITE    0x3A00 TO   0x3FAF;     RAM_FB        = READ_ONLY  0xFB1000 TO 0xFB1FFF;     RAM_FC        = READ_ONLY  0xFC1000 TO 0xFC1FFF;     RAM_FD        = READ_ONLY  0xFD1000 TO 0xFD1FFF;PLACEMENT     _PRESTART,                  STARTUP,                    ROM_VAR,                    STRINGS,                    VIRTUAL_TABLE_SEGMENT,    //.ostext,                    NON_BANKED,     COPY             INTO  CPU_ROM;                             DEFAULT_ROM       INTO  RAM_FD,RAM_FC,RAM_FB;                   DEFAULT_RAM       INTO  CPU_RAM;                              END

 
Please suggest some solution.

Message Edited by Alban on 2006-09-26 02:16 PM

Labels (1)
Tags (1)
0 Kudos
1 Solution
758 Views
CrasyCat
Specialist III
Hello
 
That should be working.
Please submit a service request around that through our support web site.
Make sure to attach a reproducible project and the installed product information.
 
To extract the information our support team will need to investigate,m you can use the pack and Go wizard.
Just start the IDE, open the project and select Help -> "Pack And Go" and follow the information on the screen.
 
CrasyCat

View solution in original post

0 Kudos
6 Replies
758 Views
RahulBakshi
Contributor I
Hello,
 
I am using CodeWarrior Development Studio for Freescale HC12 4.5
+ Service Pack XEP100. But it is not loading the code in the flash.
Is it loading for your application? Do we need to do some extra configuration setting to enable in this feature for EP100?
Thanks
 
Rahul
0 Kudos
759 Views
CrasyCat
Specialist III
Hello
 
That should be working.
Please submit a service request around that through our support web site.
Make sure to attach a reproducible project and the installed product information.
 
To extract the information our support team will need to investigate,m you can use the pack and Go wizard.
Just start the IDE, open the project and select Help -> "Pack And Go" and follow the information on the screen.
 
CrasyCat
0 Kudos
758 Views
RahulBakshi
Contributor I

Thanks for your reply. But my concern is that CW 4.5 for HCS12XEP100 doesn't have utility to load code in the flash area. That’s why I need to put code in Paged RAM rather than putting in flash.

Is there any way to run the code by placing it into the Paged RAM?

 

Rahul

0 Kudos
758 Views
CrasyCat
Specialist III
Hello
 
That is strange.
Which product did you install?
 
With CodeWarrior Development Studio for Freescale HC12 4.5
+ Service Pack XEP100 you should be able to program the flash on your HCS12XE chip.
 
CrasyCat
0 Kudos
758 Views
CrasyCat
Specialist III
Hello
 
 This is not going to work this way.
 To call a function located in banked memory, the HCS12XE CPU uses a CALL instruction..
 CALL instruction is modifying PPAGE and PC registers to build a 24-bit address where code will be
  executed.
 
 PPAGE cannot be used to refer to banked memory 0xFB1000 TO 0xFB1FFF.
 Bank window for PPAGE is 0x8000..0xBFFF.
 
 So you need to load your code in banked flash.
 
CrasyCat
0 Kudos
758 Views
Lundin
Senior Contributor IV
As a sidenote, this is how you place variables in banked flash:

For HCS12 you need to do the following (I assume the same applies to HCS12X):

- Add compiler switch -Mb for banked memory.
- Add compiler switch -CpPPAGE=0x30 to tell where PPAGE is located.
- Add the annoying file datapage.c to your project. It is located at something like
C:\Program\Metrowerks\CodeWarrior\lib\HC12c\src\datapage.c

- Manually set PPAGE_ADDR in this file to 0x30 or you are risking that Codewarrior suddenly goes bananas and treats the target as 68HC12 or whatever it is that has got PPAGE at address 0x35. It has happend to me several times. It ignores the value -CpPPAGE=0x30 and takes the value in datapage.c instead.
Not so fun to debug when the code starts to write random values to REFDV and there is a PLL filter present on the board...

- Use "far" when accessing the banked variables.

Message Edited by Lundin on 2006-09-2604:19 PM

0 Kudos