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.

CC2540 SPI SLAVE with MCU SPI MASTER USING HCI

Other Parts Discussed in Thread: CC2540, CC2541

Hello to everyone,

I am trying for weeks now to understand which project should I use to make a simple connection between my MCU and the CC2540.

My MCU is a SPI Master and the CC2540 an SPI Slave.  I have successfully sent and received bytes between them, but only as a 8051.  I want now to use the HCI protocol in order for the MCU to send HCI commands to the CC2540 and change some parameters.  For starters I would like to know, if someone has done it, is to what project should I open to alter in order to achieve this.  I am currently heading towards the  Host Test Release project (CC2540SPI).  Is this a good starting point?  In order to modify the hal_board_cfg.h?

 

Thanx in advance,

 

Georgios

  • Hi Georgios,

    We have a wiki page that describes the different ways of using CC254x as a "network processor", more info is found here: http://processors.wiki.ti.com/index.php/CC254X_WITH_EXT_MCU 

    Best Regards

    Joakim 

  • Hi there Joakim,

    The link doesn't exist :(

    Also I have read about the external MCU.  It says that:

    The HostTestRelease project (included with standard BLE SDK) is the standard BLE Network Processor application. It can be loaded on the CC2540 or CC2541, with the any of the following used as a network processor interface:

    1. UART
    2. SPI
    3. USB CDC virtual UART (CC2540 only)

     


    So Which of the HostTestRelease project should I use?  And do I need to make any altering to the project or will the MCU sending and HCI command will successfully communicate without anything else.

  • Hi Georgios,

    The HostTestRelease is one project and you should use the SPI build if you want to use SPI (Recommended). It will compile to fully parse HCI command. The SPI design guide is attached:

    3583.BLE SPI Driver Design External.pdf

    By the way, I repaired the link.

    Best Regards

    Joakim

  • Hi Joakim,

    Thank you for the pdf.  It is really helpfull.  My concern is that my MCU has more than one SPI so I control them via different CS's.  There is no need for the other SPI peripherals of the SRDY pin.  As I understand, correct me if I'm wrong, that the CC2540 working as a Slave needs to have a pin for SRDY, so another pin on my MCU must be used to poll it in order for me to be able to send from the MCU the Frames.

    For the time being I have implemented the following connection:

    MCU CC2540
    SDI MISO (P0.2)
    SDO MOSI (P0.3)
    CS SS (P0.4)
    SCLK CLOCK (P0.5)

    Do I have to put a GPIO on my MCU (Master) connected to CC2540 (Slave) on pin P1.1?  Or is it possible with the above connection to be able to communicagte with the CC2540.

    Thank you in advance,

    Georgios

  • Georgios, did you ever get an answer to your question? I'm running into the same issue, I have a connection bewteen a MCU master and CC2540 Slave *without* the SRDY line on P1.1 connected to anything. I'd presume the CC2540 could still receive incoming commands from the master over SPI, it just wouldn't be able to alert the master when it had data to transmit back.

    If you got this working, do you have an example set of SPI bytes you sent from the master? I've translated several HCI commands into the desired SPI packet format, but am getting no feedback or response from the chip, so I don't know if there's something wrong with the chip firmware, or with the bytes I'm sending down.

    Thanks,

    Michael

  • Hello,

    Has anyone achieved this in order to give us some guidelines, please?

    I am trying the HostTestRelease Project (Stack 1.4.1) and more specifically, the CC2540SPI version on cc2540  with 128K flash.

    and the the preprocessor settings :

    INT_HEAP_LEN=3072

    HALNODEBUG

    OSAL_CBTIMER_NUM_TASKS=1

    HAL_AES_DMA=TRUE

    HAL_DMA=TRUE

    xPOWER_SAVING

    xPLUS_BROADCASTER

    HAL_LCD=TRUE

    HAL_LED=FALSE

    SERIAL_INTERFACE

    HAL_UART=TRUE

    HAL_UART_DMA=1

    HAL_UART_ISR=0

    HAL_KEY=FALSE

    GATT_DB_OFF_CHIP

    and I get this error:

    Could anyone help me please?

  • Hello,

    Some of the threads you are posting to are very old. In order for TI to provide the best support, can you consolidate your questions and your steps to reproduce into a single thread so that TI may support you from there. You can leave these threads active for the community to comment on, but I would recommend that you create a single new post for us to support you on. Thank you for your understanding!