Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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.

porting linux library onto DSP C64+

Hi, everyone. I am porting a project written in Linux onto DSP C64+. The project is protocol stack. I encounter some problems about linux library.

for example, fcntl.h, unistd.h library are provided in Linux. How should I handle with these two libraries? Are there similar libraries provided by TI, in order to replace them? If not, what I should do?

Thank you very much.

  • Hi heaven_wb,

    I guess the functions that need those header files work only for Linux, they are not part of standard C, but part of Linux and OS dependent. The DSP core does not run Linux.

    What functions are you using and what are you trying to accomplish?

  • Hi Mariana,

    in the fcntl library, our code call the open() and fcntl() function. They are used to deal with operation about files. for example, open a file, create a file, set file flags, set file lock, and so on. I found file.h in CGT, in which the open() function is defined, but have some differences. for fcntl(), I cannot find similar function.

    and for unistd library, access() is used to check the availability of files.

    Can I find the similar function by TI? if not, how should I port them. This is my first porting. I am not clear about it. Thank you very much.

  • The C standard functions do not contain those functions, so you will not find them in them for DSP. We do not document the file manipulation functions because they do not "belong" to TI, but to standard C. Those are the functions that are defined in th stdio.h file.

    Here is a website that lists some functions (I have not completely checked to see if this website is compatible with standard C, but it should be a good source):

    http://www.acm.uiuc.edu/webmonkeys/book/c_guide/2.12.html#streams

    So to open a file, you would need to use fopen. Please take a look at the functions available and see if you can achieve what you need with them.

    At this point I would like to say that Linux uses a file system integrated with the operational system. The operational system that runs in the DSP is DSP/BIOS. IT does not depend on a file system to run. So when you use the file i/o functions in your DSP, you would be reading files from your host computer where CCS is. Most of our DSPs do not have file system in the DSP memory itself. The C6747 has a file system that can be used with DSP/BIOS, but again, DSP/BIOS does [not] need the file system to operate.

  • Thank you very much. it helps me very much. But C standard library cannot provide as much functionality as we require. for example file lock and unlock. the type of our DSP has been decided, I think I should talk with our group to check if extra functionality can be omitted.