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.

SPI transfer callback not received

Other Parts Discussed in Thread: CC2640, CC2650

Hi all,

We are developing a smartwach, using CC2640 as secondary MCU, and connected as slave over SPI bus with a master MCU (Freescale MKL27).

We have implemented NPI, using the model provided in the SDK and demo samples. SPI is configured in non-blocking mode:

   spiParams.transferMode = SPI_MODE_CALLBACK;

We have periodic transfers from slave (CC2640) to master. They go normally during some minutes, but then SPI transfer callback is not received for a transfer, and this blocks consecutive transfers (since SRDY line is deactivated in this callback, and consecutive transfers find bus busy. Also we are trying to disable SRDY and reuse SPI for consecutive transfers, but this is failing).

So, could anybody help us understand why SPI transfer callback stops being received? Our NPI implementation is almost 100% the one provided in the original ble sdk (configuring suitable pinout for our custom board, and not much more changes).

We are investigating some other ways, as configuring SPI in blocking mode, etc., since this is a blocking problem in our project.

Thank you very much.

Regards.

  • Hi,
    Some more details, in case they can help:

    * We are using TI-RTOS 2.11.1.09
    * We are using CC2650_SPI1 for this purpose. In SPI0, CC2640 is acting as a master for an accelerometer+gyroscope.
    * This is our SPI config:
    spiParams.mode = SPI_SLAVE;
    spiParams.bitRate = SPI_SLAVE_BAUD_RATE; // 8000000
    spiParams.frameFormat = SPI_POL1_PHA1;
    spiParams.transferMode = SPI_MODE_CALLBACK;
    spiParams.transferCallbackFxn = NPITLSPI_CallBack;

    Thank you.
  • Hello,

    Your top-level settings look correct, so I would use the debugger to inspect the SSI registers and, in possible, correlate the behavior to a bus trace. Checking for any errors in the SSI registers would be a good first step.

    I would also recommend using BLE 2.1 with the 2.13 TI-RTOS driver package.

    Best wishes
  • Hi JXS,

    At the end, we have found the problem: everything was OK in the CC2640 side. The problem was a stack overflow on the master (Freescale) side, so it stopped responding and callback was never received as transfer was never completed.

    Thank you very much for your support, and we take note off you indications about updating our sdk.

    Regards.

    José Antonio Martínez

  • Hi Sontono,

    Thanks for letting us know!
    I do recommend taking a look at the TI-RTOS release notes to see if any errata have been addressed that could impact you later. In many cases, you can just update the driver and make any control structure changes in your code.

    Best wishes