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.

OTA CC2530 bootloader

Other Parts Discussed in Thread: CC2530, Z-STACK

Hello,

I would like to know if we can modify the bootloader size from 0x800 to 0x1000 for exemple?

Changes in:

#define HAL_OTA_RC_START           0x0800 0x1000

-D_CODE_START= 0x0800 0x1000

...

I didn't really view where is calculate the CRC for the application file .hex

This CRC is not add (and so calculate) in the converter to do a .zigbee file? Which could be a problem if the address is different.

Thanks,

Launix.

  • Need to change more for Application build:

    ota.xcl:

    -D_CODE_START=0x0800

    everything in hal_ota.c wrt HAL_OTA_CRC_ADDR, etc.

     

    Need to change settings for boot loader, too, and build your own:

    interrupt_stubs.s51:

    OFFSET   EQU    0x800

    ota-boot.xcl:

    -D_CODE_END=0x07FF

     

    There might be something else to do as well, but you'll find it with this head start.

     

  • Hi Dirty Harry,

    Thanks to reply.

    I knew for these changes, right.

    I don't know where is calculate the CRC of application. Is it in OTAConverter and apply in *.zigbee?

    Or, this is made in binary file via IAR?

    If you say these changes permit me to have a bootloader more important, I will try also.

    Thanks,

  • You see how the boot loader calculated the CRC in the hal_ota.c. The OTA post-processing tool calculates the CRC over the image size and puts it at offset 0x0088 from the start of the image, wherever that start is relative to 0x0800 or 0x1000, etc - as you see, the output is a binary file, which means that it has no addressing information and everything is relative to where boot loader starts loading it into.

  • Hello,

    I need to increase the boot-code size from 0x0800 to 0xC00, because I had to modify "HalOTARead" and "HalOTAWrite" due to a different external NV memory.

    Here my changes:

    - in ota-boot.xcl: -D_CODE_END=0x07FF 0x0BFF

    - in interrupt_stubs.s51: OFFSET   EQU    0x800 0xC00

    - in hal_ota.h: #define HAL_OTA_RC_START 0x0800 0x0C00

                          #define HAL_OTA_CRC_ADDR 0x0888 0x0C88

    - in hal_ota.c: asm("LJMP 0x800 0xC00\n");

    - in ota.xcl: -D_CODE_START=0x0800 0x0C00

                      -Z(CODE)CRC=0x0888-0x088B 0x0C88-0x0C8B

                      -Z(CODE)PREAMBLE=0x088C-0x0897 0x0C8C-0x0C97

                      -P(CODE)BANKED_CODE=0x08000x0C00-0x7FFF,0x18000-0x1FFFF,0x28000-0x2FFFF,0x38000-0x3FFFF,0x48000-0x4FFFF,\
                      0x58000-0x5FFFF,0x68000-0x6FFFF,0x78000-0x7C7FF

    Compiling is good without any errors or warnings. The o.t.a firmware download goes also well and the OTA console shows at the end the message "Download Completed Successfully".

    But there are some problems because the new firmware's installation does not perform properly. I think that the program code overwrites the boot code: to have a confirm of that behaveaur, I inserted a flashing of the three leds for five seconds at the beginning of the boot code. If I download the boot code only, I see the flashing; in the other hand, if I download also the program code, the flashing is not visible. 

    Maybe there are other parameters to set, any suggestions?

  • hello, can you write the specific steps of the OTA for the CC2530,I need your guide,I failed in the OTA ,Thank you!
  • The steps already are shown in OTA user guide under Z-Stack document folder. Do you see this problem when you test on OTA server and SampleSwitch OTA example?