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...
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
 
					
				
		
 ZhangJennie
		
			ZhangJennie
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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!
-----------------------------------------------------------------------------------------------------------------------
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.
 
					
				
		
 ZhangJennie
		
			ZhangJennie
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
Can you please narrow down your problem and send me a demo project of your problem?
Thanks.
Jennie.
