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.

read/write file from/to host

Other Parts Discussed in Thread: OMAP-L137

I wrote program in CCS3.3 using fprintf, fflush, fclose from stdio.h to make some files operation. I run program on OMAP-L137 EVM via embedded USB. When I didn`t use DSP/BIOS my program created, write and read files from/to host computer. After I added DSP/BIOS Config file to my project program stoped working correctly. Program works but doesn`t do files operations. I need load data from host computer to target EVM from 12 files to initiate variables, and DSP/BIOS controls tasks. Please, tell me the best way to do files operations on host and use DSP/BIOS together. I read about LCK manager, but I don`t unerstand how it works.

Best regards 

  • Hi Adam,

    One thing that I would suggest is to do all the file I/O operations in main, this way you do not interfere with the DSP/BIOS scheduler too much. The file i/o operations practically halt the processor.

    Another thing that you can look at, is that you need to make sure your heap is configured. To configure the heap, go to the .tcf file.  Open the .tcf file, expand the contents of the Memory Section Manager, Right Click on IRAM (or the name of the memory you want to put the heap)=> Choose Properties.  Select create a heap in this memory.  Then right click on the MEM - Memory Section Manager, uncheck No Dynamic Memory Heaps and choose the memory in the drop down list for Segment For malloc() /free().

    Before using DSP/BIOS, the heap was defined in the .cmd file or build options, now it has to be defined in the tcf file - that will generate the .cmd file.

     

  • Hi Mariana,

    I did all that You suggested and when I try to close .tcf file get error : 

    js:"./bios.tcf", line 39: Heaps are enabled, but the segment for DSP/BIOS Objects (MEM.BIOSOBJSEG)

    is not set correctly. Please create a heap in one of your data segments and set MEM.BIOSOBJSEG to it.

     

    IRAM properies: base 0x11800000, len 0x00040000, create a heap.. check, heap size 0x00008000, user defined heap label uncheck, space code/data

    MEM - memory Section Manager properties: reuse startup code space uncheck, argument buffer size 0x0004, stack size(MAU) 0x0400, no dynamic memory heaps uncheck,

    sement for DSP/BIOS object MEM_NULL, segment for malloc()/free() IRAM, enable memory protection.. uncheck.

    What is wrong? Help me again, please.

    I wrote dummy test program only printf in main(), it works without DSP/BIOS and still doesn`t with .tcf.

  • Right click on the MEM - Memory Section Manager, and choose the memory in the drop down list for Segment For DSP/BIOS Objects.

  • Mariana,

    Thanks, half succes, my dummy program does files operation but doesn`t printf. Please, any suggestion. I will test tomorow.

  • After I used fflush(stdout) printf() run. Thank you for help me.