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.

cc3100 spi driver for cc430

Other Parts Discussed in Thread: CC430F5137, CC3100, UNIFLASH

Hello,

I have interfaced cc3100 chip with cc430f5137 on SPI interface. I have ported spi drivers to cc430 from cc3100 sdk sample application.

I have run SPI debug tool application to verify the connection but it fails on SPI read and device goes to endless loop.

Please help me here if any idea what could be wrong? The pin connection of SPI is verified.

Thanks,

Parth

  • Hi Parth,

    Can you please share some more details about setup and configuration, like Spi configuration you are using on cc430f5137 board? which pins of cc3100 are connected with mcu?

    For spi configuration related details you can refer to host interface guide.

    http://processors.wiki.ti.com/index.php/CC31xx_Host_Interface

    http://processors.wiki.ti.com/index.php/CC31xx_SPI_Host_Interface

    Regards,

    Ankur

  • Hello Ankur,

    Thanks for replying.
    I have connected cc430f5137 as a master with 3100. Following are the port allocation for cc430f5137:
    P1.5 MISO
    P1.6 MOSI
    P1.7 CLK
    P1.4 IRQ
    P1.1 CS
    P1.0 HIB

    Following ismy modified spi_open function from spi_debugging_tool example:

    /* Select the SPI lines: MISO/MOSI on P1.5,6 CLK on P1.7 */

    P1SEL |= (BIT5 + BIT6);

    P1REN |= BIT6;
    P1OUT |= BIT6;

    P1SEL |= BIT7;

    UCB0CTL1 |= UCSWRST; /* Put state machine in reset */
    UCB0CTL0 = UCMSB + UCMST + UCSYNC + UCCKPH; /* 3-pin, 8-bit SPI master */

    UCB0CTL1 = UCSWRST + UCSSEL_2; /* Use SMCLK, keep RESET */

    /* Set SPI clock */
    UCB0BR0 = 0x02; /* f_UCxCLK = 25MHz/2 */
    UCB0BR1 = 0;
    UCB0CTL1 &= ~UCSWRST;



    /* P1.0 - WLAN enable full DS */
    P1SEL &= ~BIT0;
    P1OUT &= ~BIT0;
    P1DIR |= BIT0;

    /* Configure SPI IRQ line on P1.4 */
    P1DIR &= ~BIT4;
    P1SEL &= ~BIT4;

    P1REN |= BIT4;


    /* Configure the SPI CS to be on P1.1 */
    P1OUT |= BIT1;
    P1SEL &= ~BIT1;
    P1DIR |= BIT1;

    /* 50 ms delay */
    //Delay(50);

    /* Enable WLAN interrupt */
    CC3100_InterruptEnable();

    return NONOS_RET_OK;


    Let me know if I am missing anything.
    The spi test fails on reading. In spi_debugtool example it tries to match the sync pattern.
    I am in need of a simple test to verify my spi connection and to conclude that 3100 response on spi commands correctly.

    Appreciate you help here.

    Thanks,
    Parth
  • Hello Ankur,

    I am able to solve the problem and now spi test passes with all tests.
    Now, I am trying to run the sample application "getting_started_with_wlan_station" form simplelink sdk,
    But when it reached the point of setting wlan policy, it return error code.

    /* Set connection policy to Auto + SmartConfig (Device's default connection policy) */
    retVal = sl_WlanPolicySet(SL_POLICY_CONNECTION, SL_CONNECTION_POLICY(1, 0, 0, 0, 1), NULL, 0);
    ASSERT_ON_ERROR(retVal);

    retVal returns -7 value. I see some other thread raising this problem, but couldn't find perfect answer for this.
    Can you please help me here, is this known issue?

    Thanks,
    Parth
  • Hi Parthraj,

    -7 error corresponds to the CC3100 file system. It seems that device is not able to access the file system.
    Can you try formatting the serial flash and updating the service pack?
    Please refer to uniflash user guide for deatils.
    http://processors.wiki.ti.com/index.php/CC31xx_%26_CC32xx_UniFlash_Quick_Start_Guide

    Regards,
    Ankur
  • Hi Ankur,

    Thanks for the information.
    Is there anyway I can use cc3100 without file system/serial flash?

    Thanks,
    Parthraj
  • The problem I am having is, I have not put the provision of UART tx/rx to program the serial flash.
    CC3100 has only SPI connection with host cc430f5137.
    And Uniflash can format serial flash over uart connection to 3100 which I am not having right now.
    So, is there any work around way that I can format flash via host controller?
    Appreciate your help here.

    Thanks,
    Parthraj
  • Hi Parthraj,

    The serial flash/file system is used to store the system configuration file along with user file and you can't bypass the same.

    Formatting the serial flash via host controller is not supported and its always advised to route uart rx/tx to header or test point on the board.

    Regards,
    Ankur
  • Hi Parthraj,

    I am closing this thread, for follow up query please open a new thread with a link to this one for reference.

    Regards,
    Ankur
  • Hello Ankur,

    formatting the flash and service pack update resolved the issue.

    Thanks for your support,
    Parth