This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello everyone,
I'm trying to use all of the memory of my eZdsp C5515 by allocating several global variable in a new memory section. I would like to use multiple data pages.
There is my .cmd file :
MEMORY
{
PAGE 0: /* ---- Unified Program/Data Address Space ---- */
MMR (RWIX): origin = 0x000000, length = 0x0000c0 /* MMRs */
DARAM0 (RWIX): origin = 0x0000c0, length = 0x00ff40 /* 64KB - MMRs */
SARAM0 (RWIX): origin = 0x010000, length = 0x010000 /* 64KB */
SARAM1 (RWIX): origin = 0x020000, length = 0x020000 /* 128KB */
SARAM2 (RWIX): origin = 0x040000, length = 0x00FE00 /* 64KB */
VECS (RWIX): origin = 0x04FE00, length = 0x000200 /* 512B */
SARAM3 (RWIX): origin = 0x050000, length = 0x1F0000 /* 31*64KB /!\ */
PDROM (RIX): origin = 0xff8000, length = 0x008000 /* 32KB */
PAGE 2: /* -------- 64K-word I/O Address Space -------- */
IOPORT (RWI) : origin = 0x000000, length = 0x020000
}
/* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */
SECTIONS
{
.text >> SARAM1|SARAM2|SARAM0 /* Code */
/* Both stacks must be on same physical memory page */
.stack > DARAM0 /* Primary system stack */
.sysstack > DARAM0 /* Secondary system stack */
.data >> DARAM0|SARAM0|SARAM1 /* Initialized vars */
.bss >> DARAM0|SARAM0|SARAM1 /* Global & static vars */
.const >> DARAM0|SARAM0|SARAM1 /* Constant data */
.sysmem > DARAM0|SARAM0|SARAM1 /* Dynamic memory (malloc) */
.switch > SARAM2 /* Switch statement tables */
.cinit > SARAM2 /* Auto-initialization tables */
.pinit > SARAM2 /* Initialization fn tables */
.cio > SARAM2 /* C I/O buffers */
.args > SARAM2 /* Arguments to main() */
.saram3 > SARAM3
vectors > VECS /* Interrupt vectors */
.ioport > IOPORT PAGE 2 /* Global & static ioport vars */
}
Now that my memory is allocated, I've created a global variable (which is present in SARAM1). First I'm trying to place the value in SARAM3 then changing the value of this global variable.
#pragma DATA_SECTION(sec1,".saram3");
Int16 sec1[TAILLE_DATA];
In the function which change the global variable, I'm writing this simple command following :
sec1[0]=2;
When I'm watching the Memory section, sec1 is at the address 0x028000 and when I'm watching the Disassembly code there is the following instruction :
MOV #2,*(#028000h)
The problem is that the address of the variable sec1 need to be coded with 24bits instead of 16bits and the instruction doesn't write the new value at the address 0x028000.
What I would like to know is how do we change the data page register in order to write a value at an address greater than 0x00FFFF?
Thank you for your time.
Best Regards.
Julien,
The code and debugger are correct. The value you see is a 16-bit word address, while the value in your command file is a byte address. The word address will be half that of the byte address.
If you set up the compiler to generate a MAP file, and look at the location of the 'sec1' variable, you will find it matches your expectations.
Regards,
Bill
Bill,
Thank you for your explanation. I didn't know this particularity of data and memory address for this DSP.
Now that I can see the sec1 location in the Memory browser, I'm trying to modify the first value of the table (for instance), but when the instruction comes, nothing happens.
Should I use an assembly instruction before in order to change the data page or is it implicit when I'm writing my code in C language ?
I just want to fill the table and I need a lot of memory, this is why I'm using different pages of the memory.
Regards,
Julien W.
Julien,
The next thing that I noticed, is that the C5515 processor does not have any on-board memory at 0x050000. Perhaps there is external memory, but you'll have to make sure to set that memory up before trying to use it.
I would stick with internal RAM until you get your feet wet.
Regards,
Bill