I wanna allocate a piece of memory for a pointer in Zone2, but it failed. Actually to make things easier, I downloaded Example_281xCodeRunFromXintf from TI website and modified a little bit. But it seemed that it didn't work.
The following is a piece of code from my project.
.Cmd file:
zone2data : > ZONE2 PAGE = 1
.c file:
#pragma DATA_SECTION(Zone2test,"zone2data");
#pragma DATA_SECTION(pzone2,"zone2data");
#define max 32
float *pzone2;
int i=0;
float Zone2test[max];
main()
{
.......................
pzone2=(float *)malloc(10*sizeof(float));
for(i=0;i<max;i++)
Zone2test[i]=101;
.........................
}
The problem is, from the watch window, i can see that,
The address of Zone2test is,0x00080040, which means this array has got memory from zone2. But for the pointer pzone2,I got the message, memory map prevented read of target memory at 0xFFFF9002@Data which means it hasn't successfully get memory from zone2.
It's really weird, why does the code and allocation succeed for arrays not for pointers?
Anything wrong with my program?
Really appreciate your help!