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.

RTOS/LAUNCHXL-CC1350-4: Subscript overrun in pdmstream example.

Part Number: LAUNCHXL-CC1350-4


Tool/software: TI-RTOS

Once I got the pdmstream example built and running I found a bug in pdmstream.c on line 416 -- 

SA_processPDMData() calls SA_envelopeDetector with the 2nd argument AUDIO_BUF_UNCOMPRESSED_SIZE (buffer size in bytes!) but the formal parameter is numOfSamples, which is used to index through the buffer of uint_16.  To get meaningful results out of SA_envelopeDetector I changed the function call to this:

             current = SA_envelopeDetector((int16_t *)bufferRequest.buffer->pBuffer,
                                                  AUDIO_BUF_UNCOMPRESSED_SIZE/sizeof(int16_t)); // want size in int_16!

Now the "Volume" number in the serial output makes sense.

A bug fix would be appreciated.

Thanks,

Rich

.