I've written a simple DSP program which uses malloc to allocate 320x240x3 = 230,400 bytes.
The call to malloc keeps failing. I'm using the C674x simulator in CCS 5 to test my program. I think the problem is the way my simulator is configured. Please could someone give me tips on how to "give" main memory to the simulator? My CPU is a DM8168 but I'm just trying to simulate something running on the C674x core.
Here's the code causing the problem:
#include <stdio.h>
#include <stdlib.h>
#define OUTPUT_WIDTH 320
#define OUTPUT_HEIGHT 240
/*
* hello.c
*/
void main(void) {
char* buf = malloc(OUTPUT_WIDTH*OUTPUT_HEIGHT*3);
int x, y;
if(!buf)
{
printf("Problem allocating buffer.\n");
return;
}
}
Thanks,
Ralph