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.

CC2640R2F: How use uniflash to program OAD files?

Part Number: CC2640R2F
Other Parts Discussed in Thread: UNIFLASH, CC2640

Hi,

I used to program the OAD files in my CC2640 by IAR + Uniflash as descripted in the UG. It works, but not convenient.

Now, I want to use Uniflash to program the OAD files (BIM, Stack, Persistent, and App) to CC2640. I tried few times, however, it doesn't work. 

I think the address for BIM and Stack must be incorrect. Could you tell me what the value here for each one? And where is in the code to define these address? All the codes are originally simple_peripheral_oad_onchip base on sdk_5_10_00_02. 

Thank you.

Best regards,

Victor Chu

  • Hi Victor,

    This is known as Creating a Production Image and is also covered in the BLE Enhanced OAD SimpleLink Academy Lab.

    Regards,
    Ryan

  • Hi Ryan,

    Thank you for your kindly help. I'm also sorry for reply late.

    I can' find the answers in the related sources, it seem like all of these contents are based on off_chip_oad.

    I'm working on on_chip_oad, I'm wondering can I program the 4 codes (bim + app+ stack + persisten) together by Uniflash, or can I use SRecord to make these 4 codes into one first, then program the merged code by Uniflash.

    It would be very nice of you if you could help me resolve this question.

    Thank you again.

    Best regards,

    Victor Chu

  • You will need to use SRecord to combine the stack + app merged binary image, persistent app binary image, and BIM hex file, or use Uniflash to accomplish this same task with all three individual files.  Make sure to erase all device memory before programming.  Please post screenshots of the process you are attempting to use if you continue to encounter issues.

    Regards,
    Ryan

  • Hi Ryan,

    I tried few times by Uniflash with different address, binary type (hex or bin), it failed for different error. I'm pretty sure that all these binary code are ok. I think there might be some mistake about the program sequence, address, and binary type (hex or bin) selection.

    It would  be very nice of you, if you could explain more detail about Uniflash program. I would appreciate it very much if you could attach a screenshot of Uniflash.

    Thank you.

    Best regards,

    Victor Chu

  • Hey Victor,

    I will look into this and follow up soon. In your most recent screenshot, it looks like you are also flashing the persistent image stack binary, but you do not select an address. This could be the source of the issue.

  • Hi Ammar,

    I absolutely agree with you. I actually know there must be something wrong with the address, but don't know how to fix it.

    Like my first ticket, what's the following address? And where are the settings in the code?

    Thank you.

    Best regards,

    Victor Chu

  • Hey Victor,

    I would take a look at the .map files generated for each project, and you will get an idea of where things are placed in memory. Additionally, you can refer to the .cmd files for the memory map (in code). I would cross reference the projects together with our documentation provided to get a better understanding of how they all tie together and are mapped out.

    Please let me know if you have questions along the way, I apologize as I have not had time just yet to investigate this.

  • Hi Ammar,

    I understand your situation.

    Thank you for the clues. I found the definition of ICALL_STACK0_START, OAD_TGT_FLASH_START in the *.xcl files under config. But I still cannot find the definition for DEVICE_SIZE and BIM_SIZE which is of BIM's start address. Could you tell me where they are?

    Please take a look at these 4 .map files. All the codes are original come from the SDK5_10_00_02. Since I cannot upload files here, so please check them in project "simple_peripheral_oad_onchip".

    By the way, like Ryan said, SRecord tools can combine these 4 files into 1. Could you tell me how to do it. I think it will helpful to me.

    Thank you!

    Best regards,

    Victor Chu

  • Hey Victor,

    You'll have to check the cc26xx_bim_r2.cmd file for more details on the BIM memory map (i.e. BIM_SIZE).

    By the way, like Ryan said, SRecord tools can combine these 4 files into 1. Could you tell me how to do it. I think it will helpful to me.

    Take a look at the 4th task of our Simplelink Academy Module on BLE Enhanced OAD.

  • Hi Ammar,

    I check the reference resource for SRecord. However, it is for off-chip OAD, and only connect the BIM and Stack.

    <SREC_LOC>/srec_cat.exe <CCS_WORKSPACE_LOC>/bim_oad_offchip_cc2640r2lp_app/FlashOnly/bim_oad_offchip_cc2640r2lp_app_FlashOnly.hex -intel <CCS_WORKSPACE_LOC>/multi_role_cc2640r2lp_app/FlashROM_StackLibrary/multi_role_cc2640r2lp_app_FlashROM_StackLibrary_oad_merged.bin -bin -o mutli_role_oad_production.hex -intel

    Could you tell me how to connect the 4 files (App, Bim, Stack, Persistent) together? I tried few times as following:

    srec_cat.exe ../sp_oad_onchip_cc2640r2lp_bim_onchip_FlashOnly_unsecure.hex -intel ../sp_oad_onchip_cc2640r2lp_app_FlashROM_unsecure_oad.bin -bin ../sp_oad_onchip_cc2640r2lp_persistent_app_FlashOnly_unsecure.bin -bin ../sp_oad_onchip_cc2640r2lp_stack_FlashROM_unsecure_oad.bin -bin  -o test.hex -intel

    There are errors happen shown as following. Could you please help me fix this problem? (All the environmental setting are correct.)

    D:\MyDocs\Working\OTA\srecord-1.63>srec_cat.exe ../sp_oad_onchip_cc2640r2lp_bim_onchip_FlashOnly_unsecure.hex -intel ../sp_oad_onchip_cc2640r2lp_app_FlashROM_unsecure_oad.bin -bin ../sp_oad_onchip_cc2640r2lp_persistent_app_FlashOnly_unsecure.bin -bin ../sp_oad_onchip_cc2640r2lp_stack_FlashROM_unsecure_oad.bin -bin -o test.hex -intel
    srec_cat: ../sp_oad_onchip_cc2640r2lp_persistent_app_FlashOnly_unsecure.bin:
    0x00FF: warning: redundant 0x00000000 value (0x4F)
    srec_cat: ../sp_oad_onchip_cc2640r2lp_persistent_app_FlashOnly_unsecure.bin:
    0x00FF: warning: redundant 0x00000001 value (0x41)
    srec_cat: ../sp_oad_onchip_cc2640r2lp_persistent_app_FlashOnly_unsecure.bin:
    0x00FF: warning: redundant 0x00000002 value (0x44)
    srec_cat: ../sp_oad_onchip_cc2640r2lp_persistent_app_FlashOnly_unsecure.bin:
    0x00FF: warning: redundant 0x00000003 value (0x20)
    srec_cat: ../sp_oad_onchip_cc2640r2lp_persistent_app_FlashOnly_unsecure.bin:
    0x00FF: warning: redundant 0x00000004 value (0x49)
    srec_cat: ../sp_oad_onchip_cc2640r2lp_persistent_app_FlashOnly_unsecure.bin:
    0x00FF: warning: redundant 0x00000005 value (0x4D)
    srec_cat: ../sp_oad_onchip_cc2640r2lp_persistent_app_FlashOnly_unsecure.bin:
    0x00FF: warning: redundant 0x00000006 value (0x47)
    srec_cat: ../sp_oad_onchip_cc2640r2lp_persistent_app_FlashOnly_unsecure.bin:
    0x00FF: warning: redundant 0x00000007 value (0x20)
    srec_cat: ../sp_oad_onchip_cc2640r2lp_persistent_app_FlashOnly_unsecure.bin:
    0x00FF: multiple 0x00000008 values (previous = 0x99, this one = 0xFF)

    Thank you.

    Best regards,

    Victor  Chu

  • Hi Victor,

    Ammar is currently out of the office. I would recommend to open a new thread to discus the remaining questions you have. 

    Thank you for your comprehension.

    Best regards,