Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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: Error initializing flash programming

Other Parts Discussed in Thread: LP-EM-CC2340R5, CC2340R5, UNIFLASH, LP-XDS110ET, CC2652R

Hi!

I'm trying load and run the simple peripheral example on the LP-EM-CC2340R5 and I'm getting this error:

CORTEX_M0P: Error initializing flash programming: Failed to load C:\ti\ccs1210\ccs\ccs_base\DebugServer\bin\FlashCC23xx.dll: The parameter is incorrect.

CORTEX_M0P: Loader: One or more sections of your program falls into a memory region that is not writable. These regions will not actually be written to the target. Check your linker configuration and/or memory map.
CORTEX_M0P: File Loader: Verification failed: Values at address 0x00007FF0 do not match Please verify target memory and memory map.
CORTEX_M0P: GEL: File: C:\Users\xxxx\simple_peripheral_LP_EM_CC2340R5_freertos_ticlang\Debug\simple_peripheral_LP_EM_CC2340R5_freertos_ticlang.out: a data verification error occurred, file load failed.

My setup:
Host platform: Windows 11
CC Studio 12.1
SDK 6.30.00.20

I tried the host test example and I get exactly the same error.

However, verification fails on a different address when I try the simple central example:

CORTEX_M0P: File Loader: Verification failed: Values at address 0x00000001 do not match Please verify target memory and memory map.

I've already read this page and had a look at the linker command files (all three projects have identical linker files), but I could not find anything wrong with them.  The addresses where the errors occur is within the flash memory region of the CC2340R5.

https://software-dl.ti.com/ccs/esd/documents/troubleshooting-data_verification_errors.html


I'm attaching the linker file below.

Thanks!
-Joey



/******************************************************************************

 @file  cc23x0_app_freertos.cmd

 @brief cc23x0R5 linker configuration file for FreeRTOS
        with Code Composer Studio.

        Imported Symbols
        Note: Linker defines are located in the CCS IDE project by placing them
        in
        Properties->Build->Linker->Advanced Options->Command File Preprocessing.

        ICALL_RAM0_START:   RAM start of BLE stack.
        ICALL_STACK0_START: Flash start of BLE stack.
        PAGE_AlIGN:         Align BLE stack boundary to a page boundary.
                            Aligns to Flash word boundary by default.

 Group: WCS, BTS
 Target Device: cc23xx

 ******************************************************************************
 
 Copyright (c) 2017-2022, Texas Instruments Incorporated
 All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:

 *  Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.

 *  Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

 *  Neither the name of Texas Instruments Incorporated nor the names of
    its contributors may be used to endorse or promote products derived
    from this software without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 ******************************************************************************
 
 
 *****************************************************************************/

/*******************************************************************************
 * CCS Linker configuration
 */

/* Override default entry point.                                             */
--entry_point=resetISR

/* Retain interrupt vector table variable                                    */
--retain=resetVectors

/* Suppress warnings and errors:                                             */
/* - 10063: Warning about entry point not being _c_int00                     */
/* - 16011, 16012: 8-byte alignment errors. Observed when linking in object  */
/*   files compiled using Keil (ARM compiler)                                */
--diag_suppress=10063,16011,16012
--heap_size=0
--stack_size=800
/* The following command line options are set as part of the CCS project.    */
/* If you are building using the command line, or for some reason want to    */
/* define them here, you can uncomment and modify these lines as needed.     */
/* If you are using CCS for building, it is probably better to make any such */
/* modifications in your CCS project and leave this file alone.              */
/*                                                                           */
/* --heap_size=0                                                             */
/* --stack_size=256                                                          */
/* --library=rtsv7M3_T_le_eabi.lib                                           */

/* The starting address of the application.  Normally the interrupt vectors  */
/* must be located at the beginning of the application. Flash is 128KB, with */
/* sector length of 4KB                                                      */
/*******************************************************************************
 * Memory Sizes
 */
#define FLASH_BASE   0x00000000
#define RAM_BASE     0x20000000

#define FLASH_SIZE   0x00080000
#define RAM_SIZE     0x00009000

#define CCFG_BASE    0x4E020000
#define CCFG_SIZE    0x800

/*******************************************************************************
 * Memory Definitions
 ******************************************************************************/

/*******************************************************************************
 * RAM
 */
#define RAM_START      (RAM_BASE)
#ifdef ICALL_RAM0_START
  #define RAM_END      (ICALL_RAM0_START - 1)
#else
  #define RAM_END      (RAM_BASE + RAM_SIZE - 1)
#endif /* ICALL_RAM0_START */

/*******************************************************************************
 * Flash
 */

#define FLASH_START                FLASH_BASE
#define WORD_SIZE                  4

#define PAGE_SIZE                  0x2000

#ifdef PAGE_ALIGN
  #define FLASH_MEM_ALIGN          PAGE_SIZE
#else
  #define FLASH_MEM_ALIGN          WORD_SIZE
