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.

CCS/IWR6843: "SPI_transfer" not work in "MmwDemo_mboxReadTask"

Part Number: IWR6843
Other Parts Discussed in Thread: MMWAVEICBOOST

Tool/software: Code Composer Studio

Hi sir,

I had migrated the "C:\ti\mmwave_automotive_toolbox_2_9_1\labs\lab0002_short_range_radar" demo code to IWR6843 and it worked.

But there's some problem about SPI function.

I refer to the driver SPI demo code and merge in the mss_main.c.

When I call the function "Test_XWR1xxxWithXWR1xxx" in "main" or "SRR_MSS_initTask" and choose the SPI master mode.

It can measure the SPI-CLK and SPI-MOSI by oscilloscope.

But when I call the function "Test_XWR1xxxWithXWR1xxx" in "MmwDemo_mboxReadTask" , there's no SPI-MOSI signal at all.(SPI-CLK still work)

I had check the SPI txBuf before "SPI_transfer" and it has the normal value.

please help to clarify these problem A.S.A.P.

Ps."Test_XWR1xxxWithXWR1xxx" is the function from driver/SPI test code.

BR

Thanks

Frank

  • Hi sir,

    Any update?

    Is there possible the root cause is about the task size or task priority?

    BR

    Thanks

    Frank

  • Hi ,

    How did you solve that issue? I can make SPI_open successfully, but SPI_transfer didn't perform. I'd appreciate if you can share your code or tell me the way to solve it.

  • My root cause is I re-defined GPIO pin in another function.

    After I mark it the SPI is worked.

    FYI

    BR

  • Hi Silkworm,

    1. Do you mean GPIO pinmux settings?

    2. I modified SPI code in SDK -> driver->test folder. It doesn't contain any GPIO settings. Do you come up with another cause based on my code below?

        SPI_Params     params;
        SPI_Handle     handle;
    
        SPI_Params_init(&params);
    
        params.mode = SPI_SLAVE;
        params.u.slaveParams.dmaCfg.txDmaChanNum =1U;
        params.u.slaveParams.dmaCfg.rxDmaChanNum =0U;
    
        /* Enable DMA and set DMA channels */
        params.dmaEnable = 1;
        params.dmaHandle = gDmaHandle;
    
        params.frameFormat = SPI_POL0_PHA0;
        params.pinMode = SPI_PINMODE_4PIN_CS;
        params.transferMode = SPI_MODE_BLOCKING;
        params.transferTimeout = SPI_WAIT_FOREVER;
        params.bitRate  = 1000000;
        params.dataSize = 8;
    
        handle = SPI_open(0, &params);
        if (handle == NULL)
        {
            System_printf("Error: Unable to open the SPI Instance\n");
            return;
        }
        System_printf("Debug: SPI Instance %p has been reopened in Slave Mode successfully\n", handle);   
            
        SPI_Transaction transaction;
    
        /* Configure Data Transfer */
    	transaction.count = SPI_TEST_MSGLEN;
    	transaction.txBuf = (void *)txBuf;
    	transaction.rxBuf = (void *)rxBuf;
        //transaction.slaveIndex = 0U;
    
        /* Start Data Transfer */
    	if (SPI_transfer(handle, &transaction) != true)
    	{
    		System_printf("Unsuccessful SPI transfer");
    	}
       
    	else
    	{
    		System_printf("SPI transfer OK\n");
    	}

  • I mean the another init function affect the SPI work.

    In my case is the CANFD init.

    After mark it my SPI function is work and I also refer to the driver test code too.

    FYI

    BR

    Thanks

  • Previously, I also couldn't run UART and SPI simultaneously. But after changed some parameters of SPI, UART can run via GUI demo. Even though I solved that issue, I'm still a little unclear about the way to make multiple tasks run simultaneously. Do u have any idea how to make SPI and CAN-FD run simultaneously without having to mark one of them?

  • Hi Hector,

    SPI and CAN-FD are multiplexed on the MMWAVEICBOOST carrier card as mentioned the MMWAVEICBOOST and Antenna Module user guide, section 2.7.6 CAN Connector (J1 and J2). Only one path can be selected using the switch S1. So you cannot use them simultaneously to output data on both in the demo application.

    Regards

    -Nitin