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.

IWRL6844EVM: Transfer UART data over SPI

Part Number: IWRL6844EVM
Other Parts Discussed in Thread: IWRL6844, SYSCONFIG

Tool/software:

Hi team,

Currently I am using the mmwave demo for the IWRL6844 device from the mmwave low power sdk: 06_00_04_01.

My requirement is to transfer the processed data through the SPI.

I added the belo code in the MmwDemo_transmitProcessedOutputTask()

This was done in reference provided in the path: <TI_INSTALL_DIR>\MMWAVE_L_SDK_06_00_04_01\mmwave_l_sdk_06_00_04_01\examples\drivers\mcspi\mcspi_loopback\mcspi_loopback.c

The build and flash was successful, but the firmware is stuck after the sensorStart 0 0 0 0 command.

The steps involved as per the example provided are:

1. PiN muxing

2. MCSPI open

3. MCSPI_transactionInit

4. MCSPI Transfer after modifying the transaction structure.

Since pin muxing and the driver open are already done, I added only the following code:

    char txBuffer[10] = {'H','e','l','l','o'};
    MCSPI_Transaction spiTransaction;
    uint transferOK;
    MCSPI_Transaction_init(&spiTransaction);
    spiTransaction.channel  = gConfigMcspi0ChCfg[0].chNum;
    spiTransaction.dataSize = 8;
    spiTransaction.csDisable = TRUE;
    spiTransaction.count    = 10 / (spiTransaction.dataSize/8);
    spiTransaction.txBuf = (void *)txBuffer;
    spiTransaction.rxBuf = NULL;
    spiTransaction.args = NULL;

    transferOK = MCSPI_transfer(gMmwMssMCB.mcspiHandle, &spiTransaction);

    CLI_write("TOK: %d\n",transferOK);

I also tried to print the transferOK variable, and nothing appears in the console.

Upon debugging the code, the code is stuck into an infinite loop when stepped inside the MCSPI_Transfer() function.

Help in resolving the issue,

Thanks in advance,

Poorneka T.

  • Hi Poorneka,

    Thank you for reaching out, please allow our SPI expert a few days to review your question and respond accordingly.

    Best,

    Vignesh K.

  • Hi Vignesh,

    Any update on this query?

    I tried one more experiment on this,

    Enabled the ADC logging in the SPI mode using the CLI command: adcLogging 2 and updated the code like below:

    char buffer[10] = "Hii";
    
    MCSPI_Transaction_init(&spiTransaction);
                    spiTransaction.channel  = gConfigMcspi0ChCfg[0].chNum;
                    spiTransaction.dataSize = 32;
                    spiTransaction.csDisable = TRUE;
                    spiTransaction.count    = 4;
                    spiTransaction.txBuf    = (void *)buffer;
                    spiTransaction.rxBuf    = NULL;
                    spiTransaction.args     = NULL;
                    CLI_write("SPI Raw Data Transfer start: %c\r\n",buffer[0]);
    
                    GPIO_pinWriteLow(gSPIHostIntrBaseAddrLed, gSPIHostIntrPinNumLed);
    
                    transferOK = MCSPI_transfer(gMcspiHandle[CONFIG_MCSPI0], &spiTransaction);
                    if(transferOK != 0)
                    {
                        CLI_write("SPI Raw Data Transfer Failed\r\n");
                    }
                    CLI_write("SPI Raw Data Transfer\r\n");

    Instead of transferrring the ADC data, I updated the SPI TX buffer with a local buffer.

    The code got hung up after the CLI print.

    Below is the switch settings used for the SPI transfer:

    Awaiting for your reply!!

  • Hey Poorneka,

    Sorry for the delay in reply here. Can you declare and assign an rxBuffer to spiTransaction.rxBuf and retest your first transaction?

    Regards,

    Kristien

  • Hi Kristein,

    I tried the above mentioed step. But my code hangs after the MCSPI_transfer. Please find the attached lods and the configuration file used for the above experiment:

    profile_2T4R_bpm.cfg

    Please confirm the switch settings for the above:

    S8 OFF
    S7 ON
    S5.1 OFF
    S5.2 OFF
    S1.1 OFF
    S1.2 OFF
    S1.3 ON
    S1.4 ON
    S1.5 ON
    S1.6 OFF
    S4.1 OFF
    S4.2 OFF
    S4.3 OFF
    S4.4 OFF
    S4.5 OFF
    S4.6 OFF
  • Hey Poorneka,

    Please turn on S4.3 since this muxes the SPI A to the SPI A header on the EVM. Otherwise, SPI transfers will end up failing.

    Regards,

    Kristien

  • Hey Poorneka,

    Please turn on S4.3 since this muxes the SPI A to the SPI A header on the EVM. Otherwise, SPI transfers will end up failing.

    Regards,

    Kristien

  • Hi Kristien,

    I still face the same issue even after changing the switch S4.3.

  • Hey Poorneka,

    Could you share where exactly in the MCSPI_transfer function that its failing? You mentioned earlier that the code is stuck in an infinite loop when stepping into the MCSPI_Transfer() function. Are you stuck in MCSPI_transferControllerPoll or MCSPI_transferPeripheralPoll? 

    I understand that you referenced the MCSPI Loopback example from the SDK during your integration, but could you share your SysConfig settings or do they match the loopback example?

    There may be a delay in response due to a holiday here in the U.S. on Monday.

    Thank you for your patience,

    Kristien

  • Hello i am facing similar issue. It gets stuck at MCSPI_Transfer. Could you pls support here.

  • Hey Mitraj,

    Thanks for reaching out regarding your SPI issue. To help keep the forum organized, could you open up a new thread with information about your particular issue and reply here with the new thread? This is to help separate out issues in case there is differences in context and will help for tracking purposes. I will reply on the new thread once its available.

    Regards,

    Kristien