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.

CC2640R2F: PDM Driver

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2540

Hi everyone,

I am using stack simplelink_cc2640r2_sdk_1_50_00_58 with the PDM driver included.

I found heapmgrMemFail after enable BOARD_DISPLAY_UART, so I enable CACHE_AS_RAM and AUX_AS_RAM, no heapmgrMemFail anymore, the total heap size is 11411 ( I checked the heap_start and heap_end in .map)

But when I test with 1kHz sinewave with CC2540 USB, there is package drop after 15 to 20 seconds..

If I disable CACHE_AS_RAM and disable BOARD_DISPLAY_UART, it doesn't have package drop over 30 seconds!

Does the CACHE_AS_RAM affect the performance? How can I improve the audio quality?

I check the above Sean's answer but not really understand point no 5. from

 "If none of that works you can devise a static buffer approach where you statically allocate a pool of voice buffers in the hid_adv_remote app. Then you can modify the HIDAdvRemote_audioMalloc and HIDAdvRemote_audioFree to use buffers from that pool. This guarantees that malloc will never fail on voice transmissions but will pinch the overall heap size available down because the heap shrinks as .bss increases. "

Please advise how to do that or is there other way to improve the package drop.. thank you very much!!

Best regards

David

  • Hi David,
    I believe we need to figure out where the audio packet drop is occurring, since the BLE protocol is designed to not drop any packets at all. Are you able to verify if all audio data is successfully transmitted OTA? I am specifically a bit uncertain on the capabilities of the CC2540 side.

    Have you looked at the BLE audio example from github.com/.../simplelink_sdk-1.50 ?
  • Hi Joakim,

    I didn't try the BLE audio example, it seems has big difference to hid_adv_remote example.

    I tried following setting:
    1. Disable CACHE_AS_RAM and diable BOARD_UART_DISPLAY , no audio drop
    2. Enable CACHE_AS_RAM in bim and app -> Audio drop happen!

    3. Enable CACHE_AS_RAM in bim and app , but I comment the .bss to GPRAM in cc26xx_app_oad.cmd, add .bss back to SRAM, audio drop also happen...
    //.bss :0
    // {
    // (.bss)
    // } > GPRAM

    I didn't change program code, why enable CACHE_AS_RAM will cause the audio drop?

    Is there any help if I increase the PDM_TASK_STACK_SIZE or HAR_AUDIO_MAX_ALLOC_BUF ?

    Best regards
    David
  • Hi David,
    I am personally a bit clueless when it comes to BLE Audio. However, have you read the chapter "Using the Cache as RAM" in the BLE users guide thoroughly? The section got updated with the SDK v2.20;

    dev.ti.com/.../