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.

UNIFLASH: Flash CC2340R5 using Standalone Command Line

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

Hi,

For some project it is required to flash device with CC2340R5 chip. When using Uniflash GUI with Launchpad XDS110S it works fine, I'm able to flash the .hex file.

But I need to flash through command line so I generate package from "Standalone Command Line" field in Uniflash, and run the script "one_time_setup.bat".

With the device that was already flashed with Uniflash GUI, the following command works well too: "./dslite-Cortex_M0P.bat --config=./user_files/configs/cc2340r5.ccxml --flash ./user_files/images/<fw_name.hex> --verbose

My first point is that the default command "./dslite-Cortex_M0P.bat" return the below error:

error: Cortex_M0P: File Loader: Verification failed: Values at address 0x4E02000C do not match Please verify target memory and memory map.
        Finished: 99%
Failed: File: user_files/images/pf2_superhex_v1.8.1.hex: a data verification error occurred, file load failed.

And the second point is that I can't flash a fresh device (not already programmed) using Command line. It return the below error:

DSLite version 12.5.888.714
Configuring Debugger (may take a few minutes on first launch)...
        Initializing Register Database...
        Initializing: CS_DAP_0
        Executing Startup Scripts: CS_DAP_0
        Initializing: Cortex_M0P
        Executing Startup Scripts: Cortex_M0P
        Initializing: SEC_AP
        Executing Startup Scripts: SEC_AP
info: Cortex_M0P: Flash loader: CC23xx_FLASH_LIBRARY_VERSION 3.17.10.24
Connecting...
info: Cortex_M0P: Debugging is not allowed. If this is not expected, check your CCFG.
info: Cortex_M0P:     If you are experiencing issues with loading your application, do the following (this will erase the chip):
info: Cortex_M0P:      - Code Composer Studio:
info: Cortex_M0P:        - End the current debug session (if any is active).
info: Cortex_M0P:        - View -> Target Configurations -> Right click on .ccxml file for your project -> Launch Selected Configuration.
info: Cortex_M0P:        - Right click on the 'Debug Probe/Cortex_M0P' and select 'Show all cores'.
info: Cortex_M0P:        - Select the 'Debug Probe/CS_DAP0' item after expanding the 'Non Debuggable Devices' item.
info: Cortex_M0P:        - Scripts -> CC23xx -> ChipErase  to start Chip erase.
info: Cortex_M0P:        - You should now be able to load your application to the target.
error: Cortex_M0P: Halting at entry of application is not allowed. Are you sure debugging is allowed?
info: Cortex_M0P: Running the application, without halting at the entry of the application.
fatal: Cortex_M0P: Error connecting to the target: (Error -1274 @ 0x0) Error encountered during connect sequence.  The specific reason is unknown but may be the result of trying to access a Core or logic that is inaccessible due to a lack of Power, Clocks, or Authentication (i.e. Security is preventing).  If blocked by security, and if supported, access may be allowed after following the Authentication process. (Emulation package 9.13.0.00201)
Failed: Operation was aborted

Someone already faced this issue ? Why it is possible to only flash already programmed devices using Command Line ?

Note: Using Uniflash V8.5.0.4593 and chip CC2340R5

Best regards,

Antoine

  • Hello Antoine,

    My first point is that the default command "./dslite-Cortex_M0P.bat" return the below error:

    Instead of using the standalone package, if you use the steps listed below, do you have the same issue?

    https://dev.ti.com/tirex/content/simplelink_lowpower_f3_sdk_7_10_00_35/docs/ble5stack/ble_user_guide/html/cc23xx/command-line-flashing-cc23xx.html?highlight=uniflash#flashing-device|-via-uniflash-command-line

    And the second point is that I can't flash a fresh device (not already programmed) using Command line. It return the below error:

    Looks like the CCFG information is missing (which makes sense with a new device).

    Someone already faced this issue ? Why it is possible to only flash already programmed devices using Command Line ?

    Yes. I did. I run into a similar issue with my new CC2340R5. See my thread:

    https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1289579/lp-em-cc2340r5-error-when-trying-to-connect-to-target-debugging-is-not-allowed-if-this-is-not-expected-check-your-ccfg 

    I have some more details on the issue that is not mentioned on the thread. Apparently for new devices where the CCFG is not configured (or if a chip erase was done), you need to flash a program with the CCFG information without explicitly connecting to the target first. It sounds counter intuitive but that is how it is supposed to work. My issue with the CCS project-less debug is that I was manually connecting to the core before trying to flash. A CCS project debug will know not to connect before the flashing. 

    I believe the issue with UniFlash is that UniFlash will try to connect to the target each time before flashing. This is causing a similar issue as the project-less debug. We need to investigate if there is a way to instruct UniFlash to not connect first for these clean devices.

    Thanks

    ki

  • I believe the issue with UniFlash is that UniFlash will try to connect to the target each time before flashing. This is causing a similar issue as the project-less debug. We need to investigate if there is a way to instruct UniFlash to not connect first for these clean devices.

    i was wrong. UniFlash GUI will do the right thing and flash before connect. It has information about the device to know to do this.

    I believe the issue is the standalone package. It is not calling the command properly.

    See the below document I mentioned earlier:

    dev.ti.com/.../command-line-flashing-cc23xx.html

    There is an option "--mode noConnectFlash" that needs to be used for this device when running from the command line. Looks like the standalone package generated from UniFlash does not have this. This would cause the issue.

    I would not use the standalone package for CC2340R5. Use the command in the document above. That is the official supported method. It may resolve your other data verification issue also.

  • Hi Ki,

    Thanks a lot for all the details and documentation.

    Using the command in the document you mention with parameter --mode noConnectFlash solved my issue.

    Best regards,

    Antoine