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.

help on OAD programming

Other Parts Discussed in Thread: CC2530, Z-STACK

Hello,

I have wroked in OAD programming for CC2530 in my development. But I have some problems.

First: There is a document on Z-Stack (Over Air Download for CC2530 - SWRA257) that was suposed to help me on OAD programming with the steps needed. But the programming is not working and in this document there is a reference to another document more detailed. In page 4 this is the reference: [3] Over the Air Download (OAD) Detailed Design Document (F8W-2005-0020). But I couldn´t find this document anywhere. Does someone have this document? Or, is there an error on the document?

The document is attached.

Second: I followed all the steps of the document above, more than one time, but the oad programming didn´t work correctly.

- When the coordinator is recognized I try to program the .bin archive with the ZOAD software. But in the end of the proccess, I check the changes I made in the code, but it doesn´t work, like the programming was failed, and the ZOAD doesn´t any warning or error message.

- Another wrong thing is that the ZOAD recognizes the coordinator but doesn´t recongize the End Device connected to this coordinator.

 

If someone could help me with these problems!

Thx!!!

Over Air Download for CC2530.pdf
  • OAD definitely works in Z-Stack 2.x releases on the SmartRF05EB, but for best results and forward compatibility, you should be using 2.3.0 or better. And the step-by-step guide, Over Air Download for CC2530 , is all you need and exactly what has to be done to succeed. The referenced document is more like a functional specification that you don't need.

    How do you know, exactly, that the OAD to the ZC failed? Did you program your ZC with Boot Code first, and then with the application before even starting the OAD? After the download, OTA (over-the-air) part, finished, did you enable the code from the ZOAD by highlighting the ZC and pressing the "Restart Device" button?

    As for ZOAD discovering nodes in the network, it is flaky and you have to scan for devices several times sometimes to get the device you want - ZOAD is not a product, just a quickie demo of the OAD capability.

     

  • Hi, Dirty Harry

    I have the same problem when i try OAD.  i CAN find my end-device by the ZOAD, but it display always red, and say,  this device is not OAD enabled.

    I did step by step to add OAD to my ED programer.. I am not sure if I did something wrong.

    and I am using the stack version is CC2530-2.2.2-1.3.0.  is this version is too low ???

    wish you and anybody can help me.

    thank you very much!

    Judy

  • Hello Harry,

    Since I post the help message, I stop to work on OAD programming and still doing other important thins on our project!

    But now, with your help maybe i can continue to work with this.

    So, let me answer your question to get update:

    1 - I know that the OAD fail because i do some programming modifications, like change a led on the board, and after the programming it doesnt work.

    2 - Yes, i program the Boot Code first, and then the application. I did several times the step by step exactly as in the document.

    3 - About the enable action and "restart device" action, I dont remember if i did it before. But i can try it. When exactly i have to do this?

     

    Maybe, the third question is the problem i´m having. But if its not, is there any other way to figure this out?

    And, is there any way to talk directly with you and get more help to do the OAD? Like an e-mail, instant messenger, or any other? It's very important in my project to get the OAD programming.

    Anyway, Thx for the help.

     

    Eliã Lima

  • Hello,

    I didnt have this problem before, but I'm having now the same problem as Judy. Could you help us on this.

    In my case, I scan a lot of time for devices, and when I found one is one with a strange address, and then, when i try to send an image this message is showed: "This devide is not OAD enable".

    Can you help us onthis?

     

    Eliã Lima

  • I don´t kno how, but I solved it. I just do all the step by step again and program the dongle as well as the boards to be programmed (with the boot-code). I did nothing else unless this.

    But I'm having a problem now: The first time a tried to send an image, when it was about 39% a message appeared: "Store image timed out". I think I know why. I'm workin on it.

    Eliã Lima

  • Well,

    The Time Out problem I think it's a lost of communication with the coordinator device. Because there was a programmend reset on my Coordinator, so, in the middle of the proccess of sending an image, the error occured. So, I disable this reset and I could send the image successfully.

    But now I have another problem: The process was finished, and I clicked on the button "restart device" an it didnt work. I mean, I made a change like a led blinking to program OAD. So, it sends the image, finishes it, i click the restart button, and when check the changes, it's like I didnt made any changes.

    So, can you help on this?

     

    Eliã Lima

  • A BIG congratulations to you for working through the documentation and code setup and making it work!

    After hi-lighting the device in ZOAD GUI and cliking the restart device button, you should get the pop-up of restart success. From that point on, it will take about 3 minutes for the code to verify the checksum of the OAD code, instantiate it, and verify the checksum of the newly instantiated code.

  • Hi, Harry

    I am doing the same thing like Lima. But now i want to just use the internal flash. so I made some changes.

    in file hal_oad.h, it mentions,

    /* Note that corresponding changes must be made to oad.xcl when changing the source of Xtra-NV.
     * When using internal flash for XNV, (HAL_OAD_BOOT_PG_CNT + HAL_NV_PAGE_CNT) must be even.
     */
    #define HAL_OAD_XNV_IS_INT         FALSE
    #define HAL_OAD_XNV_IS_SPI        !HAL_OAD_XNV_IS_INT

    I changed it into,

    #define HAL_OAD_XNV_IS_INT         TRUE

    #define HAL_OAD_XNV_IS_SPI        !HAL_OAD_XNV_IS_INT

    After I changed, Rebuild Ok, but, after debug, the target reset failed.

    that is only one place i have changed.  should I change some thing else?

    I did saw in Over Air Download  for cc2530.pdf,

    13.3 Caveats and additional information.
    1. If anything changes that will affect the boot code, then the boot code must be re-compiled
    and then must be physically downloaded – OAD is impossible with parameters that are
    not identical to the fielded boot code. The applicable parameters are
    HAL_NV_PAGE_CNT when HAL_OAD_XNV_IS_INT and everything within the
    hal_board_cfg.h section labeled “Xtra-NV (used by OAD) implemented by internal flash or
    SPI eeprom.”

    not really understand this, should i change something in hal_board_cfg.h?

    Hope your help!

    thank you!

    Judy

     

  • Heelo Harry,

    Thx for the congrats!!!

    Then i will wait this mins and see if it works!

    But, the process of sending the image is taking to long time... is it correct? It takes like 10 or more min to send it? is it right?

    Anyway,

    Thx for the help!

  • /* Note that corresponding changes must be made to oad.xcl when changing the source of Xtra-NV.
     * When using internal flash for XNV, (HAL_OAD_BOOT_PG_CNT + HAL_NV_PAGE_CNT) must be even.
     */
    What the above is saying is that you should open the oad.xcl file. If you do, you will find this:

    // Uncomment when implementing OAD NV by dividing internal flash in half.
    //-P(CODE)BANKED_CODE=_CODE_START-_CODE_END,0x18000-0x1FFFF,0x28000-0x2FFFF,0x38000-0x3E7FF
    // Uncomment when implementing OAD NV by external E2PROM AND external flash is 256 KB or bigger.
    // (e.g. when using SmartRF05 Rev. 1.7 or later.)
    -P(CODE)BANKED_CODE=_CODE_START-_CODE_END,0x18000-0x1FFFF,0x28000-0x2FFFF,0x38000-0x3FFFF,\
    0x48000-0x4FFFF,0x58000-0x5FFFF,0x68000-0x6FFFF,0x78000-0x7C7FF

    13.3 Caveats and additional information.
    1. If anything changes that will affect the boot code, then the boot code must be re-compiled
    and then must be physically downloaded – OAD is impossible with parameters that are
    not identical to the fielded boot code.

    What the above is saying is that when you change HAL_OAD_XNV_IS_INT from FALSE to TRUE, you have to re-build and physically re-download the boot code. But since you are just starting, I am sure that you are doing just that - i.e. you are not trying to send OAD code with HAL_OAD_XNV_IS_INT=TRUE to a device that was originally setup with HAL_OAD_XNV_IS_INT=FALSE.

     

     

  • Are you sending OAD to a ZED? If so, there is a problem in 2.2.x with a ZR aging out its ZED children inadvertently which is fixed in 2.3.0 release.

  • I'm not using 2.2.x, I'm using 2.3.0. And I'm sending to a ZC!

  • I dont know what else to do! The problem of the post i send a picture is happening again, since I didnt make any changes. Just program again, because de Dongle sttoped to find the Coordinator. Do you know what problem can it be?

    I'm stuck, because I cant send images again to teste the 3 min thing.

    Help me please!

     

    Eliã Lima

  • Hi, Harry

    I am so happy , according to your replay, i have finished to send image completely. and, I pressed the button "restart device", it says "device restart completely".

    BUT , then, I wait over 5 minutes, well. I have 2 update codes.

    One is 133K, it is same the old programmer.   in this case, I cant find networks after "restart device". I think, this means I have download the code into the device, but something wrong,when boot looder try to update the code.   is this 133k is too big?  I just use internal flash. cc2530, i know.  it might be not enough, but why no any warning and error when i execute ZOAD.EXE?

    The other code is around 88K. and send the image successfully too. i lighted a led in the code. but, nothing happen after i pressed the button"restart device".

    And maybe the reason is  my Uart is not unstable? it happen sometimes, say "cant find host" or "... time out"

    Well, I am keeping to try to find the reason.

    If you have any advice, i would love to know it.

    Thank you very much!

    Have a nice weekend!

    Judy

  • The image to OAD includes everything (besides the oad boot loader itself) - the MAC, NWK, HAL, OSAL, Application and all - so 88K seems impossible. You should analyze what you did wrong to get a build that small and back it out. Since you are using internal flash (256K less NV pages and boot loader) divided in half ... so less than 128K, 133K would be impossible to fit and should not have linked. Image size is found at the bottom of the output .map file and looks like this:

     149 020 bytes of CODE  memory (+             109 028 range fill )
          26 bytes of DATA  memory (+ 74 absolute )
       6 841 bytes of XDATA memory
         192 bytes of IDATA memory
           8 bits  of BIT   memory
         495 bytes of CONST memory

    Errors: none
    Warnings: none

     

    Finally, yesterday I did not explicitly point out the other place in the oad.xcl file that must be changed when using internal flash:

    // Skip boot code, CRC/shadow & NV pages when calculating the CRC.
    //
    // Uncomment when implementing OAD NV by dividing internal flash in half.
    //-J2,crc16,=800-887,88C-3E7FF
    // Uncomment when implementing OAD NV by external E2PROM AND external flash is 256 KB or bigger.
    // (e.g. when using SmartRF05 Rev. 1.7 or later.)
    -J2,crc16,=800-887,88C-7C7FF
    //
    // Fill code gaps with 0xFFFF so that the CRC can be verified programatically.
    -HFFFF

     

    So if you really do have a ZigBee PRO project that fits in less than half of the internal flash, its checksum was not calculated correctly if the above change was not made.

    And finally, if you are downloading to the ZC and you use ZOAD to reset it to instantiate the downloaded code, then the ZED device that the ZOAD is talking through is lost without a parent, so you will not see the ZC when it comes back up. Re-start ZOAD - close it and re-open it.

     

  • Elian - the OAD slowness bug is between the dongle (aka ZOAD) and any router (including a ZC) and will be fixed in the upcoming 2.3.1 release, due out very soon.

  • Hello,
    I'm trying to do the changes for internal flash on OAD. But its not working correctly.
    The following error is shown:
    Error[e104]: Failed to fit all segments into specified ranges. Problem discovered in segment BANKED_CODE. Unable to place 58 block(s) (0x1ce6e byte(s) total) in 0x1ba21 byte(s) of memory. 
    The problem occurred while processing the segment placement command "-P(CODE)BANKED_CODE=0x0800-0x7FFF,0x18000-0x1FFFF,0x28000-0x2FFFF,0x38000-0x3E7FF", where at the 
    moment of placement the available memory ranges were "CODE:2bc2-7fff,CODE:181fa-1ffff,CODE:28000-2ffff,CODE:38000-39edc,CODE:39f00-3e7ff"

    My changes were:
    On hal_oad.h
    /* Note that corresponding changes must be made to oad.xcl when changing
    the source of Xtra-NV.
     * When using internal flash for XNV, (HAL_OAD_BOOT_PG_CNT + HAL_NV_PAGE_CNT) must be even.*/
    #define HAL_OAD_XNV_IS_INT         TRUE
    #define HAL_OAD_XNV_IS_SPI        !HAL_OAD_XNV_IS_INT

    On oad.xcl
    // Uncomment when implementing OAD NV by dividing internal flash in half.
    -P(CODE)BANKED_CODE=_CODE_START-_CODE_END,0x18000-0x1FFFF,0x28000-0x2FFFF,0x38000-0x3E7FF
    // Uncomment when implementing OAD NV by external E2PROM AND external
    flash is 256 KB or bigger.
    // (e.g. when using SmartRF05 Rev. 1.7 or later.)
    //-P(CODE)BANKED_CODE=_CODE_START-_CODE_END,0x18000-0x1FFFF,0x28000-0x2FFFF,0x38000-0x3FFFF,\
    //0x48000-0x4FFFF,0x58000-0x5FFFF,0x68000-0x6FFFF,0x78000-0x7C7FF

    Bottom of oad.xcl
    // Skip boot code, CRC/shadow & NV pages when calculating the CRC.
    //
    // Uncomment when implementing OAD NV by dividing internal flash in half.
    -J2,crc16,=800-887,88C-3E7FF
    // Uncomment when implementing OAD NV by external E2PROM AND external flash is 256 KB or bigger.
    // (e.g. when using SmartRF05 Rev. 1.7 or later.)
    -J2,crc16,=800-887,88C-7C7FF
    //
    // Fill code gaps with 0xFFFF so that the CRC can be verified programatically.
    -HFFFF

    Am I missing something?

    Eliã Lima

  • Error[e104]: Failed to fit all segments into specified ranges.

    The above error says it all - your application does not fit in half of internal flash, less space for OAD boot loader and NV pages. There are very few ZigBee PRO sample applications that would fit - on GenericApp, for example, only the End Device build fits.

  • Hello,

    Sometimes i have a problem like this: I always can join a network with ZOAD, but sometimes I can find Devices correctly, like the Coordinator and the ED connected to the net.But, sometimes it's almost impossible to get it, and when I find someone, i find a strange device with address 0x3800, that doesn't exist. So, I have to do all the step by step that we do to configure the devices to OAD programming, and pray to have good luck.

    This problem occurs sometimes after the program works. So, when i open the ZOAD this problem occurs from nothing.

    Is there any way to fix this? Or its just a ZOAD bug?

     

    Eliã Lima

  • As stated in this thread and some others, ZOAD is not a product - it is a simple, simplistic tool to demonstrate the OAD capability in a network of a few devices with SECURE off.

  • So,

    Is there any oficial SW to program OTA? Even if it is not from Texas Instruments.

    Anyway, thx for the help!

  • Can anybody point me towards:

    Over the Air Download (OAD) Detailed Design Document (F8W-2005-0020)

  • Is there an Over the wire method for uploading a new image to the 2530 SoC that is user space  friendly ?

    I don't want the End user to need to purchase a CC Debugger to upload a new image I provide. 

    In my product the end device, router and coordinators have the serial exposed via an on board USB.

     

    Jvh

  • I am working on  OAD and I experienced the same time out problem.  In my test environment I use a dongle key, a coordinator ( ZC) 

    and an end device(ZED) which I try to update . The ZOAD.exe  works properly and start downloading image to

    the ZED , but  after a while it times out.

    Moreover, it takes very long time to download the image:  a 230K  *.bin  image , takes obout 1 hour ( timed out  at 95% download).

    I read some post about  OAD and I think  there is something wrong with the OAD apps or the dongle obout  the

    download  rate. Is it possible to modify the download rate?  How?   Are there any compilation options to take

    into account to build my Zigbee device ( dongle, coord. and end-device)  to obtain a better download rate, or to

    avoid any timeout problem?  

    I would have tried with a smaller image but I am

    not confident on what I can cut-off  from the ZED application to downsize the image: I have removed any further

    application code leaving Zmain.c  which just blink leds, but  I didn't appreciate any image reduction in size .

    Could you help me or give me some suggestion?

    I am quite new to OAD and cc2530  and may not have read all the tips or the  post about OAD

    Thank you

     

     

  • Hello Roberto,

    Some things are important to see:

    - The OAD programming doesn't work good with the ZigBee Pro projects;

    - If you you have some code in your app that reset the ED or the ZC in some time you have to cut it.~

    - It's importante to know as well, that the OAD programming can divide your memory in 2 parts if you change some configurations, so you have to check if your app is dividing the flash or not, because if so, the code can be only up to 128 KB.

    About the size of the code, I've already program some code with the same size as yours and it takes no more the 30 min as I remember.

     

    Hope I could help you!

  • Hi,

    sorry to revive this old thread but this topic is still relevant. What's the actual problem of using ZOAD with "SECURE on" ?? I have deployed OAD succesfully in an unsecured network but as you said it doesn't work if I activate security or using Zigbee PRO. Can please point out what the main issues are for the ZOAD not to work in these conditions. I'm aware of the Zigbee OTA profile alternative but that option isn't appropriate for our application. We need to develop our own upgrade procedure and was hoping to use hal_oad.c as a guide.

    Thanks for your help. Best regards,

    Francisco