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.

Z-Stack OTA Guide

Other Parts Discussed in Thread: Z-STACK, CC2538, CC2530

I'm trying to follow Z-Stack OTA Upgrade guide.
I have  2 smartRF05 + 2 2530EM boards, Z-Stack Home 1.2.0+IAR 8051 8.20

Can you please advise with these problems I'm facing? I want to be able to demonstrate OTA on these boards and then integrate OTA with my own application.

1- Can't build OTA Boot:
Building OTA Boot (Sec 3.2.1), it gives many delcared implicitly errors. I have not changed any code.

2- HA SampleSwOta Sample Application:
C:\Texas Instruments\Z-Stack Home 1.2.0\Projects\zstack\HomeAutomation\SampleSwitchOta\CC2530DB

I don't have the compile options in doc:

My IAR gives me only 3 options:


  • 1. I don't have this problem when build OTA boot in Z-Stack Home 1.2.0. Do you modify anything on it? Maybe try to reinstall Z-Stack Home 1.2.0 and try again.
    2. I think the document is obsolete and wrong. You shouldn't see EndDeviceEB-Pro. You can choose EndDeviceEB adn build it.
  • I haven't changed any code. What I found is

    1- Boot OTA, does TI boot loader code supports external SPI ram read and write? It seems it has to do with this.

    All the

    XNV_SPI_

     functions are within

    #if/#endif

    blocks like:

    #if HAL_OTA_XNV_IS_SPI
    XNV_SPI_INIT();
    #endif

    Where

    HAL_OTA_XNV_IS_SPI=TRUE

     for all.

    and then in hal_board_cfg.h there are instances of  functions named 

    st()

    What are these st() ?

    #define HAL_CLOCK_STABLE()    st( while (CLKCONSTA != (CLKCONCMD_32MHZ | OSC_32KHZ)); )
    #define XNV_SPI_BEGIN() st(HalSRLoad(HalSRGetState() & 0xFD);)
    #define XNV_SPI_BEGIN_BOOT() st(HalSRLoad(0);)
    #define XNV_SPI_TX(x) st(U1CSR &= 0xFD; U1DBUF = (x);)
    #define XNV_SPI_RX() U1DBUF
    #define XNV_SPI_WAIT_RXRDY() st(while (!(U1CSR & 0x02));)
    #define XNV_SPI_END_BOOT() st(P1SEL &= 0x1F; HalSRLoad(2);)
    #define XNV_SPI_END() st(P1SEL &= 0x1F; HalSRLoad(HalSRGetState() | 0x02);)

    Or:

    #define XNV_SPI_INIT() \
    st( \
    /* Mode select UART1 SPI Mode as master. */\
    U1CSR = 0; \
    \
    /* Setup for 115200 baud. */\
    U1GCR = 11; \
    U1BAUD = 216; \
    \
    /* Set bit order to MSB */\
    U1GCR |= BV(5); \
    \
    /* Set UART1 I/O to alternate 2 location on P1 pins. */\
    PERCFG |= 0x02; /* U1CFG */\
    \
    /* Select peripheral function on I/O pins but SS is left as GPIO for separate control. */\
    P1SEL |= 0xE0; /* SELP1_[7:4] */\
    /* P1.1,2,3: reset, LCD CS, XNV CS. */\
    /*P1SEL &= ~0x0E;*/ \
    /*P1 |= 0x0E;*/ \
    /*P1_1 = 0;*/ \
    /*P1DIR |= 0x0E;*/ \
    \
    /* Give UART1 priority over Timer3. */\
    P2SEL &= ~0x20; /* PRI2P1 */\
    \
    /* When SPI config is complete, enable it. */\
    U1CSR |= 0x40; \
    /* Release XNV reset. */\
    /*P1_1 = 1;*/ \
    )
    #endif
  • I was able to get this work for 1.2.1 with IAR 8081 8.30.3 , so if that works we can close this issue.
  • It is good to know it works.
  • Thanks. I have a project from past which has been compiled with Zstack 1.2.0. I want to add OTA to this project. If I move on to Zstack 1.2.1 or 1.2.2 , would I encounter any problems? What needs to be changed in application code so it can work with new Z-Stacks?

  • I don't see anything special needed to take care. It should work with new stack fine.
  • You are welcome.
  • Now I have followed the OTA guide for 1.2.1 like below for 4 boards to setup an OTA image upgrade:

    (1)  smartRF06+CC2538: Dongle OTA-Coordinator

    (2)  smartRF06+CC2538: Router OTA Client- Image A- withBoot
    (3)  smartRF05+CC2530: Boot+ Router OTA-Client
    (4)  smartRF05+CC2530: Boot+ Router OTA-Client

    (1) is connected to PC for server purposes. I run the otaServer but none of the routers join Coordinator (1). It doesn't show any of them in the list. Any thoughts:

  • It is good to know you fix this. Maybe you can tell us how you fix it here so other ld have the same issue can benefit from you.
  • They don't form network automatically. You have to press SW2 on each board to have them send descriptors. I don't quiet get it as descriptors are for endpoint matching. and here we don't have lights to get desc. matched. But it got them join coordinator.