This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ansi c library support

we are using cypress fx-2 development
board which has an evaluation version of c-51
compiler (for 8051 microcontroller).

we want to include ansi c library functions like fread, fwrite , malloc etc and compile
the code and port it into the target board.

bcause the above mentioned ansi c library
is not supported by c-51, is there any other
way of acheiving the ansi c library porting?
if so, then please explain how..

also, will it run on the 8051 microcontroller?
Urgent reply is appreciated.

Regards,
mahesh

Parents
  • Well, the short answer is "implement fopen(), fread(), etc, as appropriate for your device". (Or open(), read(), etc, if you prefer.)

    The long answer depends on details of your hardware. We have no idea what sort of device your file system is supposed to live on. Flash? A micro disk drive? A remote device over a network? Is the device block structured? Random access? Do you need to add a buffering layer to the I/O, or can the fread() calls just cut right to the device? Is your device complicated enough to require a driver layer to make it go?

    The design needs to consider how much, if any, of the file system semantics you really need. Do you need to be able to fseek() within a file? Write variable length pieces? Keep track of multiple independent files named with strings? Stored in a hierachical directory structure? Much of this sort of thing tends to be excessive on small embedded systems. (File IDs, for example, could be small integers rather than strings, especially when they're not human-readable or named by humans. A directory tree is only necessary to organize lots and lots of files. And so on.)

    Implementing non-volatile storage does not mean you have to have a file system. Be sure this is the path you really want to take.

Reply
  • Well, the short answer is "implement fopen(), fread(), etc, as appropriate for your device". (Or open(), read(), etc, if you prefer.)

    The long answer depends on details of your hardware. We have no idea what sort of device your file system is supposed to live on. Flash? A micro disk drive? A remote device over a network? Is the device block structured? Random access? Do you need to add a buffering layer to the I/O, or can the fread() calls just cut right to the device? Is your device complicated enough to require a driver layer to make it go?

    The design needs to consider how much, if any, of the file system semantics you really need. Do you need to be able to fseek() within a file? Write variable length pieces? Keep track of multiple independent files named with strings? Stored in a hierachical directory structure? Much of this sort of thing tends to be excessive on small embedded systems. (File IDs, for example, could be small integers rather than strings, especially when they're not human-readable or named by humans. A directory tree is only necessary to organize lots and lots of files. And so on.)

    Implementing non-volatile storage does not mean you have to have a file system. Be sure this is the path you really want to take.

Children
No data