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.

LP-CC2652RB: OTA adapted application stuck on macRadioPowerUpWait

Part Number: LP-CC2652RB
Other Parts Discussed in Thread: CC2652RB, UNIFLASH, SYSCONFIG

Have taken my zigbee temperature sensor app and added OTA functionality as shown here. However, that tutorial seems to be out of date and would not build with the post-build steps described there. Had to adapt the post-building steps with those from zed_sw_ota_client_offchip_LP_CC2652RB_tirtos7_ticlang

Current post-build steps:

${CG_TOOL_ROOT}/bin/tiarmobjcopy ${BuildArtifactFileName} --output-target ihex ${BuildArtifactFileBaseName}.hex
${CG_TOOL_ROOT}/bin/tiarmobjcopy ${BuildArtifactFileName} --output-target binary  ${BuildArtifactFileBaseName}_oad.bin
${COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR}/tools/common/oad/oad_image_tool --verbose ccs ${PROJECT_LOC} 7 -hex1 ${ConfigName}/${ProjName}.hex -k ${COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR}/tools/common/oad/private.pem -o ${ConfigName}/${ProjName}_oad
${COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR}/tools/zstack/zigbee_ota_image_converter/zOTAfileGen ${PROJECT_LOC}/${ConfigName}/${ProjName}_oad.bin ${PROJECT_LOC}/${ConfigName}/              BEBE 2652 00000001

Don't know if this is relevant, but figured i would mention it. Program builds and runs without error, but i am getting the following warning:

warning #10247-D: creating output section ".ccfg" without a SECTIONS specification

I've added the OTA library and OTA_CLIENT_INTEGRATED code from zed_sw_ota_client_offchip_LP_CC2652RB_tirtos7_ticlang

I can program my board without issues, but the program gets stuck inside macRadioPowerUpWait according to the callstack:

I don't think this has anything to do with the code added from the sample project as this fails before the BIOS could start the sampleApp task and make any calls to the OTA functions. If i erase the flash and program it with a different project (without any OTA modifications), the board works as expected, thus i do not think there might be any hardware issue.

Could this be caused by some uncaught issue with the post-building steps, app.cfg file or linker configuration file? 

Linker file: 

/* Retain interrupt vector table variable                                    */
--retain=g_pfnVectors
/* Override default entry point.                                             */
--entry_point ResetISR
/* Allow main() to take args                                                 */
--args 0x8
/* Suppress warnings and errors:                                             */
/* - 10063: Warning about entry point not being _c_int00                     */
/* - 16011, 16012: 8-byte alignment errors. Observed when linking in object  */
/*   files compiled using Keil (ARM compiler)                                */
--diag_suppress=10063,16011,16012

/* The following command line options are set as part of the CCS project.    */
/* If you are building using the command line, or for some reason want to    */
/* define them here, you can uncomment and modify these lines as needed.     */
/* If you are using CCS for building, it is probably better to make any such */
/* modifications in your CCS project and leave this file alone.              */
/*                                                                           */
/* --heap_size=0                                                             */
/* --stack_size=256                                                          */
/* --library=rtsv7M3_T_le_eabi.lib                                           */

/* The starting address of the application.  Normally the interrupt vectors  */
/* must be located at the beginning of the application.                      */

#ifndef NVOCMP_NVPAGES
#define NVOCMP_NVPAGES          2
#endif

#define FLASH_BASE              0x00000000
#define FLASH_NV_BASE           (0x56000 - (NVOCMP_NVPAGES * 0x2000))
#define FLASH_NV_SIZE           (NVOCMP_NVPAGES * 0x2000)

#define FLASH_LAST_BASE         0x56000
#define FLASH_LAST_SIZE         0x2000
#define RAM_BASE                0x20000000
#define RAM_SIZE                0x14000
#define GPRAM_BASE              0x11000000
#define GPRAM_SIZE              0x2000

#define OAD_HDR_START          	FLASH_BASE
#define OAD_HDR_SIZE           	0xA8
#define OAD_HDR_END            	(OAD_HDR_START + OAD_HDR_SIZE - 1)

#define ENTRY_START             (OAD_HDR_END + 1)
#define ENTRY_SIZE              0x40
#define ENTRY_END               (ENTRY_START + ENTRY_SIZE - 1)

#define FLASH_START             (ENTRY_END + 1)
#define FLASH_END               (FLASH_NV_BASE - FLASH_START)
#define FLASH_SIZE              (FLASH_END - FLASH_START)

#define PAGE_SIZE               0x2000

/* System memory map */

MEMORY
{
    ENTRY (RX) : origin = ENTRY_START, length = ENTRY_SIZE

    FLASH_IMG_HDR (RX) : origin = OAD_HDR_START, length = OAD_HDR_SIZE

    /* Application stored in and executes from internal flash */
    FLASH (RX) : origin = FLASH_START, length = FLASH_SIZE

 	/* FLASH NV */
    FLASH_NV (RWX) : origin = FLASH_NV_BASE, length = FLASH_NV_SIZE
    /* Last flash page */
    FLASH_LAST (RX) : origin = FLASH_LAST_BASE, length = FLASH_LAST_SIZE
    /* Application uses internal RAM for data */
    SRAM (RWX) : origin = RAM_BASE, length = RAM_SIZE
    /* Application can use GPRAM region as RAM if cache is disabled in the CCFG
    (DEFAULT_CCFG_SIZE_AND_DIS_FLAGS.SET_CCFG_SIZE_AND_DIS_FLAGS_DIS_GPRAM = 0) */
    GPRAM (RWX): origin = GPRAM_BASE, length = GPRAM_SIZE

    /* Explicitly placed off target for the storage of logging data.
     * The data placed here is NOT loaded onto the target device.
     * This is part of 1 GB of external memory from 0x60000000 - 0x9FFFFFFF.
     * ARM memory map can be found here:
     * https://developer.arm.com/documentation/ddi0337/e/memory-map/about-the-memory-map
     */
    LOG_DATA (R) : origin = 0x90000000, length = 0x40000        /* 256 KB */
}

