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.

CC3235MODASF: CC3235MODASF SPI driver communication size

Part Number: CC3235MODASF

Tool/software:

Hello experts,

I have a question about SPI communication with the CC3235MODASF WiFi module.

I am using the TI-Drivers SPI driver API to perform SPI communication.

The CC3235 acts as a slave and receives data from the master.

I am having issues with SPI communication being unable to be performed correctly depending on the size of the communication data.

As far as I have checked, it works fine up to a communication size of 1024, but when communicating with a size exceeding 1024, the callback function is not called.

Are there any restrictions on communication size when using the SPI driver API with CC3235MODASF?

Below is a portion of the verification code.

    SPI_init();

    SPI_Params_init(&spiParams);
    spiParams.frameFormat         = SPI_POL1_PHA1;
    spiParams.mode                = SPI_PERIPHERAL;
    spiParams.transferCallbackFxn = transferCompleteFxn;
    spiParams.transferMode        = SPI_MODE_CALLBACK;
    spiParams.bitRate             = 20000000;    //20M
    peripheralSpi                 = SPI_open(CONFIG_SPI_PERIPHERAL, &spiParams);
    
    transaction.count = SPI_MSG_LENGTH;    //under 1025 OK, over 1025 NG
    transaction.txBuf = (void *)peripheralTxBuffer;
    transaction.rxBuf = (void *)peripheralRxBuffer;
    
    bool transferOK;
    transferOK = SPI_transfer(peripheralSpi, &transaction);
    if(transferOK)
    {
        /* Wait until transfer has completed */
        sem_wait(&peripheralSem);
    }

Best regards
Egawa

  • Egawa,

    transfering more than 1024 should work.

    The DMA channel is limited to 1024 bytes but the driver is developed in a way that it will send dat a in chunks.

    Please check the logic trace and see. if the data coming out of the device.

  • Hi AB,

    Thank you for your reply.

    To check the data output of the device,
    I measured the waveform of the SPI communication with an oscilloscope.

    From the waveform I checked, it looked like 2048 bytes of data were being output from the master,
    but the callback function was not being called.

    After that, I paid attention to the 1024 byte limit you mentioned in your reply,
    and added a wait of about 50 usec every 1024 bytes in the SPI communication,
    and the callback function began to be called.

    I would like to avoid adding a wait if possible,
    but is this wait a necessary process?

    I have attached an image of the oscilloscope waveform for reference.
    The signals are 1: MOSI, 2: CLK, 3: MISO, 4: CS.

    Egawa

  • a wait should not be needed.

    where did you implement this wait/sleep?

  • Hi AB,

    Thank you for your reply.

    The wait every 1024 bytes is implemented in the SPI master program.
    A process has been added to wait for a fixed period of time using a timer after sending 1024 bytes of SPI communication.

    In my test environment, when 2048 bytes of SPI communication are performed without waiting,
    the data prepared by the slave (CC3235) is not output from MISO,
    and there is a short period of time when the data input from MOSI cannot be obtained.

    I have attached an image of the waveform measured around 1024 bytes in the above communication.
    The signals are 1: MOSI, 2: CLK, 3: MISO, 4: CS.

    Overall waveform


    Enlarged waveform


    Egawa