HCS12XEP1000 does not access all ram via Processor Expert

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

HCS12XEP1000 does not access all ram via Processor Expert

ソリューションへジャンプ
1,899件の閲覧回数
AndersJ
Contributor IV

The XEP100 has 64K of RAM.

Processor Expert allocates only 8K in Segment1.

 

How do I tell PE to allow usage of all 64K?

 

Thanks,

Anders J

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
1,331件の閲覧回数
ProcessorExpert
Senior Contributor III

Hello,

to access whole 64K of RAM its necessary to switch to “Large memory” model, where the whole RAM will be available through page window.

Since there is no way how to create new PE project with “Large” memory model selected by default, it is necessary to switch it within Build Options tab in CPU component. For more details please see enclosed build_options_tab.png.

Steps to switch from “Banked” memory  model to “Large” memory model in PE:
1 – create new PE project with Banked memory model
2 – switch “Memory model” property in “Build Options” tab to “Large”
3 – confirmation window will be opened – please click on “Yes” button
4 - go to project compiler settings and switch "-Mb" to "-Ml" option. For more
details please see enclosed compiler_settings.png
4 - go to "Project panel" to "Files" tab and change ansixbi.lib to ansixli.lib
in "Libraries" folder
5 – start code generation. It will update the prm file.

In case of Large memory model, paged ram is in PAGED_RAM PLACEMENT, therefore it is
necessary to use appropriate pragma in C code to access this memory.
For more details about properly using of pragma directives please see "5.1
How to use pragma statements to control location of objects" chapter in :
http://cache.freescale.com/files/soft_dev_tools/doc/app_note/AN3784.pdf

Note:
AN3784 also contains description of small, banked, large memory models.

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
1,332件の閲覧回数
ProcessorExpert
Senior Contributor III

Hello,

to access whole 64K of RAM its necessary to switch to “Large memory” model, where the whole RAM will be available through page window.

Since there is no way how to create new PE project with “Large” memory model selected by default, it is necessary to switch it within Build Options tab in CPU component. For more details please see enclosed build_options_tab.png.

Steps to switch from “Banked” memory  model to “Large” memory model in PE:
1 – create new PE project with Banked memory model
2 – switch “Memory model” property in “Build Options” tab to “Large”
3 – confirmation window will be opened – please click on “Yes” button
4 - go to project compiler settings and switch "-Mb" to "-Ml" option. For more
details please see enclosed compiler_settings.png
4 - go to "Project panel" to "Files" tab and change ansixbi.lib to ansixli.lib
in "Libraries" folder
5 – start code generation. It will update the prm file.

In case of Large memory model, paged ram is in PAGED_RAM PLACEMENT, therefore it is
necessary to use appropriate pragma in C code to access this memory.
For more details about properly using of pragma directives please see "5.1
How to use pragma statements to control location of objects" chapter in :
http://cache.freescale.com/files/soft_dev_tools/doc/app_note/AN3784.pdf

Note:
AN3784 also contains description of small, banked, large memory models.

0 件の賞賛
返信
1,331件の閲覧回数
kef
Specialist I

This is because by default only 8k of RAM are not paged and accessible directly. The rest can be accessed via 4k RPAGE window at 0x1000-0x1FFF, or using global memory addressing.

 

You can map additional 16k of RAM to 0x4000-0x7FFF (instead of flash) making contiguous 8+16=24k RAM segment at 0x2000-0x7FFF. You can do that using PE. See CPU component properties. Internal resource mapping. Set Int. FLASH in 0x4000-0x7FFF to OFF and set Int. RAM in 0x4000-0x7FFF to ON.

 

If don't wan't paged RAM and need little more, then you can add RPAGE window and form contiguous 4k+24k =28k segment at 0x1000-0x7FFF. But PE won't help you here. You need to edit PRM file.

 

Do you need to allocate some big array, something like single 40kB array? You can do that using global addressing, though more PRM editing might be required.

 

0 件の賞賛
返信
1,331件の閲覧回数
AndersJ
Contributor IV

I have seen the remapping option, but was afraid to use it without understanding the implications.

Will I loose Int.FLASH, or is it just relocated?

 

What I "want" is access to all 64K so I can allocate storage just by declaring variables

in the "normal" simple way. That seems not possible from what I read in your post.

 

"Big array?" Not really. This happened when I declared a number of communication buffers

together with other miscellaneous variables.

 

I do not understand the concept of global adressing.

What does that mean?

Can you show me an example?

 

Thanks for helping,

Anders J

 

0 件の賞賛
返信
1,331件の閲覧回数
kef
Specialist I
  • I have seen the remapping option, but was afraid to use it without understanding the implications.
  • Will I loose Int.FLASH, or is it just relocated?

 

You won't loose flash, but you will loose nonpaged flash. Accessing constants in flash is faster when constants are allocated in nonpaged flash.

 

 

 

  • What I "want" is access to all 64K so I can allocate storage just by declaring variables
  • in the "normal" simple way. That seems not possible from what I read in your post.

 

Large memory model at the cost of spped might be the way to go. To enable it, create new project as usually, with Memory model = Banked, else project wizard won't allow you to use PE. In PE Build Options switch memory model to Large.

Then in Standard Settins find Compiler Options, in Code Generation tab find memory model and change it to Large. Then you should be able to use all the RAM. Though I'm not sure about >4kB objects.

 

 

 

  • I do not understand the concept of global adressing.
  • What does that mean?

 

It's hard to expplain it in few words. Please study CPU12X(E) reference manual.

 

0 件の賞賛
返信