DSPRelated.com
Forums

File I/O error

Started by ahma...@yahoo.com May 29, 2008
Hi all
I have written a C source code for C55x simulator in which I have
used the "fopen" function for reading the input samples from a file. But when my program counter reaches to fopen execution the following error is displayed several times and the program exits:
Invalid CIO command (0).

I deleted the "fopen" and "fprint" and other file related functions
and use a constant array as input data (instead of file context). Then I ran the program again and the following error message happened during execution of my program:
Trouble running Target CPU: WARNING: PAGE BOUNDARY CROSSING DETECTED
AT PROGRAM COUNTER 0x12ee3
the 0x12ee3 address is part of the _printfi(text) code.

my .CMD and .map files are as follow:

PAGE 0: /* ---- Unified Program/Data Address Space ---- */
PMEM (RWIX) : origin = 0x000100, length = 0x01ff00 /* 128Kb page
of RAM */
PMEM2 (RWIX) : origin = 0x020100, length = 0x01ff00
PMEM3 (RWIX) : origin = 0x040100, length = 0x01ff00
PMEM4 (RWIX) : origin = 0x060100, length = 0x01ff00
SECTIONS
{
.sysstack {} > PMEM2 PAGE 0
.stack {} > PMEM2 PAGE 0
.vectors: {} > PMEM PAGE 0
.text: {} > PMEM PAGE 0
.cinit: {} > PMEM4 PAGE 0
.far: {} > PMEM PAGE 0
.sysmem {} > PMEM PAGE 0
.const: {} > PMEM PAGE 0
.bss1: {} > PMEM PAGE 0
.bss: {} > PMEM3 PAGE 0
.cio: {} > PMEM PAGE 0
.data: {} > PMEM PAGE 0
}

.MAP file:
PAGE 0: PMEM 00000100 0001ff00 0001c24d RWIX
PMEM2 00020100 0001ff00 000023e8 RWIX
PMEM3 00040100 0001ff00 00013258 RWIX
PMEM4 00060100 0001ff00 0000fefc RWIX
output
attributes/
section page orgn(bytes) orgn(words) len(bytes) len(words) input
sections
-------- ---- ----------- ----------- ---------- ----------
--------------
.text 0 00000100 [ 00000080 ] 00013ca5 *
.const 0 [ 00013da8 ] 00009ed4 * 00003134
.bss 0 [ 00040100 ] 00020080 * 0000992c
.cinit 0 [ 00060100 ] 00030080 * 00007f7e

Could you help me to solve the problem
SECTIONS
{
.sysstack {} > PMEM2 PAGE 0
.stack {} > PMEM2 PAGE 0
.vectors: {} > PMEM PAGE 0
.text: {} > PMEM PAGE 0
.cinit: {} > PMEM4 PAGE 0
.far: {} > PMEM PAGE 0
.sysmem {} > PMEM PAGE 0
.const: {} > PMEM PAGE 0
.bss1: {} > PMEM PAGE 0
.bss: {} > PMEM3 PAGE 0
.cio: {} > PMEM PAGE 0
.data: {} > PMEM PAGE 0
}

PREM2, PREM3, PREM4 are not on PAGE0. they are on PAGE1, PAGE2, PAGE3.
try by removing PAGE0

On Thu, May 29, 2008 at 12:00 PM, wrote:

> Hi all
> I have written a C source code for C55x simulator in which I have
> used the "fopen" function for reading the input samples from a file. But
> when my program counter reaches to fopen execution the following error is
> displayed several times and the program exits:
> Invalid CIO command (0).
>
> I deleted the "fopen" and "fprint" and other file related functions
> and use a constant array as input data (instead of file context). Then I
> ran the program again and the following error message happened during
> execution of my program:
> Trouble running Target CPU: WARNING: PAGE BOUNDARY CROSSING DETECTED
> AT PROGRAM COUNTER 0x12ee3
> the 0x12ee3 address is part of the _printfi(text) code.
>
> my .CMD and .map files are as follow:
>
> PAGE 0: /* ---- Unified Program/Data Address Space ---- */
> PMEM (RWIX) : origin = 0x000100, length = 0x01ff00 /* 128Kb page
> of RAM */
> PMEM2 (RWIX) : origin = 0x020100, length = 0x01ff00
> PMEM3 (RWIX) : origin = 0x040100, length = 0x01ff00
> PMEM4 (RWIX) : origin = 0x060100, length = 0x01ff00
> SECTIONS
> {
> .sysstack {} > PMEM2 PAGE 0
> .stack {} > PMEM2 PAGE 0
> .vectors: {} > PMEM PAGE 0
> .text: {} > PMEM PAGE 0
> .cinit: {} > PMEM4 PAGE 0
> .far: {} > PMEM PAGE 0
> .sysmem {} > PMEM PAGE 0
> .const: {} > PMEM PAGE 0
> .bss1: {} > PMEM PAGE 0
> .bss: {} > PMEM3 PAGE 0
> .cio: {} > PMEM PAGE 0
> .data: {} > PMEM PAGE 0
> }
>
> .MAP file:
> PAGE 0: PMEM 00000100 0001ff00 0001c24d RWIX
> PMEM2 00020100 0001ff00 000023e8 RWIX
> PMEM3 00040100 0001ff00 00013258 RWIX
> PMEM4 00060100 0001ff00 0000fefc RWIX
> output
> attributes/
> section page orgn(bytes) orgn(words) len(bytes) len(words) input
> sections
> -------- ---- ----------- ----------- ---------- ----------
> --------------
> .text 0 00000100 [ 00000080 ] 00013ca5 *
> .const 0 [ 00013da8 ] 00009ed4 * 00003134
> .bss 0 [ 00040100 ] 00020080 * 0000992c
> .cinit 0 [ 00060100 ] 00030080 * 00007f7e
>
> Could you help me to solve the problem
>
>