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.

CC2340R5-Q1: OAD production file

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

Tool/software:

Hello Team,

We implemented OAD in 2340 device. For production purpose we combine mcuboot, persistent and application file but the size of bin file is 12,78,082 KB. because of file I am not able to flash through any tool so kindly help me how can I generate the production file. I generated the hex file which size is 928 KB but using TI simple Link mobile application or using BTool we cant flash it over the air (hex file not allow). so let me know how can i generate bin production file.

  • Hello,

    Are you able to flash the three images separately? What are the sizes of the individual image binaries?

    .hex files are bigger because they contain more information than a binary (for instance, where to place what in memory).  

    Best,

    Nima Behmanesh

  • Yes, I am able to flash separately. After combining files, .hex file size is 998KB whereas .bin is 12,78,082KB. 

    Separately, MCU Boot is 43KB, Persistant is 174 KB and application file is 199 KB.

    I am using following command in CMD(command prompt)

    start srecord-1.65.0-win64/bin/srec_cat   

    OAD/mcuboot_onchip_LP_EM_CC2340R5_nortos_ticlang.hex -intel 

     OAD/basic_persistent_LP_EM_CC2340R5_freertos_ticlang.bin -bin -offset 0x0006000 

     OAD/application.bin -bin -offset 0x00032000  

    -o applicatiBin.bin -bin  (For bin file genration)

    -o SapplicationHex.hex -intel   (For hex file generation)

  • Hello,

    Yes, I am able to flash separately. After combining files, .hex file size is 998KB whereas .bin is 12,78,082KB. 

    Since you can flash separately, that means that the combined binary should be able to fit in the CC2340R5 memory. The .hex will be larger because it has more information than what's actually being flashed.

    I'm not quite sure what the srecord tool is. I don't believe we have any tools that will combine binaries either. It may be an issue with the tool.

    Best,

    Nima Behmanesh

  • Actually, for 26x2 Ti suggested srec_cat (For production file). 

  • Hello,

    One thing that could be tried is to convert the .bin files to .hex files and only combine .hex files. In other words, try combining the files when they are of the same type. I'm going to try this on my end later this week, and will update you with my process.

    Best,

    Nima Behmanesh

  • Hello,

    I should have an update you for on Wednesday.

    Best,

    Nima Behmanesh

  • Hello,

    So after looking into this, there really isn't a way to combine those files.

    The reason is because the CCFG are memory mapped registers to 0x4E002000. This is address is much farther than the actual amount of memory on the device. When you try to create a binary that has the CCFG/SCFG in it, it will fill everything in-between the application's end address and 0x4E002000 thus resulting in a > 1GB binary.

    What you can do:

    1. Rip the CCFG from the application binary:

    ${CG_TOOL_ROOT}/bin/tiarmobjcopy -O binary ${BuildArtifactFileBaseName}.out ${BuildArtifactFileBaseName}.bin --remove-section=.ccfg

    2. Flash the CCFG and application separately. 

    In summary there isn't a way to create a complete binary because binaries do not have any information about where to flash. Therefore, the CCFG cannot be included in it, thus resulting a minimum of at least two binaries.

    Best,

    Nima Behmanesh

  • Can you please guide use how we can flash ccfg separately. Earlier i tried but in uniflash it is showing error at the time of flashing and most important point is whenever we need to flash over the air then ccfg not consider because in btool and in TI application there is no facility for combine file flash

  • Hello,

    What is the error being shown? You will need to flash both the SCFG and CCFG only once.

    Please outline your process for flashing the CCFG/SCFG.

    Best,

    Nima Behmanesh

  • Hello Nima,

    kindly go through the below image

    I have two points

    1. how can I add CCFG file

    2. at First time flash through uniflash we can flash MCUboot + Persistent +Application but is it possible that I can merge this all three file without CCFG and flash through TI mobile application through OAD without any issue. Because we notice that if we flash only application .bin file then we faced some issue like if we pass Find vehicle command once only then also it continue ON

  • Hello,

    2. at First time flash through uniflash we can flash MCUboot + Persistent +Application but is it possible that I can merge this all three file without CCFG and flash through TI mobile application through OAD without any issue. Because we notice that if we flash only application .bin file then we faced some issue like if we pass Find vehicle command once only then also it continue ON

    I believe there is a misunderstanding here.

    MCUBoot and Persistent are not meant to be updated over the air. MCUBoot is the bootloader, that verifies images before they are executed in flash. The persistent application implements the OAD service allowing binary files to be uploaded to the device over the air. It's called persistent because it doesn't change and stays on the device.

    The application is the only thing that actually gets updated over the air. It's not possible to combine the CCFG + MCUBoot + Persisent + Application, because then the device would have to write over itself, and the code that handles the over the air process. Additionally, it's not possible to combine these into a binary. The CCFG is memory mapped to 0x4E002000, and that address exists outside of flash address range. So if you tried to include the CCFG into a binary, it would fill up the space gap with 0's causing a large binary size. 

    --

    In the case that you wanted to update MCUBoot or persistent, this would have to be done over a serial protocol. The CCFG is only meant to be flashed once. The binaries you are uploading to device over the air are not meant to have the CCFG, since the CCFG should not change in between OTA updates.

    In summary:

    1. The CCFG should be flashed once, and cannot be updated over the air.

    2. MCUBoot and the persistent app cannot be updated over the air. These can be updated via a serial protocol.

    3. The actual application can be updated over the air, but must be in binary format without the CCFG. It should only contain the application.

    Best,

    Nima Behmanesh