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/CC1310: Printing MAC Address onto UART

Part Number: CC1310

Tool/software: Code Composer Studio

Hey guys,

since the old thread has been locked and I am back on this topic, I opened a new thread. My basic setup is the Collector+Sensor Network example. I am still not managing to print the MAC address in one string containing all 8 numbers in hex format. I think the issue lays in the "sprintf" function, though using an online C simulator, I was able to accomplish my task whereas in CCS it seems like some strange things are happening. What happens is, that after the sensor connects to the collector and wants to send its update, the sensor goes into "state 5". For those who are not familiar with the code, the ext. address is stored in the Smsgs_sensorMsg_t structure in an uint8_t array having a length of 8. This is what " SmartRF Flash Programmer 2" shows me:  00 12 4B 00 13 A4 83 D0

I am proceeding as follows:

void Csf_deviceSensorDataUpdate(ApiMac_sAddr_t *pSrcAddr, int8_t rssi,
                                Smsgs_sensorMsg_t *pMsg)
{
    char extAddress_array[17];   

    for(int i=0; i < 8; i++)    
    {
       sprintf(&extAddress_array[i*2],"%02X", pMsg->extAddress[i]);
    }

    extAddress_array[16] = '\0';

    System_printf((xdc_CString) extAddress_array);  
    System_printf("\r\n");

    LCD_WRITE_STRING_VALUE("MAC ", pMsg->extAddress[3], 16, 6); //<-- this actually works
    LCD_WRITE_STRING_VALUE("Sensor 0x", pSrcAddr->addr.shortAddr, 16, 6);
    LCD_WRITE_STRING_VALUE("Move=", pMsg->tempSensor.objectTemp, 10, 6);

So, printing each number after the other (pMsg->extAddress[3]...a.s.o.) works. Building the project works, too, but if I am not uncommenting the for-loop, I can see in my terminal, that after the sensor joined the network something, the sensor goes into state 5, and nothing else happens. Looks like the collector stucks from here on.

Any idea what is going wrong?