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.

CC1352P: Memory allocation fails when initializing packetizer

Part Number: CC1352P

Hi,

I'm currently trying to implement the Audio Stream functionalities with the Opus codec (based on rfAudioTx example) from the Audio Plugin in an EasyLink project (based on rfEasyLinkEcho examples). However, when the Packetizer_open function tries to allocate memory for the scratch buffer (13200 Bytes) for  the Opus codec, a NULL pointer is returned, which then leads to the packetizer not being initialized properly. I don't know why the allocation fails, and I'm out of ideas on why this happens. 

But, as shown below, the chip should have enough free memory, judging from the Memory Allocation view.

This is my callstack:

The allocation of the same memory size (obviously) works on the rfAudioTx example itself. The following line of code (in green) is the call that returns the NULL pointer This is located in the file release_pem4f.c of the CC13x2 CC26x2 SDK ver 5.20.00.52.

Let me know if you need further information.

Thank you in advance.

Greetings,

Alex

  • Hi Alex,

    Here area couple of things to consider.
    Is it the first time memory is being allocated? And is this the only time memory is being allocated?

    What is the heap size? This can be found in the linker command file in the project. 

    Regards,

    Sid

  • Hi Sid,

    thanks to your hints I was able to solve the problem. No, it wasn't the first time memory was allocated, but the heap size was only 0x4000 (16384 Bytes) and the heap memory was too full to allocate an additional 13200 Bytes. So that was an easy fix and I doubled the heap size to 0x8000 and it now works.

    Thank you.