I'm using an STK1000 and avr32-gcc in Cygwin environment. The code is for stand alone, not Linux.
I want to reserve 230,400 words of the STK1000's 8MB SDRAM for use as an LCD frame buffer. (That's 640x480 pixels of 24 bits each, packed.) This should be fine since the STK1000 has 8 MB, or 2Mwords of RAM.
I intend to program this address into the STK1000's LCDC dmabaddr1 register as follows:
unsigned long *frame_buffer_ptr;
frame_buffer_ptr = ????; // how do I get memory???
volatile struct avr32_lcdc_t *lcdc = &AVR32_LCDC;
lcdc->dmabaddr1 = (unsigned long) frame_buffer_ptr;
It would also be good if I can just assign an array of the required size, or any other way to get the memory allocated and get its address.
I'm currently trying to use malloc but it fails, returns null pointer. Does anybody have an idea or suggestion on how I can reserve this memory and get a pointer for the LCDC?