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.

C6747 audioSample example

Hi, I compiled and run psp provided audioSample project (..\Texas Instruments\pspdrivers_01_30_00_05\packages\ti\pspiom\examples\evm6747\audio). Everything works fine with the default definition

#define BUFLEN                  2560 /* number of samples in the frame */

but if I change to 25600 samples and run CCS, Stdout shows next error

Assertion failed, ((0 != ioPacket->size) && ((32768u) >= ioPacket->size/chanHandle->noOfSerAllocated)), file Mcasp.c, line 3007

And LOG name -> trace shows:

0  
Audio Sample Main

1  
MEM_calloc failed.
2  
MEM_calloc failed.
3  
MEM_calloc failed.
4  
MEM_calloc failed.
5  
MEM_calloc failed.
6  
MEM_calloc failed.
7  
MEM_calloc failed.

How can avoid this problem?

Thanks in advance,

Gaston

  • You probably need to increase the heap.

    Go to your DSP/BIOS Configuration file (.tcf), right click on the memory that has the heap, select Properties, and increase its' size.

  • I've already select a heap, I think an enough one for a buffer of 25600x4 = 0x19000 bytes

    However error on memory allocation persist during program execution.

    What could be the problem?

  • Gaston,

    MEM_Alloc is allocating BUFSIZE = BUFLEN * sizeof(Ptr)

    Where size of Ptr is 4 bytes. So it allocates 0x19000 x 4 x 4 = 0x190000.

    You can always see the how much heap is being used and how much heap is left at menu DSP/BIOS -> Kernel/ Object View.

    Select MEM, SDRAM, and you can see Free mem, Used Mem: 

     

     

  • Thank you Mariana, you're right. Now I have no problem with memory allocation issues. However error persists due to SIO_issue at line 288. I only changed #define to get 25600 samples as STDOut says "Assertion failed, ((0 != ioPacket->size) && ((32768u) >= ioPacket->size/chanHandle->noOfSerAllocated)), file Mcasp.c, line 3007"

    Any suggestions?
    Gaston
  • In the file:

    C:\Program Files\Texas Instruments\pspdrivers_01_30_00_05\packages\ti\pspiom\mcasp\src\Mcasp.c

    It tests if the size of the buffer is less than the MAX size supported.

    You can see that:

    #define Mcasp_MAX_PACKET_SIZE (32768u)
    /**< Maximum packet size in bytes */

    in the file:

    C:\Program Files\Texas Instruments\pspdrivers_01_30_00_05\packages\ti\pspiom\mcasp\src\McaspLocal.h

    So the max buffer has to be 32768 bytes.