I’m running a simple freertos example. I’ve increased the stack size of the tasks to 10000. I get the error: vApplicationMallocFailedHook() called
The code is as follows:
///* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "timers.h"
/* Xilinx includes. */
#include "xil_printf.h"
#include "xparameters.h"
void vTask2(void *pvParameters) {
while (1) {
// xil_printf("running task 2\n");
}
}
void vTask1(void *pvParameters) {
// Create a new task with a stack size of 10K bytes
xTaskCreate(vTask2, "Task 2", 10000, NULL, 1, NULL);
while (1) {
// xil_printf("running task 1\n");
}
}
int main() {
// Create a new task with a stack size of 10K bytes
xTaskCreate(vTask1, "Task 1", 10000, NULL, 1, NULL);
// Start the scheduler
vTaskStartScheduler();
return 0;
}
I increased the heap size in freertosconfig but it doesn’t help. Here are some variables of interest in freertos config:
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 200 * 20)
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 65536 * 20) )
I also increased the heap in my linker script to 0x10000 and it still doesn’t seem to help.
I was wondering if anyone has experienced this error and what are some other things I can try?
Thanks in advance