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.

RTOS/AWR1642: Read temperature from the temp sensor in awr1642

Part Number: AWR1642

Tool/software: TI-RTOS

Hello,

experts, I'm working on getting the chip temperaturte when awr1642 is working. I know in the demo, there is rlRfGetTemperatureReport() API which we can call to make it. And i add this API into the sdk_01_01_00_02 as follow:

static int GetTemperature(void)
{
    rlRfTempData_t    TempData;
    rlRfGetTemperatureReport(RL_DEVICE_MAP_INTERNAL_DSS_MSS, &TempData);
    UART_writePolling (gMmwMssMCB.loggingUartHandle, (uint8_t*)&TempData,sizeof(TempData));
    
    return 0;
}

static void GetTemperatureTask(UArg arg0, UArg arg1)
{
    while(1)
    {
        if(GetTemperature() < 0)
        {
        //    DBG("Failed");
            System_printf("Error in getting temperature!");
        }
        Task_sleep(1000);
    }
}

And then I create a task in the MmwDemo_mssInitTask():

    Task_Params_init(&taskParams);
    taskParams.priority = 7;
    taskParams.stackSize = 1024;
    Task_create(GetTemperatureTask, &taskParams, NULL);

But the data received is all 'FF',as show in the screenshot.

Could you offer some help?

Thanks a lot,

Cassie

  • Hi Cassie,

    Could you make sure that getTemprature API returns success? And try to print individual parameters of tempData structure as suggested in following code snippet.

        rlRfTempData_t tempData = {0};
        while(1)
        {
            errCode = rlRfGetTemperatureReport(RL_DEVICE_MAP_INTERNAL_BSS, &tempData);
            if(errCode < 0)
            {
                CLI_write("GetTemp API failed \n");
            }
            else
            {
                CLI_write("Temperature: %d, %d, %d, %d, %d, %d, %d, %d \n", tempData.tmpRx0Sens, tempData.tmpRx1Sens,
                                                                            tempData.tmpRx2Sens, tempData.tmpRx3Sens, 
                                                                            tempData.tmpTx0Sens, tempData.tmpTx1Sens,
                                                                            tempData.tmpPmSens, tempData.tmpDig0Sens);
            }
            
            Task_sleep(1000);
        }  

    Regards,

    Jitendra

  • Hi Jitendra,
    Thank you for your answer.I've tried as you suggested and I got the API failed.The errorCode is -2(RL_RET_CODE_INVALID_INPUT). are the device map RL_DEVICE_MAP_INTERNAL_BSS and RL_DEVICE_MAP_INTERNAL_DSS_MSS valid in Awr1642 Boost1.0? Or is there anything needed to be initialized?

    Best wishes,
    Cassie.
  • Hi Cassie,

    You are getting negative return value as you may not have intialized the mmwave module in the application.

    Here is the code reference based on mmw demo (mss_main.c) which you can use in your application.

    Event_Handle eventHandleNotify_0;
    
    void MmwDemo_mssMmwaveStartCallbackFxn(MMWave_CalibrationCfg* ptrCalibrationCfg)
    {
        /* Post an event to main data path task. 
           This function in only called when mmwave_start() is called on DSS */
        gMmwMssMCB.stats.datapathStartEvt ++;
    
        /* Post event to start is done */
        Event_post(gMmwMssMCB.eventHandleNotify, MMWDEMO_DSS_START_COMPLETED_EVT);
    
        //TODO  along with this point, add next line of code in the same file wherever 'MMWDEMO_DSS_START_COMPLETED_EVT' event is getting posted (Event_post).
        Event_post(eventHandleNotify_0, MMWDEMO_DSS_START_COMPLETED_EVT);
    }
    
    
    void Mmwdemo_mssInitTask(...)
    {
       .....
       .....
        eventHandleNotify_0 = Event_create(NULL, &eb);
        if (eventHandleNotify_0 == NULL) 
        {
            MmwDemo_mssAssert(0);
            return ;
        }
    
        .....
        .....
        
        MmwDemo_CLIInit();
    
        /*****************************************************************************
         * Benchmarking Count init
         *****************************************************************************/
        /* Configure banchmark counter */
        Pmu_configureCounter(0, 0x11, FALSE);
        Pmu_startCounter(0);
       
        rlRfTempData_t tempData = {0};
        
        /* Pend on the START NOTIFY event */
        Event_pend(eventHandleNotify_0, 
                              Event_Id_NONE, 
                              MMWDEMO_DSS_START_COMPLETED_EVT,
                              BIOS_WAIT_FOREVER);
                              
        while(1)
        {
            errCode = rlRfGetTemperatureReport(RL_DEVICE_MAP_INTERNAL_BSS, &tempData);
            if(errCode < 0)
            {
                CLI_write("GetTemp API failed \n");
            }
            else
            {
                CLI_write("Temperature: %d, %d, %d, %d, %d, %d, %d, %d \n", tempData.tmpRx0Sens, tempData.tmpRx1Sens,
                                                                            tempData.tmpRx2Sens, tempData.tmpRx3Sens, 
                                                                            tempData.tmpTx0Sens, tempData.tmpTx1Sens,
                                                                            tempData.tmpPmSens, tempData.tmpDig0Sens);
            }
            
            Task_sleep(1000);
        }    
    
    }
    
    

    Hope this will help you to resolve this issue.

    Regards,

    Jitendra

  • Hi Jitendra,
    Thank you for your reply,I have resolved this problem.
    Best wishes,
    Cassie