CC2745R10-Q1: Downloading an image over OAD at a custom location in the flash memory

Part Number: CC2745R10-Q1
Other Parts Discussed in Thread: UNIFLASH, SYSCONFIG

Tool/software:

I am trying to implement the dual-image OAD with SSB in CC2745R10. I have flashed the SSB (.bin) and the primary application (.hex) using Uniflash. I wish to store a combined image of SSB and Secondary application in the flash memory following the primary image. So the layout will look like this:

SSB0

App0

SSB1

App1

After OAD, SSB1 and App1 should be the active partition.

I am able building two images: one for the new SSB (with start address as 0x0, although I want this image to be stored right after App0) and one for the secondary app (with addressing considering the above layout). I combined the respective .bin files to create a single binary. However, when I try doing the OAD from the mobile app, and then try to read the memory locations following the primary image, it is all 0xFF. I have used the test_keys provided in the examples in the SDK for app and SSB as suggested, and also created an NVS region for the entire section of flash where I want to store SSB1 and App1.

Is there something missed or a different way of doing this?

  • Hello,

    There can only be one SSB slot. So the flash layout must be something like below:

    SSB

    APP0

    APP1

    In your case, because Secure Boot can only have one SSB, it's most likely not considering the other valid and deleting it.

    Here are my recommendations:

    1. Remove the second SSB, and match the flash layout above. 

    2. Don't use an SSB, and instead integrate your own bootloader into the application images. In order to do this, remove the SSB slot from your sysconfig, and integrate that SSB code into the main application code. They should now be contained within one .hex file:

    Bootloader0App0.hex --> Signed by secure boot

    Bootloader1App1.hex --> Signed by secure boot.

    Now, when the device boots, it will boot into the bootloader for App0 (or App1, whatever image has the highest version number). 

    Please let me know if you have further questions.

    Best,

    Nima Behmanesh

  • Hello, 

    By integrate bootloader code and application code, did you mean appending the individual files (bootloader0.hex and app0.hex) using a tool like srec_cat, and then signing the merged image?

  • Hello,

    Yes, your understanding is correct.

    Best,

    Nima Behmanesh

  • Hello, 
    I generated .bin files for the bootloader code and application code and merged them using srec_cat. However while using sbtool to sign them, it is considering the wrong slot size (the slot size of the first image only). Is there a different way to sign merged images?

  • Hello,

    The size of the slot should be large enough to encompass both the bootloader and application code. You should only have two slots and no SSB configured in your sysconfig file.

    1. Combine bootloader and image. I don't mean having two .hex files and combining them, I mean that they should be in the same project and compiled as one .hex file without having to combine them via srec_cat.

    2. Sign the combined image making sure that it encompasses the entirety of the bootloader and image.

    Does that make sense? If it doesn't please let me know and I can try to rephrase and elaborate on what I mean.

    Best,

    Nima Behmanesh