GRAM

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

GRAM

1,875 次查看
dlp
Contributor I

Hi. I am work with MCU 9S12XEP100. My project include Free RTOS. Help me, please. I need setting heap RTOS into 

paged RAM. It's must addres global. I don't know what this make...

0 项奖励
回复
5 回复数

1,562 次查看
dlp
Contributor I

Hi. Thx for your answer. Yes, i can make this.

I am work FreeRTOS. 

It's FreeRTOSv9.0.0 from site Free RTOS. I make my project basic on Demo CodeWarrior and add my tasks.

I put file from this project ( menager memory RTOS ) heap_5. In portable file project i see:

typedef struct HeapRegion
{
uint8_t * __far pucStartAddress;
size_t xSizeInBytes;
} HeapRegion_t;

 

In file heap_5 :

* Usage notes:
*
* vPortDefineHeapRegions() ***must*** be called before pvPortMalloc().
* pvPortMalloc() will be called if any task objects (tasks, queues, event
* groups, etc.) are created, therefore vPortDefineHeapRegions() ***must*** be
* called before any other objects are defined.
*
* vPortDefineHeapRegions() takes a single parameter. The parameter is an array
* of HeapRegion_t structures. HeapRegion_t is defined in portable.h as
*
* typedef struct HeapRegion
* {
* uint8_t *pucStartAddress; << Start address of a block of memory that will be part of the heap.
* size_t xSizeInBytes; << Size of the block of memory.
* } HeapRegion_t;
*
* The array is terminated using a NULL zero sized region definition, and the
* memory regions defined in the array ***must*** appear in address order from
* low address to high address. So the following is a valid example of how
* to use the function.
*
* HeapRegion_t xHeapRegions[] =
* {
* { ( uint8_t * ) 0x80000000UL, 0x10000 }, << Defines a block of 0x10000 bytes starting at address 0x80000000
* { ( uint8_t * ) 0x90000000UL, 0xa0000 }, << Defines a block of 0xa0000 bytes starting at address of 0x90000000
* { NULL, 0 } << Terminates the array.
* };
*
* vPortDefineHeapRegions( xHeapRegions ); << Pass the array into vPortDefineHeapRegions().
*
* Note 0x80000000 is the lower address so appears in the array first.
*
*/

I can't  equate pucStartAddress = start address page RAM (  RAM_FA, RAM_FB, RAM_FC ) .

I first variant -

static HeapRegion_t xHeapRegions[] =
{
{ ( uint8_t * __far)(0x0FA000), 0x1000 },
{ ( uint8_t * __far)(0x0FB000), 0x1000 },
{ ( uint8_t * __far)(0x0FC000), 0x1000 },
{ NULL, 0 } 
};

Not work...

I am add :

#pragma push

#pragma DATA_SEG __GPAGE_SEG PAGED_G_RAM

static HeapRegion_t xHeapRegions[] =
{
{ ( uint8_t * __far)(0x0FA000), 0x1000 },
{ ( uint8_t * __far)(0x0FB000), 0x1000 },
{ ( uint8_t * __far)(0x0FC000), 0x1000 },
{ NULL, 0 }
};

#pragma pop

I am stop...

0 项奖励
回复

1,562 次查看
kef2
Senior Contributor V

Hi Pavel,

Unless there is common typedef for pointer in your far RAM, which you could modify with __far keyword, I guess you need to modify FreeRTOS heap??.c seriously, modifying nearly every pointer with __far keyword...

Edward  

0 项奖励
回复

1,562 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

Under CW 5.x install folder, there is demo code

..\(CodeWarrior_Examples)\HCS12X\GlobalAddressing

open this project and see function RAM_Demo(). it is about how to allocate data in global address in RAM.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

1,562 次查看
dlp
Contributor I

Thx for your answer. But i can work with Global RAM. I work with FreeRTOS. If i set heap_5 - I need define 1-3 paged of RAM. I don't understand what change in RTOS files... If I set this - CPU not change page and software crash...

If i set heap_1 - software is work. But next time i need more free RAM in tasks... 

Best regards, Pavel.

0 项奖励
回复

1,562 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

Can you please narrow down your problem and send me a demo project of your problem?

Thanks.

Jennie.

0 项奖励
回复