• TI Thinks Resolved

TMS320C5517: fopen does not work(return null)

Part Number: TMS320C5517

Hello,

I try to open a file using fopen on my board(tms5517), but it returns 0.

FILE *fp;
fp = fopen(FileName,"rb");

I try to make the stack larger, but it also didn't work.

-stack 0x2000 /* Primary stack size */
-sysstack 0x1000 /* Secondary stack size */
-heap 0x20000 /* Heap area size */

MEMORY
{
MMR: o = 0x000000 l = 0x0000c0 /* 192B Memory Mapped Registers */

DARAM0: o = 0x0000C0 l = 0x001F40 /* 8kB Dual Access RAM 0 */
DARAM1: o = 0x002000 l = 0x002000 /* 8kB Dual Access RAM 1 */
DARAM2: o = 0x004000 l = 0x002000 /* 8kB Dual Access RAM 2 */
DARAM3: o = 0x006000 l = 0x00A000


SARAM0: o = 0x010000 l = 0x040000



CS0: o = 0x050000 l = 0x7B0000 /* 8MB CS0 external memory space */
CS2: o = 0x800000 l = 0x400000 /* 4MB CS2 external memory space */
CS3: o = 0xC00000 l = 0x200000 /* 2MB CS3 external memory space */
CS4: o = 0xE00000 l = 0x100000 /* 1MB CS4 external memory space */
CS5: o = 0xF00000 l = 0x0E0000 /* 1MB CS5 external memory space */
ROM: o = 0xFE0000 l = 0x01FF00 /* 128kB ROM (MPNMC=0) or CS5 (MPNMC=1) */
VECS: o = 0xFFFF00 l = 0x000100 /* reset vector */
}

SECTIONS
{
vectors (NOLOAD) > VECS /* If MPNMC = 1, remove the NOLOAD directive */
.cinit > DARAM3 ALIGN = 4
.text > DARAM3 ALIGN = 4
.stack > SARAM0 ALIGN = 4
.sysstack > SARAM0 ALIGN = 4
.sysmem > SARAM0 ALIGN = 4
.data > SARAM0 ALIGN = 4
.cio > SARAM0 ALIGN = 4
.bss > SARAM0 ALIGN = 4
.const > SARAM0 ALIGN = 4
.switch > SARAM0 ALIGN = 4

}

I didn't use any external RAM, which means that only the memmory in DSP itself. So is the memmory too small that fopen can't run?  

But I want to write a bin file to flash, if I can't open this bin file, I'd have move the whole data into .h file, which is a troublesome job.

Can anybody help me?