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.

CC1311P3: Generating binary for the CC1311 bootloader

Part Number: CC1311P3


Hi Everyone, 

I'm trying to flash a 1311 through the ROM bootloader. The bootloader part is not problem, I can communicate, erase sectors and flash a program. I can't generate a binary to flash to the controller though.... 

The binary created by the 'empty' project is 350kB?  I couldn't get the Tiobj2bin to run and all threads on the topic are either six years old or for different architectures and if I understood correctly, there were some recent changes to the build process and/or the TIobj2bin. To be honest, it's a bit messy and I don't know enough about binary generation/TI controller architectures/the Tiobj2bin process to quickly find that information. 

So could someone point me in the right direction on how to generate a binary for a 1311? 

I'm currently using CCS 12.4 (updating if I can find my admin) and the gcc to build the 'empty' example. I'm using a CC1311P3 Launchpad as a test but the real application uses an R3 if that matters. 

Thanks and greetings

Max

  • Hi Arthur, 

    thanks for the reply. 

    I did something similar (found somewhere here on the forum) but probably incomplete or wrong parameters. I'm out of office today but will try that tomorrow and get back to you. 

    Thanks and greetings

    Max

  • Hi Arthur,

    I just had a chance to try the post build actions. In the GCC  version of the empy project, the CG_TOOL_HEX variable is undefined. I tried importing the TI-CLANG version of the project and again added the post-build steps from the link. The post-build step then fails with the following errror: 

    C:/ti/ccs1250/ccs/tools/compiler/ti-cgt-armllvm_3.2.0.LTS/bin/tiarmhex.exe -order MS --memwidth=8 --romwidth=8 --intel -o empty_LP_CC1311P3_tirtos7_ticlang.hex empty_LP_CC1311P3_tirtos7_ticlang
    Translating to Intel format...
    "empty_LP_CC1311P3_tirtos7_ticlang.out" .resetVecs ==> .resetVecs
    "empty_LP_CC1311P3_tirtos7_ticlang.out" .text ==> .text
    "empty_LP_CC1311P3_tirtos7_ticlang.out" .rodata ==> .rodata
    "empty_LP_CC1311P3_tirtos7_ticlang.out" .args ==> .args
    "empty_LP_CC1311P3_tirtos7_ticlang.out" .cinit ==> .cinit
    "empty_LP_CC1311P3_tirtos7_ticlang.out" .ccfg ==> .ccfg
    C:/ti/ccs1250/ccs/utils/tiobj2bin/tiobj2bin empty_LP_CC1311P3_tirtos7_ticlang.out empty_LP_CC1311P3_tirtos7_ticlang.bin C:/ti/ccs1250/ccs/tools/compiler/ti-cgt-armllvm_3.2.0.LTS/bin/armofd C:/ti/ccs1250/ccs/tools/compiler/ti-cgt-armllvm_3.2.0.LTS/bin/armhex C:/ti/ccs1250/ccs/utils/tiobj2bin/mkhex4bin
    tiobj2bin.bat failed on C:/ti/ccs1250/ccs/tools/compiler/ti-cgt-armllvm_3.2.0.LTS/bin/armofd
    Please see processors.wiki.ti.com/.../Tiobj2bin_Failed
    tiobj2bin.bat failed on C:/ti/ccs1250/ccs/tools/compiler/ti-cgt-armllvm_3.2.0.LTS/bin/armhex
    Please see processors.wiki.ti.com/.../Tiobj2bin_Failed
    C:/ti/ccs1250/ccs/utils/tiobj2bin/mkhex4bin failure occurred. Giving up.
    C:/ti/simplelink_cc13xx_cc26xx_sdk_7_10_02_23/tools/common/oad/oad_image_tool --verbose ccs C:/Users/max.menges/workspace/update_red/empty_LP_CC1311P3_tirtos7_ticlang 7 -hex1 Debug/empty_LP_CC1311P3_tirtos7_ticlang.hex -k C:/ti/simplelink_cc13xx_cc26xx_sdk_7_10_02_23/tools/common/oad/private.pem -o Debug/empty_LP_CC1311P3_tirtos7_ticlang_oad
    makefile:171: recipe for target 'post-build' failed
    warning: Data is being written to auto-generated file empty_LP_CC1311P3_tirtos7_ticlang.x1
    warning: Data is being written to auto-generated file empty_LP_CC1311P3_tirtos7_ticlang.x2
    warning: Data is being written to auto-generated file empty_LP_CC1311P3_tirtos7_ticlang.x3
    Der Befehl "C:\ti\ccs1250\ccs\tools\compiler\ti-cgt-armllvm_3.2.0.LTS\bin\ofd470" ist entweder falsch geschrieben oder
    konnte nicht gefunden werden.
    File does not exist: at XML_TI_OFD.pm line 877.
    Traceback (most recent call last):
    File "oad_image_tool.py", line 542, in <module>
    File "oad_image_tool.py", line 341, in main
    File "oad_image_tool.py", line 184, in createAppStackBinfile
    File "imgBinUtil.py", line 252, in updateImgLen
    File "imgBinUtil.py", line 105, in writeBytes
    OverflowError: can't convert negative int to unsigned
    [10836] Failed to execute script 'oad_image_tool' due to unhandled exception!
    gmake[2]: [post-build] Error 1 (ignored)
    C:/ti/simplelink_cc13xx_cc26xx_sdk_7_10_02_23/tools/zstack/zigbee_ota_image_converter/zOTAfileGen C:/Users/max.menges/workspace/update_red/empty_LP_CC1311P3_tirtos7_ticlang/Debug/empty_LP_CC1311P3_tirtos7_ticlang_oad.bin C:/Users/max.menges/workspace/update_red/empty_LP_CC1311P3_tirtos7_ticlang/Debug/ BEBE 2652 00000001

    I checked the http://processors.wiki.ti.com/index.php/Tiobj2bin_Failed website and implemented the suggested fixes (in the GCC version of the empty project), i.e. removed to post-build steps and enabled the GNU Objcopy Utility. This compiles but again creates a binary with ~350kB size. 

    Any suggestions? 

    Greetings

    Max

  • Hi Max,

    Could you check the binary contents?

    I feel like this is the expected behaviour, as the firmware will be put at the start of the binary file, but CCFG, the device configuration, will be located at the end of the flash. Look at this memory map from a ticlang project:

    MEMORY CONFIGURATION
    
             name            origin    length      used     unused   attr    fill
    ----------------------  --------  ---------  --------  --------  ----  --------
      FLASH                 00000000   00058000  0000502c  00052fd4  R  X
      GPRAM                 11000000   00002000  00000000  00002000  RW X
      SRAM                  20000000   00014000  00009810  0000a7f0  RW X
      LOG_DATA              90000000   00040000  00000000  00040000  R   
    
    
    SEGMENT ALLOCATION MAP
    
    run origin  load origin   length   init length attrs members
    ----------  ----------- ---------- ----------- ----- -------
    00000000    00000000    000000d8   000000d8    r--
    00000000    00000000    000000d8   000000d8    r-- .resetVecs
    000000e0    000000e0    00004efc   00004efc    r-x
    000000e0    000000e0    00004c54   00004c54    r-x .text
    00004d34    00004d34    000001a8   000001a8    r-- .rodata
    00004edc    00004edc    00000100   00000100    r-- .cinit
    00057fa8    00057fa8    00000058   00000058    r--
    00057fa8    00057fa8    00000058   00000058    r-- .ccfg

    I want to bring your attention to the FLASH length, which is 0x58000. Now, if you look at .ccfg, you see that it is starting at 0x57FA8.

    So what is happening right now is that tiobj2bin is working as expected, but due to the nature of the binary format, it will include all of the empty segments regions, until it reaches the .ccfg segment. Hence the size of the binary which is matching the size of the flash in the device.

    Regards,

    Arthur

  • Hi Arthur, 

    yes, the memory map looks similar on the GCC: 

    The binary looks like this: 

    There is about 16kB of program and then some plaintext warnings about running out of mem. After the plaintext warning there are a couple of non-zero bytes here and there. And then just zeros from 0x4510 to the end of the flash where there is a sector with the CCFG.

     

    Do I just write that file to flash as is? Minus the CCFG sector at the end? Or do I need to do some more processing? 

    Greetings

    Max

  • Hi Max,

    You should safely be able to flash that complete file to your flash memory, with or without CCFG (as long as the existing CCFG is configured as you wish).

    If you have your own bootloader flash software, you can also try to ignore the areas where there is no data of interest, and skip directly to CCFG.

    Regards,

    Arthur

  • Hi Arthur, 

    I've been busy with other things and only got to testing this now. Just wanted to let you know that everything worked and I can now update through the bootloader.

    Thanks for the help.

    Greetings

    Max