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.

BLE SPI interrupt problem

Other Parts Discussed in Thread: CC2541

Hi,   I am using CC2541 BLE and implementing monitoring application. I am sending data to CC2541 from ARM processor over SPI bus. I have initialized SPI module in CC2541 application firmware to collect data from microcontroller and enabled interrupt. But when I run my program then some time I don't get any data in SPI interrupt. I am sending data to CC2541 at fixed interval from microcontroller but SPI interrupt occur intermittently. It's gets disabled automatically Can someone guide me to solve this issue?

Warm Regards,

Sarang.

  • Hi,

    First of all, please upgrade to v1.4.1 of the BLE SDK if you have not already done so, as an intermittent SPI  bug was fixed (encryption cleared DMA flag which could mess around with the SPI DMA).

    Also, have a look at this document for some reference. http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-files/538/3583.BLE-SPI-Driver-Design-External.pdf

    If you are using power saving, you need to take into consideration the MRDY pin and the SRDY pin which are responsible for shaking the device awake. Give it a go with power saving disabled just to see if this is the issue - project options -> preprocessor defines -> change POWER_SAVING to xPOWER_SAVING.

    Best regards,
    Aslak

  • Dear Aslak,

                 Thanks for suggestion. I have downloaded new version 1.4.1 of  BLE stack. Now my SPI interrupt is working fine, but my device is not detected by android app with this version. If I use older version of stack  then it is detected. Pl. share some thought on this

    Best Regards,

    Sarang

  • Dear Aslak,

         Here are some more observation ,

         New version of stack 1.4.1 is working fine and device is being detected now. It was because I had not enabled advertising.

        Now I am sending 20 bytes from micro-controller to CC2541 over SPI at rate of 2 second. As previously my SPI interrupt was getting

      disable in between automatically that problem is solved when I disabled power saving mode. It work for old version 1.4.0 also.

      Now code (ISR) which I have written to receive 20 byte works well when run independently without stack and BLE application.

      But same code with BLE application gives me problem. Sometime interrupt is not generated and I miss whole packet or sometime 

       only few bytes of packet are received.

      Here is snippet of ISR code

    #pragma vector = 0x13
    __interrupt void UART0_RX_ISR(void)
    {

                 Rx_Data_Buff[Rx_Data_Index]= U0DBUF;          //Received Packet byte

       if( Rx_Data_Buff[Rx_Data_Index]==0xFF){         //Check Packet start
              Rx_Data_Index = 0;
            Rx_Data_Buff[Rx_Data_Index] = 0xFF;
        }
        Rx_Data_Index++;                                                 //Increment buffer index

    if(Rx_Data_Index>=20)                                           // Check packet end and roll back buffer index
    {
           Rx_Data_Index = 0;
           Racket_Received = 1;                                     // Indicate stack that packet is received
           P0 ^= 0x08;                                                        //Toggle IO pin for testing purpose
    }

    }

    Best Regards,

    Sarang