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.

CC2640R2L: Facing problem with more Tasks

Part Number: CC2640R2L

Hi,

Configuration :

IAR Version – 8.32

SDK Version - simplelink_cc2640r2_sdk_4_20_00_04

Example – Simple Peripheral Observer (Customized example taken from TI )

Heap Size : Auto configured ( Kept default setting )

Priorities – Same for all tasks

 

Problem Statement :

 

We are using 7 tasks. Individual all task working fine.

 

While enabling - InitSpi_g( ) ( Without starting actual SPI transfer )

  • SimpleBLEPeripheralObserver_createTask() stops working means GAP Role is not getting started and is not coming out of Device_Init API.
  • UART_RxTaskConstruct_g( ) &  UART_TxTaskConstruct_g( ) stops working means Rx interrupt is not getting received.

Regards,

Bhavin P

  • Bhavin,

    Thanks for your question. I notified a colleague and he will reply as soon as possible.

    Regards,

    Rafael

  • Hello Bhavin,

    Thank you for all the information you have provided. I am not able to find any information on the InitSpi_g(). Is this a custom function? You may find the SPI examples we have available in the SDK useful. Specifically, you may find the spimaster and spislave projects helpful in implementing SPI on the CC2640R2. Can you verify if the way these projects implement SPI is similar to how you are implementing SPI in your project?

    Regards,

    Jan

  • Hi Jan,

    Please find 

    void InitSpi_g( void )
    {
      SPI_Params spiParams;

      SPI_init( ); // Initialize the SPI driver
      SPI_Params_init(&spiParams); // Initialize SPI parameters
      spiParams.dataSize = 8; // 8-bit data size
      spiParams.bitRate = 50000;
      spiParams.mode = SPI_MASTER;
      spiParams.frameFormat = SPI_POL0_PHA1;
      spiParams.transferMode = SPI_MODE_CALLBACK;
      spiParams.transferCallbackFxn = spiCallbackFxn;
      h_Spi = SPI_open(Board_SPI0, &spiParams);
      ConfigIntPin( );
      if (h_Spi == NULL)
      {
        while (1); // SPI_open() failed
      }
    }

    Regards,

    Bhavin P

  • Hello Bhavin,

    Upon comparing your code and the spimaster project, I am seeing some differences in the set-up procedure in the projects. I recommend looking into the spimaster.c project and seeing if you are able to set up your initializing to be in-line with what the spimaster project does. I also recommend taking a look at the following SLA labs

    1. Bluetooth Low Energy and TI Drivers - This lab specifically shows how to integrate TI drivers with the BLE stack

    2. Bluetooth Low Energy Fundamentals

    3. General RTOS Concepts

    4. POSIX Project Zero

    5. TI Drivers Project Zero

    Could you take a look at the spimaster as well as the provided labs and let me know if they were helpful?

    Regards,

    Jan