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.

SDSPI_open heap size

Hello

I want to used the FatFs driver under TI-RTOS and i have 2 questions about the function SDSPI_open()

1) I have test to put my BIOS.heapSize = 0x000 and this function doesn't work. It is any solution to avoid used heap alloocation?

2) I want to know how many heap size are used by this function?

 

This is my code to open SDSPI driver :

SDSPI_init();
SDSPI_Params_init(&sdspiParams);
sdspiHandle = SDSPI_open(Board_SDSPI0, 0, &sdspiParams);

Thanks for your help

  • Cedric,

    Which version of TI-RTOS are you using? As of 1.21 you should be able to use TI-RTOS drivers without a heap.

    cedric HERRIER said:
    1) I have test to put my BIOS.heapSize = 0x000 and this function doesn't work. It is any solution to avoid used heap alloocation?

    For the SDSPI driver there's a catch. The C I/O wrapper APIs for the FatFs module use malloc to create a FIL objects when you call fopen.I think you'll have to use the FatFs (f_open, f_read, etc...) APIs if you want to avoid using a heap.

    cedric HERRIER said:
    2) I want to know how many heap size are used by this function?

    ROV can show you how much available heap you have. I'd take a look at it before and after you called SDSPI_open().

  • thanks tom for your answers

    I have found how to set my BIOS.heapSize = 0x000. For all other people who have the same question, the answer is on the FATFS driver. When you allow _FS_REENTRANT = 1 (on ffconfigh) you try to create a semaphore and because of this,you have a dynamic allocation. If you have no reentrancy, disable it

     

    Cédric 

  • Cedric,

    I filed a work item (SDOCM00106995) to support static memory allocation. I think this will be a significant update to the FatFs module.