ufechner wrote on Saturday, March 25, 2006:
Hello,
I am trying to get FreeRTOS working on the ATmega168, a chip with 16 k FLASH and 1 kBytes RAM.
The program memory is no problem, the RAM usage is.
The following is working so far:
vStartLEDFlashTasks
vStartIntegerMathTasks
and the TX part of
vAltStartComTestTasks
Important for me is it, to get the RX part of the
COMTestTasks going.
My configuration:
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 8000000 )
#define configTICK_RATE_HZ ( ( portTickType ) 512 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 4 )
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 85 )
#define configTOTAL_HEAP_SIZE ( (size_t ) (500 ) ) // default: 1500
#define configMAX_TASK_NAME_LEN ( 4 ) // default: 8
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 1
#define configIDLE_SHOULD_YIELD 1
/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 0
#define INCLUDE_uxTaskPriorityGet 0
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 0
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
WinAVR reports: (I am using avr-gcc version 3.4.5)
Program: 6390 bytes (39,0% Full)
(.text + .data + .bootloader)
Data: 689 bytes (67,3% Full)
(.data + .bss + .noinit)
I don’t no yet, where this high ram usage is coming from.
Is it right, that statically allocated RAM and the HEAP_SIZE together must be less then 1k RAM?
Any hints, how I can optimize the RAM usage are welcome.
Uwe Fechner