/* Section allocation in memory */

SECTIONS
{
    GROUP > FLASH_IMG_HDR
    {
        .image_header //align PAGE_SIZE
    }

    GROUP > ENTRY
    {
        .resetVecs LOAD_START(prgEntryAddr)
        .intvecs
        EntrySection
    }

    .text           :   > FLASH

    config_const { mac_user_config.o(.rodata) } > FLASH

    .const          :   > FLASH
    .constdata      :   > FLASH
    .rodata         :   > FLASH
    .cinit          :   > FLASH LOAD_END(flashEndAddr)
    .pinit          :   > FLASH
    .init_array     :   > FLASH
    .emb_text       :   > FLASH

    .vtable         :   > SRAM
    .vtable_ram     :   > SRAM
     vtable_ram     :   > SRAM
    .data           :   >> SRAM
    .bss            :   > SRAM
    .sysmem         :   > SRAM
    .stack          :   > SRAM (HIGH)
    .nonretenvar    :   > SRAM

    .gpram          :   > GPRAM
    .log_data       :   > LOG_DATA, type = COPY
}

/* Create global constant that points to top of stack */
/* CCS: Change stack size under Project Properties    */
__STACK_TOP = __stack + __STACK_SIZE;

  • Hi,

    Thank you for reaching out. Our Zigbee expert is currently out of office and responses may be delayed. In the meantime, could you provide us with the SDK you are using?

    Best Regards,

    Jan

  • Hello, Jan. I am using version 6.20. 

  • Since i've initially posted this i have made some progress. The program builds now, does not get stuck inside macRadioPowerUpWait anymore, but still fails to work. Isolated the initial problem to be one of linker file, replaced the linker file and got it to build correctly and have BIOS startup the zstack task.

    However, the program is now stuck inside otaClient_Init ( appSemHandle, appServiceTaskId, NULL ); of the initialization function.

    static void zclSampleTemperatureSensor_initialization(void)
    {
        /* Initialize user clocks */
        zclSampleTemperatureSensor_initializeClocks();
    
        /* create semaphores for messages / events
         */
        Semaphore_Params semParam;
        Semaphore_Params_init(&semParam);
        semParam.mode = ti_sysbios_knl_Semaphore_Mode_COUNTING;
        Semaphore_construct(&appSem, 0, &semParam);
        appSemHandle = Semaphore_handle(&appSem);
    
        appServiceTaskId = OsalPort_registerTask(Task_self(), appSemHandle,
                                                 &appServiceTaskEvents);
    
        //Initialize stack
        zclSampleTemperatureSensor_Init();
    
        Watchdog_init();
        Watchdog_Params_init(&wdgParams);
        wdgParams.callbackFxn = (Watchdog_Callback)wdgCallback;
        wdgParams.resetMode = Watchdog_RESET_OFF;
        wdgParams.debugStallMode = Watchdog_DEBUG_STALL_ON;
    
        wdgHandle = Watchdog_open(CONFIG_WATCHDOG_0, &wdgParams);
    
        if (!wdgHandle)
        {
            while (1)
                ;
        }
    
        uint32_t tickValue = Watchdog_convertMsToTicks(wdgHandle, 10000);
        Watchdog_setReload(wdgHandle, tickValue);
    
    #if defined (OTA_CLIENT_INTEGRATED)
        otaClient_SetEndpoint(SAMPLETEMPERATURESENSOR_ENDPOINT);
        otaClient_setAttributes(zclSampleTemperatureSensor_Attrs, zclSampleTemperatureSensor_NumAttributes);
        zclOTA_setAttributes(zclSampleTemperatureSensor_Attrs, zclSampleTemperatureSensor_NumAttributes);
    #ifndef CUI_DISABLE
        otaClient_Init ( appSemHandle, appServiceTaskId, gCuiHandle );
    #else
        otaClient_Init ( appSemHandle, appServiceTaskId, NULL ); // stuck here
    #endif
    #endif // OTA_CLIENT_INTEGRATED
    }

    If i disable the watchdog the program will run forever stuck inside the function. If i let the watchdog run, it will repower the board every 10 seconds. Callstack attached below:

  • Hello A V,

    Here is a link to the Z-Stack User's Guide v6.20 which matches the one you are using.  Here you will find that the post-build actions have been updated.  There are admittedly limited resources to consistently verify and update the documentation, so thanks for reporting any inconsistencies you observe. 

    I was able to verify that the ZED temperature sensor project with OTA enabled runs as expected on SDK v7.10, however developers should no longer modify the SysConfig file to add m3Hwi.resetVectorAddress  = 0xA8;.  It is also recommended to copy/paste the post-build steps from an existing ZED OTA switch project from the SDK being used, as you've done, and continue to consult this project to determine if any other changes are present which must be accounted for as it pertains to the steps listed in the User's Guide.  If operating outside the debugger, be sure to load the off-chip BIM hex image alongside the application ota binary image using Uniflash.

    Regards,
    Ryan

  • Hello. I've updated the post-build steps with those from the user guide but still no changes. Program gets stuck, watchdog resets MCU. Failure point is still OTA init function.

  • Please confirm that my other recommendations have been followed, and consider evaluating the default zed_temperaturesensor using the v7.10 SDK.  Also, step into otaClient_Init and further determine from which API the project halts operation and continue to provide information in this manner.

    Regards,
    Ryan