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.

CC3200MODLAUNCHXL: Using GPIO for SPI CS

Part Number: CC3200MODLAUNCHXL

Hello -

I am having trouble using GPIO as a chip select.  I am going to be driving multiple slaves in the future so I wanted to try and start using a GPIO pin for CS right now so that I don't run into problems in the future.  In my pinmux.c, I switch the pin08 from an SPI CS pin to a GPIO pin and I am using that as my GPIO CS.  I've checked on the scope and the pin goes low then high (it is a CSn) for the first SPI transaction, but for the second one, it doesn't do anything and my program hangs.  On the scope, it doesn't go low either.  For the first SPI transaction, where the GPIO CS pin actually goes low then high, no data comes into the CC3200 (it is a master trying to read a static value on the slave).  How come my code hangs the second time and I am unable to read?

My code is as such:

pinmux.c -

    MAP_PRCMPeripheralClkEnable(PRCM_GPIOA2, PRCM_RUN_MODE_CLK);

    // Configure PIN_08 for SPI0 GSPI_CS
    //
    //MAP_PinTypeSPI(PIN_08, PIN_MODE_7);
 MAP_PinTypeGPIO(PIN_08, PIN_MODE_0, false);
 MAP_GPIODirModeSet(GPIOA2_BASE, 0x2, GPIO_DIR_MODE_OUT);

main.c -

MAP_SPIConfigSetExpClk(GSPI_BASE,MAP_PRCMPeripheralClockGet(PRCM_GSPI),
                     SPI_IF_BIT_RATE,SPI_MODE_MASTER,SPI_SUB_MODE_0,
                     (SPI_HW_CTRL_CS |
                     SPI_4PIN_MODE |
                     SPI_TURBO_ON |
                     SPI_CS_ACTIVELOW |
                     SPI_WL_8));

MAP_uDMAChannelTransferSet(UDMA_CH30_GSPI_RX,UDMA_MODE_BASIC,
         (void *)(GSPI_BASE + MCSPI_O_RX0),
         DATABuffrx,
         DATA_BUFF_SIZE);
   MAP_uDMAChannelEnable(UDMA_CH30_GSPI_RX);
   
   MAP_uDMAChannelTransferSet(UDMA_CH31_GSPI_TX,UDMA_MODE_BASIC,
         DATABufftx,
         (void *)(GSPI_BASE + MCSPI_O_TX0),
         DATA_BUFF_SIZE);
   MAP_uDMAChannelEnable(UDMA_CH31_GSPI_TX);
   
   //MAP_SPICSEnable(GSPI_BASE);
   MAP_GPIOPinWrite(GPIOA2_BASE,GPIO_PIN_1,0);
   
   while (!transfer_status);
   transfer_status = 0;
   
   //MAP_SPICSDisable(GSPI_BASE); 
   MAP_GPIOPinWrite(GPIOA2_BASE,GPIO_PIN_1,GPIO_PIN_1);