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.

CC2538: CC2538-server can not update CC2530-client?

Part Number: CC2538
Other Parts Discussed in Thread: CC2530, Z-STACK, UNIFLASH, CC2652R, CC2530EMK

Hi TI team

 I can not ota end device(CC2538 as server,dongle CC2530 as a client.)

ZC:CC2538(ota_dongle)               ZED:CC2530/CC2538                           PDF:Z-Stack OTA Upgrade User's Guide   channel:25  panid:0x2222(modify Configuration file)

The CC2538 Board :1.update the D:\Texas Instruments\Z-Stack 3.0.2\Projects\zstack\OTA\Dongle\CC2538 

                                2.modify add source code on the Dongle:void OTA_Dongle_Init( byte task_id )

                                {                                      

osal_start_timerEx( OTA_Dongle_TaskID, OTA_DONGLE_DONGLE_5S_EVT, 5000 );
bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING|BDB_COMMISSIONING_MODE_NWK_FORMATION | BDB_COMMISSIONING_MODE_FINDING_BINDING | BDB_COMMISSIONING_MODE_INITIATOR_TL);

                                }

                              3.add function: every 5s open the network and enable the CC2592.

The CC2530 Board:1.update the Boot D:\Texas Instruments\Z-Stack 3.0.2\Projects\zstack\OTA\Boot\CC2530DB 

                                2. modify source code:void zclSampleSw_Init( byte task_id )

{

   bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING| BDB_COMMISSIONING_MODE_FINDING_BINDING);

}                                    

                                3. config the sample switch application example, update the EndDeviceEB-OTAClient

                                4.had generated the image:5678-1234-00000001.zigbee.

                                  result:1 .it can not join the CC2538,2 had no find any can update CC2530 firmware from the otaserver tools.

                               

The CC2530 Board:1. modify source code:void zclSampleSw_Init( byte task_id )

{

   bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING| BDB_COMMISSIONING_MODE_FINDING_BINDING);

2.config the sample switch application example, update the EndDeviceEB.

result: 1.it can join the CC2538.

                           3.from the picture,i can not learn about update firmware any information,

                                        4.from the wireshark packet had no any response

                                        5.But the CC2538 as a client is successfully update.

  So I had any operation error about CC2530 as a client?

