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.

Porting OTA from Z-Stack Home Automation to Z-Stack Mesh

Other Parts Discussed in Thread: Z-STACK, CC2538

Hi TI,

I'm trying to incorporate an OTA feature on Z-Stack Mesh. However, I'm not quite sure if replacing the linker file from Z-Stack HA to Z-Stack Mesh will corrupt the chip? I'm planning to use $PROJ_DIR$\..\..\..\Tools\CC2538DB\CC2538-OTA-Image-A.icf (taken from Z-Stack Home).

I actually looked at what's inside the .icf file and it was about the flash space definitions where to put the image files, etc. Just one concern is that Z-Stack Mesh address space definitions are different from Z-Stack Home. I just want to make sure I'm on the right track and not corrupting anything :)

Here's the screenshot of my IAR settings:

  • As I know, replacing the linker file from Z-Stack HA to Z-Stack Mesh won't corrupt the chip
  • Hi YK Chen,

    I've replaced the linker file and I had errors. Any idea? I believe I have correctly included the files needed to be included as well as the header definitions.

    Building configuration: GenericApp - EndDevice
    Updating build tree...

    69 file(s) deleted.
    Updating build tree...
    DebugTrace.c
    armcm3flashutil.c
    AF.c
    BindingTable.c
    hal_adc.c
    GenericApp.c
    hal_assert.c
    hal_aes.c
    hal_ccm.c
    hal_drivers.c
    hal_mac_cfg.c
    hal_key.c
    hal_lcd.c
    hal_led.c
    hal_sys_ctrl.c
    hal_systick.c
    hal_sleep.c
    mac_cfg.c
    hal_uart.c
    mac_backoff_timer.c
    mac_autopend.c
    mac_low_level.c
    mac_csp_tx.c
    mac_mem.c
    mac_mcu.c
    mac_pib.c
    mac_radio_defs.c
    mac_radio.c
    mac_rffrontend.c
    mac_rx_onoff.c
    mac_sleep.c
    mac_rx.c
    mac_tx.c
    MT_APP.c
    MT.c
    MT_AF.c
    MT_DEBUG.c
    MT_NWK.c
    MT_SYS.c
    MT_UART.c
    MT_VERSION.c
    MT_TASK.c
    MT_ZDO.c
    MT_UTIL.c
    OnBoard.c
    nwk_globals.c
    OSAL.c
    OSAL_Clock.c
    OSAL_Memory.c
    OSAL_GenericApp.c
    OSAL_PwrMgr.c
    startup_ewarm.c
    saddr.c
    osal_nv.c
    OSAL_Timers.c
    UARTMeterData.c
    stub_aps.c
    ZDConfig.c
    ZDiags.c
    ZDNwkMgr.c
    ZDApp.c
    ZDProfile.c
    ZGlobals.c
    ZDObject.c
    zmac.c
    ZDSecMgr.c
    zmac_cb.c
    ZMain.c
    Linking
    Error[Li005]: no definition for "zclOTA_event_loop" [referenced from D:\Texas Instruments\Z-Stack Mesh ZED\Projects\zstack\Samples\
    GenericApp\CC2538\EndDevice\Obj\OSAL_GenericApp.o]
    Error[Li005]: no definition for "HalOTAInvRC" [referenced from D:\Texas Instruments\Z-Stack Mesh ZED\Projects\zstack\Samples\
    GenericApp\CC2538\EndDevice\Obj\GenericApp.o]
    Error[Li005]: no definition for "zclOTA_Init" [referenced from D:\Texas Instruments\Z-Stack Mesh ZED\Projects\zstack\Samples\GenericApp\
    CC2538\EndDevice\Obj\OSAL_GenericApp.o]
    Error[Li005]: no definition for "zclOTA_Register" [referenced from D:\Texas Instruments\Z-Stack Mesh ZED\Projects\zstack\Samples\
    GenericApp\CC2538\EndDevice\Obj\GenericApp.o]
    Error[Li005]: no definition for "HalOTAInit" [referenced from D:\Texas Instruments\Z-Stack Mesh ZED\Projects\zstack\Samples\GenericApp\
    CC2538\EndDevice\Obj\OnBoard.o]
    Error while running Linker

    Total number of errors: 5
    Total number of warnings: 0

  • You have to add zcl_ota.c and zcl_ota.h into your project.
  • This might sound stupid but, how and where do I exactly need to add it? Can you give me instructions?

    Cause I've checked this path: D:\Texas Instruments\Z-Stack Mesh ZED\Components\stack\zcl
    The zcl_ota.h and zcl_ota.c were there. All I did was include this #define block to my application code:

    #if defined (OTA_CLIENT) && (OTA_CLIENT == TRUE)
    #include "zcl_ota.h"
    #include "hal_ota.h"

    #endif

  • You can drag and drop zcl_ota.c and zcl_ota.h into profile folder in GenericApp project.

  • This is perfect. I got 0 errors and 0 warnings now. Thanks a lot!
  • You are welcome.
  • 1. Yes, it would affect anything since they are comment out.
    2. Both look OK.