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.

Starterware/CC3120: Porting MQTT Client to CC3120

Part Number: CC3120
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Starterware

Dear Support:

I am trying to port the MQTT Client example running on the CC3220 over to the MSP432 + CC3120 and pulled the files over along with the mqtt_client.a library, but when getting to the linking stage, it fails with the following:

<Linking>

undefined first referenced
symbol in file
--------- ----------------
PRCMRTCGet C:/TI/simplelink_msp432_sdk_wifi_plugin_1_30_00_03/source/ti/net/mqtt/ccs/client/mqtt_client.a<cc32xx_platform.obj>
PRCMRTCInUseSet C:/TI/simplelink_msp432_sdk_wifi_plugin_1_30_00_03/source/ti/net/mqtt/ccs/client/mqtt_client.a<cc32xx_platform.obj>

error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "mqtt_client_ibm_MSP_EXP432P401R_tirtos_ccs.out" not built

Can you tell me what I need to do to fix this problem of it not being able to find the above function calls?  Please advise.

Thanks,
Tim

  • Hi Tim,

    You could replace the implementation here using the posix timer/clock module which will make it portable across both these simplelink MCU platforms.

    #include <ti/net/mqtt/platform/platform.h>
    
    #include <time.h>
    
    void platform_timer_init()
    {
    }
    
    uint32_t platform_get_time_in_secs()
    {
        struct timespec tspec;
        clock_gettime(CLOCK_MONOTONIC, &tspec);
        return (tspec.tv_sec);
    }

    [ FYI, include path to the posix headers will be needed for <time.h>, i.e. for TIRTOS - ${COM_TI_SIMPLELINK_MSP432_SDK_INSTALL_DIR}/kernel/tirtos/packages/ti/sysbios/posix ) ]

    Hope that helps,

    ~roger

  • Hey Roger:

    Ok, thanks - that fixed the linker problem.  Just one more question.  There is also this routine:

    void TimerPeriodicIntHandler(sigval val)
    {
          unsigned long ulInts;

    /* Clear all pending interrupts from the timer we are currently using. */

         ulInts = MAP_TimerIntStatus(TIMERA0_BASE, true);
         MAP_TimerIntClear(TIMERA0_BASE, ulInts);

    /* Increment our interrupt counter. */

         g_usTimerInts++;
         if (!(g_usTimerInts & 0x1))
         {   

    /* Turn Led Off */
              GPIO_write(Board_LED0, Board_LED_OFF);
         }
         else
         {

    /* Turn Led On */
              GPIO_write(Board_LED0, Board_LED_ON);
         }
    }

    which uses TIMERA0_BASE of the CC3220.  I could fix this by using an equivalent call for the MSP432, but that would make it not portable.  Do you know of an equivalent way of doing this so that I can use the same code for both the CC3220 and the MSP432?

    Thanks,
    Tim

  • Hi Tim,

    Sorry I missed this follow-up yesterday.

    Yes, you're right.  I would suggest removing those lines and configure the it_value of the timer with something like :-

    void TimerPeriodicIntHandler(sigval val)
    {
    //    unsigned long ulInts;
    
        /* Clear all pending interrupts from the timer we are currently using.    */
    //    ulInts = MAP_TimerIntStatus(TIMERA0_BASE, true);
    //    MAP_TimerIntClear(TIMERA0_BASE, ulInts);
    
        /* Increment our interrupt counter.                                       */
        g_usTimerInts++;
    ...
    }
    
    void LedTimerConfigNStart()
    {
        struct itimerspec value;
    ...
        value.it_value.tv_nsec = 100 * 1000000;
    ...
    }

    Hope that helps,

    ~roger

  • Thanks Roger - that worked.  As usual, you are the man!

    Thanks,
    Tim