Thanks!

  • and I had try to build a CC2652 project(C:\ti\simplelink_cc13x2_26x2_sdk_x_xx_xx_xx\examples\rtos\CC26X2R1_LAUNCHXL\zstack\<zc/zr/zed>_sw_ota_client\tirtos\<ccs/iar>)

    but what can I find the Boot project about CC2652 as a end device?

    Thanks!

  • It appears you've resolved one issue in your previous E2E post: https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/p/905574/3354551#3354551 

    The BIM project is located in examples\nortos\CC26X2R1_LAUNCHXL\bim\bim_offchip and both must be loaded into the CC2652R device simultaneously using Uniflash.  Please refer to the OTA section of the Z-Stack User's Guide.

    Regards,
    Ryan

  • Hi Brown1

    1.  It appears you've resolved one issue in your previous E2E post: https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/p/905574/3354551#3354551 ----This solve CC2538 as a  end device,but the CC2530 as a end device can not run normally.

    2. OK I will learn more about it.

    Thanks!

  • For CC2530 device, do you try to use sniffer to check what happens over the air?

  • Hi YiKai Chen

    I had check it,but had no any ota packet appear, this is a different from the CC2538(end device).

    Thanks!

  • What do you mean “ no any ota packet appear”? Does your CC2530 device join network of OTA server?

  • Hi YiKai Chen

    yes,It has join the server,but had no any ota packet show wireshark,just every second data request!

    Thanks!

  • Hello userjiabo,

    Make sure to follow every step related to the CC2530 from Section 3 of the Z-Stack OTA Upgrade User's Guide.  Are you evaluating with a SmartRF05EB + CC2530EMK since off-chip external flash memory is required?

    Regards,
    Ryan

  • Hi Brown1

    you mean that the CC2530 as a end device client,it need external flash,right?

    But I let CC2530 as a dongle server, CC2538 as a client.

    had a picture issue as follows:

    Thanks!

  • Hi Brown1

    OK,I had found the SmartRF05EB + CC2530EMK SCH had a 2Mb Flash.

    But it can not be used to  be a server [ ZC-CC2530 ] to OTA  ZED-CC2538(as a client)?
     

    Thanks!

  • Hi Brown1

    What you mean:the both must be loaded into the CC2652R device simultaneously using Uniflash?

    my operation is these:1. Using CC2652 demo Board update the BIM firmware with Uniflash.

                                        2. update the firmware example[zed_sw_CC26X2R1_LAUNCHXL_tirtos_ccs].

                                        3.build and generate a BEBE-2652-00000001.zigbee with a example[zed_sw_ota_client_CC26X2R1_LAUNCHXL_tirtos_ccs]

                                        4. my CC2538 board update a dongle coordinator firmware.

                                        5. let the CC2652 demo board pair CC2538,generate short address.

    result: see the picture,had no any ota process.

    had any mistake step?

    By the way,the CC2538 as a server: 1.CC2538 as a client,it ok.

                                                             2. CC2530 as a client,it not ok,because my CC2530-board has no external flash.

    Thanks!

  • The server side should be fine without external flash regardless of device used.  Firmware timeout indicates a UART connection issue.  Simultaneous Uniflash image loading implies programming the device with two or more images without over-writing or erasing the others.  An OTA-compatible project must be used for a successful OTA transfer.  Also note the following E2E post: https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/t/899435 

    Regards,
    Ryan

  • Hi YiKai Chen

    If the CC2530 as a server dongle, CC2538 as a client.

    CC2530 board must be has a external flash? I had checked the UART connect and port com.The connection is correct.

    And I had checked the uart can send the packet data.

    This is very strange.

    Thanks!

  • No, CC2530 board doesn't need external flash if the CC2530 act as OTA server dongle.

  • Hi YiKai Chen

    my CC2530 board chip is  cc2530f256[256KB].

    it act as a server has a enough space,right? 

    Thanks!

  • Yes, cc2530f256[256KB] is enough for OTA server.

  • Hi YiKai Chen

    I had just modify: 1.panid:0xFFFF-0X2222  chanage:11-25

                                 on the void OTA_Dongle_Init( byte task_id ) function add :               

     osal_start_timerEx( OTA_Dongle_TaskID, OTA_DONGLE_DONGLE_5S_EVT, 5000 );---open the zigbee network /every time 5s
     bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING|BDB_COMMISSIONING_MODE_NWK_FORMATION |   BDB_COMMISSIONING_MODE_FINDING_BINDING | BDB_COMMISSIONING_MODE_INITIATOR_TL);

    Thanks!

  • Why do you need to modify this, the original project should work.

  • Hi YiKai Chen

    the CC2538 dongle-coordinator project seem is OK 

    the CC2530 dongle-coordinator project seem is error[modify these:because channel 11 had another device interference,and I had to let it open the zigbee network,pair the zigbee end device].

    Thanks!

  • Hi YiKai Chen

    this picture show me that the port issue?but had check the port can send the serial data.

    So what can I solve it?

    Thanks!

  • If you don't modify anything on CC2530 OTA dongle source code, can OTASever recognize your CC2530?

  • Hi YiKai Chen

    For CC2530 board as a server,I had unzip a new zstack3.0.2 to run the CC2530 dongle-Coordinator,just modify channel[11-25], panid[0xFFFF-0X2222]

    But also had no unsuccessfully to ota CC2538[client].

    For CC2652 as a server, CC2538 as a client. 

    had appear picture as follows:

    server had no ZCL OTA :Image Notify,Seq 5 

    the annex[CC2652 has no request.zip] is CC2652 as a server,CC2538 as a client.

                                        No.2240 and No.2327

    the annex[CC2538 ota success -482.zip] is CC2538 as a server,CC2538 as a client.

                                        No.482

    It seem that I can not ota success different chip,just only the same chip.

    CC2652 has no request.zipCC2538 ota success -482.zip

    Thanks!

  • this is my 2652 demo board,the yellow line is external flash?

  • Hi Brown1

    If the zed_sw_ota_client example need to BIM.hex,

    so I should load BIM,hex into the CC2652 demo board?

    or you mean that Simultaneous Uniflash image is that combine  cc26x2r1lp_bim_offchip.hex with zed_sw_ota_client_CC26X2R1_LAUNCHXL_tirtos_ccs.hex to one hex file,and load this combined,hex with uniflash tool?

    I just use the example[zed_sw_ota_client],and the CC2538 as a server, CC2652 demo board as a client, has appear this as follows

    in my side,I just had only a CC2652 demo board. 

    I had viewed configuration repeatedly.it is correct.

    it can appear another issue?

    Thanks!

  • The yellow circle does show the external flash device, and you need to load the *_bim_offchip.hex and *_sw_ota_client_*_ccs_oad.bin using Uniflash.  Once again please read the OTA Upgrade Guide.

    Regards,
    Ryan

  • Hi Brown1

    the CC2652 demo board as a client [show no image found for device]has be solved.

    Because I load the image version-0001 default,as the picture show, I remove the Version Check Image Files,it can load the image.

    Using Uniflash load the image version-0001, I should create the high version image.

    So now the CC2538 as a server, CC2652 as a client  can run normally.

    But the complete times more over 15min[and had appeared re-load,this time over 25min].

    And CC2530 as a server can not work,I will keep check it.

    Thanks!

  • Hi YiKai Chen

    I let the CC2652 demo board as a server,my custom board as a client,it show this.

    Thanks!

  • I don’t know why you cannot make CC2530 as server to work but if CC2538/CC2652 can work, I would suggest you to use them to keep testing.

  • Hi YiKai Chen

    Now I had achieved :1. CC2538 custom board as a server .CC2652 demo board as a client .it can ota normal.

                                     2. CC2538 custom board as a server .CC2538  custom board as a client .it can ota normal.

                                     3. CC2538 custom board as a server .CC2652 custom board[has a external flash]  as a client .it can ota normal.

    But now I let the CC2652 demo board as a server,the CC2652 custom board[has a external flash] as a client, appear Image found.it can not run ota.

    All of them run the example project.

    Thanks!

  • Hi YiKai Chen

    MX25R8035FZUIL0 flash pin to pin W25Q128 16M flash?compatible?

    If my custom board with a W25Q128/16/32/64 flash,no MX25R8035FZUIL0 flash.it can storage ota firmware?

    Thanks!

  • Hi Brown1

     Now I had solved CC2652 demo board can not as a server problem[just scan ZC-server panid,and just show image found].

     I remove the TX/RX  jumper it can run.

     Compare Photos can show us.

    Thanks!

  • Hi YiKai Chen

    If I want to let my ZC-2538 GenericApp example project as a server,what can I do?

    I mean that add source code on my custom project.

    Thanks!

  • Now I had achieve CC2652/2538 OTA CC2652/CC2538 run example project,so next step,I want to add source code in my custom ZC project,let it as a server,and add source code in my custom ZED project,let it as a client. The user guide.pdf just support add source code in custom ZED project.

  • Thanks for providing the update userjiabo.  There is no guide provided for adding OTA server functionality to a project.  This is a specific application example for which you will need to compare the application files for differences and port accordingly.

    Regards,
    Ryan

  • Hi Brown1

    OK,PC tools-OtaServer had the open source code?

    I wanted to  transplant it to my wifi chip[Qualcomm 4531 or MTK7688 chip],let it achieve ota instead of the PC tools.

    Thanks!

  • As I know, PC tools-OtaServer source codes are not opened for application developers.

  • Hi YiKai Chen

    It is not opened for application developers,So what can I achieve this fuction in the Wifi chip,on the wifi chip mount the zigbee linux gateway,this can achieve ota end device?

    Thanks!

  • Basically, all the information needed for OTA is detailed in Z-Stack OTA Upgrade User's Guide.pdf and Zigbee spec. We implement OTA on our Linux Gateway by reading those information. If you need Linux reference design, you can refer to software-dl.ti.com/.../Z-Stack Linux Gateway - Developer's Guide.html

  • Hi YiKai Chen

    Ok,I see,there's still a long way to go.

    Thanks!

  • Hi YiKai Chen

    the ZC run as a server example use the default serial protocol is this function had no modify?

    Because I had modified these section module in my ZC project.

    /***************************************************************************************************
     * @fn      MT_UartProcessZToolData
     *
     * @brief   | SOP | Data Length  |   CMD   |   Data   |  FCS  |
     *          |  1  |     1        |    2    |  0-Len   |   1   |
     *
     *          Parses the data and determine either is SPI or just simply serial data
     *          then send the data to correct place (MT or APP)
     *
     * @param   port     - UART port
     *          event    - Event that causes the callback
     *
     *
     * @return  None
     ***************************************************************************************************/
    void MT_UartProcessZToolData ( uint8 port, uint8 event )
    {
      uint8  ch;
      uint8  bytesInRxBuffer;
      
      (void)event;  // Intentionally unreferenced parameter
    
      while (Hal_UART_RxBufLen(port))
      {
        HalUARTRead (port, &ch, 1);
    
        switch (state)
        {
          case SOP_STATE:
            if (ch == MT_UART_SOF)
              state = LEN_STATE;
            break;
    
          case LEN_STATE:
            LEN_Token = ch;
    
            tempDataLen = 0;
    
            /* Allocate memory for the data */
            pMsg = (mtOSALSerialData_t *)osal_msg_allocate( sizeof ( mtOSALSerialData_t ) +
                                                            MT_RPC_FRAME_HDR_SZ + LEN_Token );
    
            if (pMsg)
            {
              /* Fill up what we can */
              pMsg->hdr.event = CMD_SERIAL_MSG;
              pMsg->msg = (uint8*)(pMsg+1);
              pMsg->msg[MT_RPC_POS_LEN] = LEN_Token;
              state = CMD_STATE1;
            }
            else
            {
              state = SOP_STATE;
              return;
            }
            break;
    
          case CMD_STATE1:
            pMsg->msg[MT_RPC_POS_CMD0] = ch;
            state = CMD_STATE2;
            break;
    
          case CMD_STATE2:
            pMsg->msg[MT_RPC_POS_CMD1] = ch;
            /* If there is no data, skip to FCS state */
            if (LEN_Token)
            {
              state = DATA_STATE;
            }
            else
            {
              state = FCS_STATE;
            }
            break;
    
          case DATA_STATE:
    
            /* Fill in the buffer the first byte of the data */
            pMsg->msg[MT_RPC_FRAME_HDR_SZ + tempDataLen++] = ch;
    
            /* Check number of bytes left in the Rx buffer */
            bytesInRxBuffer = Hal_UART_RxBufLen(port);
    
            /* If the remain of the data is there, read them all, otherwise, just read enough */
            if (bytesInRxBuffer <= LEN_Token - tempDataLen)
            {
              HalUARTRead (port, &pMsg->msg[MT_RPC_FRAME_HDR_SZ + tempDataLen], bytesInRxBuffer);
              tempDataLen += bytesInRxBuffer;
            }
            else
            {
              HalUARTRead (port, &pMsg->msg[MT_RPC_FRAME_HDR_SZ + tempDataLen], LEN_Token - tempDataLen);
              tempDataLen += (LEN_Token - tempDataLen);
            }
    
            /* If number of bytes read is equal to data length, time to move on to FCS */
            if ( tempDataLen == LEN_Token )
                state = FCS_STATE;
    
            break;
    
          case FCS_STATE:
    
            FSC_Token = ch;
    
            /* Make sure it's correct */
            if ((MT_UartCalcFCS ((uint8*)&pMsg->msg[0], MT_RPC_FRAME_HDR_SZ + LEN_Token) == FSC_Token))
            {
              osal_msg_send( App_TaskID, (byte *)pMsg );
            }
            else
            {
              /* deallocate the msg */
              osal_msg_deallocate ( (uint8 *)pMsg );
            }
    
            /* Reset the state, send or discard the buffers at this point */
            state = SOP_STATE;
    
            break;
    
          default:
           break;
        }
      }
    }

    Thanks!

  • What do you mean  is this function had no modify?

  • Hi YiKai Chen

    I mean that the attachment file code is the serial Communication protocol.

    On the ZC-dongle server example project, these code has been used to serial communication?

    Thanks!

  • Hi userjiabo,

    I recommend you reference the code enabled by MT_OTA_FUNC and OTA_SERVER=TRUE

    Regards,
    Ryan

  • Hi Brown1 

    you mean that found source code about these two Macro definition parameters?

    Thanks!

  • No, it seemed that your questions were based on processing commands from a host OTA server tool.

    Edit: Have you considered the OTA server project files from ZIGBEE-LINUX-SENSOR-TO-CLOUD?

    Regards,
    Ryan

  • Hi Brown1

    yes,you are right,my attachment file is about serial communication protocol(default zstack3.0.2).

    Because in my custom project, this source code has been modified,

    I want to make sure these source code function used by processing commands from a host OTA server tool?

    Thanks!

  • Yes, MT_UartProcessZToolData is used to process the MT commands from the OTA server tool.

    Regards,
    Ryan

  • Hi Brown1

    ok, I will check more about it.

    Thanks!

  • Hi Brown1

    Edit: Have you considered the OTA server project files from ZIGBEE-LINUX-SENSOR-TO-CLOUD?--what meaning about this?

    zigbee linux gateway can support  ota ZED/ZR(client),ZC(server)also can support?

    As I know,ZC should update firmware by sbl with SBDemo tool.

    Thanks!