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: CC1352 I2S Issue

Other Parts Discussed in Thread: CC1352P

Tool/software: TI-RTOS

Hello,

 

Although TI does not currently provide any high level interface for playing audio, we were able to create a simple wave file player for the CC1352 using the provided (somewhat crude) driver.

Basically this logic reads the wave data chunk by chunk from the external flash, then it feeds the buffer to the I2S DMA buffers, and using an externally attached I2S amplifier chip, the thing plays well.

However, there’s a problem:

Whenever a code access the external flash (using the SPI-DMA driver for a write operation, the playback stops, we don’t get any error interrupt (in the I2S_DMA handler), it simply stops.

A logic view on the I2S DATA line at point shows some sort of repetitive pattern the translates to a noise that sounds like clicks.

This has become even stranger since in order to break the I2S, awe need to do SPI write operation prior or while playing and everything breaks down.

We get no assertion, no error, a chunk of code that re-initializes the I2S registers along with the DMA pointers does not fix this.

After we hit this condition, the only viable “fix” is to perform a hardware reset and block SPI -Write completely.

Is there any relation between the I2S to the SPI TX DAM ?

We could not figure which DMA channels are being used by the I2S peripheral.

 

Any Clue ?

  • Hi Eitan,

    I will look into this and see what I can find out. The I2S module has its own DMA while the SPI driver is useing the uDMA, I will need to check the internal prioritization between these.

    For the external flash, what SPI interface are you using, 0 or 1? Also, I assume you are using the NVS driver, is this correct?
    What SDK version are you currently basing the application on?
  • Hi,

    SDK: 2.10.0.48

    Using NVS Driver  to access the ext. flash on  SPI0 (working on the  the CC1352 LaunchPad)

    10X

  • Thanks,

    I'm curious to see if this has to do with the NVS drivers constant polling to check if the erase has been performed. During the NVS write, are you performing an erase as part of the write or is this done previously? If you do, could you test and see if it makes a difference if you do not perform an erase as part of the write (let's just assume the flash was magically erase before hand).

    Also, could you elaborate on what you are basing the "WAV driver" on? Are you re-using the I2S utils that the PDM driver uses or are you hacking the PDM driver in some way? In short, do you use a task for this as in the PDM driver, or is it all "interrupt" based?

  • You got any updates on this Eitan?
  • Hi,

    After fiddling with the code, I realized that this problem has to do with a custom made NVS driver we’re using,

    Background:

    The TI original NVS (external flash) is polling the ext. flash status register to know when an erase sector command is done. We use a different approach (offered by TI) that uses timer that is triggered to the expected erase time, and only then we check the status register. This modification allows the system to work while we erase many flash sectors at once. I’m not sure how and why this driver modification is causing the problem but once I will figure this out I will post it here on tis forum.

    Our player implementation is a hack on the SDK PDM sample, I’m attaching my code so you can go through it and let me know if I’m on the right track.

    This code could probably also help anyone who is interested to play audio using I2S on the CC1352p

     

    10x

    Eitan.

    MINIPlayer.zip

  • Hi Eitan,

    I will have a look at the code, thanks for sharing. Regarding the NVS driver, a fix for the constant erase polling is in the works to get implemented for future SDK releases. I'm a bit puzzled (as you) to why the "timer fix" in the NVS driver affected the I2S DMA.

    As an heads up, there is also plans for an actual I2S driver to be released in the future instead of the "I2S utils" that comes with the PDM driver.

    Best regards,

    Max