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: Flash/debug issue

Part Number: CC2340R5
Other Parts Discussed in Thread: UNIFLASH, SEGGER

Tool/software:

Hi,

I am using the TI CC2340R5 DK and everything works fine using CCS and/or Theia.

I moved to Cmake solution to build standalone to run in out CI systems.

I can generate hex/out/bin files which works fine using Uniflash.

I try now to use J-link to flash to DK and the application does not run as expected.

I think the issue is around the CCFG CRC records. 

I followed the instruction at this link: https://software-dl.ti.com/simplelink/esd/simplelink_lowpower_f3_sdk/8.10.00.55/exports/docs/ble5stack/ble_user_guide/html/memory/memory_management-cc23xx.html#sec-flash-user-record

I manged to Generate a User Record binary file with CRC, then I tried to flash using uniflash at address 0x4e020750 but I got this error:

"File: C:/ti/simplelink_lowpower_f3_sdk_8_10_01_02/tools/common/crc_tool/output.bin: Load failed."

Couple of questions:

1. What can generate the failing when writing the user record?

2. Is it possible to build an .out file which does not overwrite the CCFG so I can use jlink to flash regardless?


I also tested the binary file provided to Segger to test using jlink and it does work fine (here the reference link https://wiki.segger.com/File:TI_LP_EM_CC2340R5_Blinky.zip)

Thank you

  • Hi Luca,

    Can you provide the file you are trying to flash? I'll try it on my end and report back.

    Best regards,

    Bun

  • Hi Bun,

    I have sent the file to you directly.

  • I will follow-up by 11/1 at the latest

    Bun

  • Hi Luca,

    1. After digging through our software changes, only CCS12.7 or later and Uniflash 8.7 or later will support J link. Please confirm your version, which will help narrow down the root cause.

    2. In CCS after a device (CC2340) have been connected, under Tools -> On-chip Flash you find the option shown below to skip CCFG programming

    Best regards,

    Bun

  • Hi Bun,

    Thank you for reply.

    We use uniflash 8.8.0.4946, but we would use Segger suite for flashing and debugging as stated in the thread on top.

    Using JFlashLite we can flash but then the application does not run, I guess because of CCFG records. 

    Anyway I had a gowith uniflash and jlink and it fail to flash, below you can find an image that shows the failure reason.

    Thank you

  • Hi Luca,

    I apologize for the delayed response, but here are my findings

    1. After digging through the hex file provided, I found that these CRC addresses below are all zeros when there should be some value there if you are planning to use a J-link as it does not automatically program the correct values. Please re-check your post build steps with CRC tool as it should re-write the  correct values in these addresses.

    • 0x4E02000C

    • 0x4E02074C

    • 0x4E0207FC

    2. Regarding your latest reply, this is expected as J-links do not automatically program the correct CRC values and when the software cross-checks the CRC value against its calculated value, based the hex data, it will not match which prevents flashing or executing.

    Best regards,

    Bun

  • Thanks for support, I finally find out a way to build the final image.

    Here the steps, hopefully it might help others in the future:

    1. build mcuboot
    2. use crc_tool toset CCFG registers to mcuboot 
    3. use tiarmobjcopy to generate ihex file
    4. build application
    5. use imgtool to generate header and ihex output
    6. use mergehex to merge bootloader and application in a single hex file

    After that Jlink flashes successfully the ihex image to target