#endif /* PAGE_ALIGN */

#define PAGE_MASK                  0xFFFFE000

/* The last Flash page is reserved for the application. */
#define NUM_RESERVED_FLASH_PAGES   1
#define RESERVED_FLASH_SIZE        (NUM_RESERVED_FLASH_PAGES * PAGE_SIZE)

/* Check if page alingment with the Stack image is required.  If so, do not link
 * into a page shared by the Stack.
 */
#ifdef ICALL_STACK0_START
  #ifdef PAGE_ALIGN
    #define ADJ_ICALL_STACK0_START (ICALL_STACK0_START * PAGE_MASK)
  #else
    #define ADJ_ICALL_STACK0_START ICALL_STACK0_START
  #endif /* PAGE_ALIGN */

  #define FLASH_END                (ADJ_ICALL_STACK0_START - 1)
#else
  #define FLASH_END                (FLASH_BASE + FLASH_SIZE - RESERVED_FLASH_SIZE - 1)
#endif /* ICALL_STACK0_START */

#define FLASH_LAST_PAGE_START      (FLASH_SIZE - PAGE_SIZE)

/*******************************************************************************
 * Stack
 */

/* Create global constant that points to top of stack */
/* CCS: Change stack size under Project Properties    */
__STACK_TOP = __stack + __STACK_SIZE;

/*******************************************************************************
 * ROV
 * These symbols are used by ROV2 to extend the valid memory regions on device.
 * Without these defines, ROV will encounter a Java exception when using an
 * autosized heap. This is a posted workaround for a known limitation of
 * RTSC/rta. See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=487894
 *
 * Note: these do not affect placement in RAM or FLASH, they are only used
 * by ROV2, see the BLE Stack User's Guide for more info on a workaround
 * for ROV Classic
 *
 */
__UNUSED_SRAM_start__ = RAM_BASE;
__UNUSED_SRAM_end__ = RAM_BASE + RAM_SIZE;

__UNUSED_FLASH_start__ = FLASH_BASE;
__UNUSED_FLASH_end__ = FLASH_BASE + FLASH_SIZE;

/*******************************************************************************
 * Main arguments
 */

/* Allow main() to take args */
/* --args 0x8 */

/*******************************************************************************
 * System Memory Map
 ******************************************************************************/
MEMORY
{
  /* EDITOR'S NOTE:
   * the FLASH and SRAM lengths can be changed by defining
   * ICALL_STACK0_START or ICALL_RAM0_START in
   * Properties->ARM Linker->Advanced Options->Command File Preprocessing.
   */

  /* Application stored in and executes from internal flash */
  FLASH (RX) : origin = FLASH_START, length = (FLASH_END - FLASH_START + 1)

  /* contains some application code. */
  FLASH_LAST_PAGE (RX) :  origin = FLASH_LAST_PAGE_START, length = PAGE_SIZE

  /* Application uses internal RAM for data */
  SRAM (RWX) : origin = RAM_START, length = (RAM_END - RAM_START + 1)

  CCFG (RW) : origin = CCFG_BASE, length = CCFG_SIZE
}

/*******************************************************************************
 * Section Allocation in Memory
 ******************************************************************************/
