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.

Clarification with User-Defined C I/O Driver

Other Parts Discussed in Thread: OMAPL138, SYSBIOS

Hi,

Setup:
OMAPL138 (SYSBIOS 6.34.02.18 is running on both ARM and DSP). This is on DSP.

I have created a user defined C IO driver as shown below.

  status = add_device("device",
      _MSA,
      device_open,
      device_close,
      device_read,
      device_write,
      device_lseek,
      device_unlink,
      device_rename);

This is working as expected i.e. if I do fopen("device:foo.txt") the function device_open gets called.

Now if JTAG is connected and I give fopen("foo.txt"), it checks the debug folder and returns NULL if file is not there.

But if JTAG is not connected and I try to run the code using an AIS file, fopen("foo.txt") returns a valid pointer and further fgets gives me whatever data is in CIO buffer i.e. previous "device:" data. If CIO buffer is empty, fgets retuns a valid pointer but the string length is zero.

Is this expected behaviour? Should not fopen("foo.txt") return NULL?

thanks, Durga

  • durga temp said:
    Should not fopen("foo.txt") return NULL?

    If you are not running under CCS, then the standard C I/O functions do not work.  It would be nice if some kind of runtime check could inform you when you are running C I/O functions without CCS.  But there is no such check.  The C I/O functions attempt to run, and do return results, but these results are purely random.

    Just to clarify ... Running under CCS means running under full control of the CCS debugger with JTAG connected.  Run free (or anything like that) doesn't count.

    Thanks and regards,

    -George

  • Thanks for the clarification.

    -Durga