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/IWR1642BOOST: adding SPI to pplcount_16xx DemoSoftware

Other Parts Discussed in Thread: IWR1642

Hello Ladies and Gents,

my Goal is to add the SPI functionality to the pplcount_16xx DemoSoftware found in the IndustrialToolbox. I want to achieve this to send the People_Count via SPI to an external Device (LoRaWAN module). But I have got kinda some Problems so tried different approaches.

First of all I have tried to use the ProjectSpec I did find in this Forum made by ej99 just to test the SPI functionality via the SPI_DemoSoftware.

https://e2e.ti.com/support/sensors/f/1023/p/686601/2532025 

After Importing the ProjectSpec and rebuilding it I get some Errors as seen in Picture 1. After solving these by replacing the MMWAVE_L3RAM_SIZE Define with an actual Integer Value I have found in several other DemoProjects(as seen in Picture 2) the Code is running without any Errors... But as soon as I flash the Code to my IWR1642_BOOST DS1 does glow red. (This should indicate an actual HW Error) Is this caused due to my change I have made to the MMWAVE_L3RAM_SIZE? Or do I have some other issues with this Software/my Hardware?

After not achieving anything in quiet some time I also tried to add the SPI to the pplcount_16xx DemoSoftware by adding Code to the mss_main.c. Since the Project has two Mains I did some researchand I did find some information that I need to add the Code only to the mss section. Is this right?

So I just gave it a try and added the PINMUX settings just as like in the SPI Driver to my mss_main.c (pplcount_16xx_mss) then I added the SPI_Init() and afterwards the Master/Slave parameters andthe SPI_Open() just like in the Doxygen Documentary to my MmwDemo_mssInitTask. (Did I miss anything important already?) Till this point I had no Errors nor any issues with the Functionality of the pplcount_16xx.

Since I want to add the SPI but keep the UART still remaining and also the GUI I tried to add the SPI_Transfer() Function beneath the UART_WRITE() in the task_mbox.c. The reason why I added the SPI_Transfer()there is because I believe that this is the easiest way I might get the right Data (amount of detected Objects/People) since I did not find any other parameters except the target List I do send via UART containing the amount of Ppl. But by adding the SPI_Transfer() my Program just crashes after a short amount of time and the GUI does not respond anymore. So it seems just like the SPI_Transfer() might result in adeadlock due to some issues. So here is the Question do I miss anything important and what do I need to do to make it work? Or is it not possible to run UART and SPI at the same time?

Thanks!

Greets Oliver.



  • Hi Oliver,

    As of now, we do not have an existing application demo example to output the data over SPI. However, please allow us a few days to look into this. We will get back to you by Friday.

    Thanks

    -Nitin

  • Hi Oliver,

    The CCS project you referred to (provided by ej99 as you noted) is based on a very old version of mmwave SDK, version 1.2.0.5 which was used for pre-production version of IWR1642 silicon. Binaries compiled with this sdk-version are not compatible with the production version of the device, which is why you may be getting the error when you flashed the binary.

    Which SDK version are you using? You need to use mmWave SDK 2.1.0.4 which is compatible with the production silicon.

    I would suggest you to build the SPI driver test provided in this SDK using the provided makefile. The makefile based build process is documented in the SDK user guide under docs directory. 

    Please first make sure that you are able to run the SPI driver unit test on your EVM before you proceed to adding SPI output related code to an application demo.

    Thanks

    -Nitin   

  • Hello Nitin,

    sorry for the late response. I have just tested some different things and ended up setting up a complete new Project. But it is working now !

    I had to change the SDK ( working now with SDK2.0.0.4) and to do some soldering since R4 were missing and that was kinda the reason why I was not getting any Data even so I had a CLK for a while.

    But now I have another question for you.

    I am trying to send the amount of detected people via SPI. Where do I find this information? Right now I have tried many variables in the task_mbox.c but I could not find the right one. If I am right the srcAddress->outputToTracker.object_count; is just the amount of "Detection Points" shown in the GUI. But I would like to have the "People Count" shown in the GUI.

    Where do I find the responsible variable?

    Thanks

    -Oliver

  • Hi Oliver,

    Please look at the following code in MmwDemo_mboxReadTask, where all the information is written to the output UART

                        UART_write (gMmwMssMCB.loggingUartHandle, (uint8_t *)&outputMessage, sizeof(MmwDemo_output_message_header));
    
                        if(gMmwMssMCB.pointCloud->header.length && gMmwMssMCB.pcEnable) {
                            /* If any points detected, send Point Cloud TLV */
                            UART_write (gMmwMssMCB.loggingUartHandle, (uint8_t *)gMmwMssMCB.pointCloud, gMmwMssMCB.pointCloud->header.length);
                        }
    
                        if(gMmwMssMCB.targetDescrHandle->tList[sendDescr]->header.length) {
                            /* If any targets tracked, send send target List TLV  */
                            UART_write (gMmwMssMCB.loggingUartHandle, (uint8_t *)gMmwMssMCB.targetDescrHandle->tList[sendDescr], gMmwMssMCB.targetDescrHandle->tList[sendDescr]->header.length);
                        }
    
                        if(gMmwMssMCB.targetDescrHandle->tIndex[sendDescr]->header.length) {
                            /* If exists, send target Index TLV  */
                            UART_write (gMmwMssMCB.loggingUartHandle, (uint8_t *)gMmwMssMCB.targetDescrHandle->tIndex[sendDescr], gMmwMssMCB.targetDescrHandle->tIndex[sendDescr]->header.length);
                        }
                        //GPIO_toggle(SOC_XWR16XX_PINP5_PADBG);

    The list of detected targets and target Indices are sent out in the tList and tIndex TLVs.

    Thanks

    -Nitin