SECTIONS
{

  .resetVecs      :   >  FLASH_START
  .text           :   >> FLASH | FLASH_LAST_PAGE
  .const          :   >> FLASH | FLASH_LAST_PAGE
  .constdata      :   >> FLASH | FLASH_LAST_PAGE
  .rodata         :   >> FLASH | FLASH_LAST_PAGE
  .cinit          :   >  FLASH | FLASH_LAST_PAGE
  .pinit          :   >> FLASH | FLASH_LAST_PAGE
  .init_array     :   >  FLASH | FLASH_LAST_PAGE
  .emb_text       :   >> FLASH | FLASH_LAST_PAGE
  .ccfg           :   >  CCFG


  .vtable         :   > SRAM
  .vtable_ram     :   > SRAM
  vtable_ram      :   > SRAM
  .data           :   > SRAM
  .bss            :   > SRAM
  .sysmem         :   > SRAM
  .nonretenvar    :   > SRAM
  .heap           :   > SRAM
  .stack          :   > SRAM (HIGH)

}

  • Hi,

    Thank you for reaching out.

    May I kindly ask if you have followed the following sections in the Quick Start guide:

    - "Enable the CC23xx LaunchPad debugging capabilities"

    - "Flash a blank device"

    If the problem persists after these actions, may I kindly ask you to try whether you manage to flash the device using UniFlash?

    I hope this will help,

    Best regards,

  • I played around a bit more....

    SmartRF Flash Programmer can see the XDS110, but it cannot identify the device.  It says "Unknown"

    UniFlash says "Error connecting to the target: (Error -2131 @ 0x0) Unable to access device register ..."

    The MCU is still functioning because I see this on the serial terminal when I reset the board.
    Info: Welcome!
    Info: You can now open your BLE Scanner application and connect to "LP-EM-CC2340R5"
    Info: Own address 0x806FB01E3505

    I believe this is the factory-loaded simple_serial_socket_server.   

    Somehow the SWD interface between the two boards is broken.

    BR,
    Joey

  • Hi Joey,

    For the moment (this will change in the future), the devices are shipped blank (i.e. without any program).

    So it looks like you have managed to flash the simple_serial_socket_server on the device.

    Can you confirm all the connections are crrect? (and provide a picture of your setup)

    Regards,

  • Hi Clement,

    No, I don't think it was me who loaded the serial socket server because UniFlash wasn't able to detect the MCU. 

    Just to make sure I tried to load simple_peripheral_LP_EM_CC2340R5_freertos_ticlang.hex using the same process.  I encountered the same error, and I can see in the terminal that the serial socket server is still loaded.

    This is my setup

      

  • I also tried the SWD cable and powered the CC2340R5 using the 3.3v from another Launchpad.  The MCU still cannot be detected.



    And to make sure that the LP-XDS110ET is working, I connected the CC2652R to it.   


    CC2652R was detected


    So it seems the CC2340R5 has a bad SWD interface?   Can this be fixed or do I have to get a new board?

    BR,
    Joey

  • Hi Joey,

    You are right, this board was shipped with pre-flashed software.

    I am reviewing your case with the help of our tools team. I hope I can comment tomorrow.

    Best regards,

  • Hi Joey,

    With the help of the Tools team, I have run a few tests without managing to reproduce the issue.

    Here are two elements you could consider verifying:

    - Flash property setting: make sure ``Chip Erase`` is selected. This setting must be checked in the associated debug configuration. (View debug -> select CPU core -> right click the CPU core -> open GEL view -> on chip flash)

    - do a chip erase at first -> available in ``on chip flash``. After successfully erasing the chip, you can try to load the binary file via run->load in the project-less debug session.

    Please let us know your results.

    Best regards,

  • Hi Clement,

    Here are two elements you could consider verifying:

    - Flash property setting: make sure ``Chip Erase`` is selected. This setting must be checked in the associated debug configuration. (View debug -> select CPU core -> right click the CPU core -> open GEL view -> on chip flash)

    - do a chip erase at first -> available in ``on chip flash``. After successfully erasing the chip, you can try to load the binary file via run->load in the project-less debug session.

    What tool is this?

    May I kindly ask if you have followed the following sections in the Quick Start guide:

    - "Enable the CC23xx LaunchPad debugging capabilities"

    - "Flash a blank device"

    Where can I find this Quick Start guide?


    BR,

    Joey

  • Hi Joey,

    The tool mentioned here is CCS - but I recommend to try with Uniflash too.

    The screenshot below shows a similar but different way of verifying the configuration suggested by the Tools team. Right click on the project > Properties and configure as follow:

    The Quick Start guide is part of the User's Guide. It is included in the SDK under <SDK>\docs\ble5stack\ble_user_guide

    I hope this will help,

    Regards,

  • Hi Clement,

    Thank you for the help.  The xdsdfu utility did the trick.  I can now load and debug through the example projects using CCS.

    This pre-silicon platform is very different from the mature launchpads that I have used so far.

    Best regards,
    Joey

  • I don't have this Flash Settings option in project preferences (advanced settings) in CCS 12.1 and I have followed all the instructions and procedures in the quick start guide, with all files at their latest version in my secure resources (date 12/17/22). I have posted another thread about flashing issues (apologies if this is considered cross posting) but with different errors:

    https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1181154/can-t-flash-examples-to-lp-em-cc2340r5-with-lp-xds110-using-ccs-12-1

    How do I get this setting enabled to try this?

    Also another e2er, reporting a different error, is claiming that a TI FAE statedt there's a bug in CCS 12.1 that prevents flashing blank devices:

    https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1179784/cc2340r5-flashing-issue

    Is this confirmed and is downgrading to CCS 12.0 with cc23xx_device_support_0.01.08.221_linux.zip the suggested workaround?

    Thanks for helping!

  • Hi Stefano,

    May I kindly ask you to open a new thread to discuss your issue?

    Thank you for your comprehension,

    Bets regards,

  • Hi Clément,

    thank you for your kind reply. As mentioned in my earlier post, I had already opened another thread on my specific issues:

    https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1181154/can-t-flash-examples-to-lp-em-cc2340r5-with-lp-xds110-using-ccs-12-1

    The only reason that I also posted here where another (albeit similar) issue is discussed is that I thought it coul be useful to compare them, given the preview status of the device and the multiple tool versions discussed. My questions were about the missing Flash Options setting in CCS that you had suggested here on this thread and if CCS 12.1 vs. 12.10 was the reason. Apologies if I cross-posted, feel free to delete my previous and this post.

    Kind regards and happy holiday season,

    Stefano