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: Can't Erase CC2340R5 chip from UniFlash after downloading the Zigbee "on_off_switch" example code

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

Tool/software:

I am using my own development board for CC2340R5 for developing a zigbee based smart switch. I am still trying to understand how does the zigbee protocol work via example codes. I managed to download the example code "on_off_switch" successfully onto the target. However, I just enabled the "logging" option from system configuration to see what are the logs sent via UART. I tried to download the new code but I always get this obnoxious error:

Trouble Writing Memory Block at 0x4e020000 on Page 0 of Length 0x800: Flash download failed! ...
File Loader: Verification failed: Target failed to write 0x4E020000
GEL: File: C:\Users\User\AppData\Local\Temp\ti_cloud_storage\onoff_switch_ED_2.out: Load failed.

I am using Code Composer Studio 20.0.1 with Segger J-Jlink as my main debugger. 

I trird to download the code via UniFlash, but I am getting the same error:

.

I decided to Erase the chip memory, but for some reason, there is no option available to do so:

UPDATE: it can download simple example code applications like "gpiointerrupt" and so on. 

The Problem is with Zigbee example codes. I am suspecting the new 'SimpleLink Low F3 SDK" v9.10 as I was using v8.40 before and it was working like a charm.

  • Hi Abdelrahman,

    0x4E020000 is the CCFG area.  The post-build steps of the Zigbee project should be applying the CRC to the CCFG from within CCS.  If you want to leave the CCFG as default then you could build the hex image without it (tiarmobjcopy with --remove-section=.ccfg included) or just remove that section manually before programming.  However this is not a fix to the problem at hand.  Please clarify the following:

    • Confirm that if you leave the Zigbee project at default settings, i.e. do not add SysConfig Logging, does the device program as expected?
    • What version of Uniflash are you using?  Are you able to erase chip memory after loading simple example code applications (i.e. gpiointerrupt)?
    • What is your CC2340R5 device revision (can be read out from Uniflash Settings & Utilities)?
    • Are you able to test with a XDS110 debugger connected instead?

    Regards,
    Ryan

  • - yes, I have left the everything as it's and it still doesn't want to program. I really suspect it has something to do with the v9.10 of  'SimpleLink Low F3 SDK' as I was able to program successfully using v8.40 before.

    - I have tried both the online Uniflash and the local one V9.0.0.5086 and it gives the same error. No, I am not able to erase the chip memory after loading simple example code application 

    - Uniflash Settings & Utilities doesn't show anything as illustrated in the post, However, This is the exact model number as mentioned by the distributor I bought it from: CC2340R52E0RKPR

    - Unfortunately, I don't have access to XDS110 debugger right now.

    I will try again by downgrading the SDK to v8.40 and see what will happen

  • I am now pretty sure it has something to do with the SDK v9.10.

    I had an old "on_off_switch" Zigbee project that was made via SDK v8.40 and it could be downloaded successfully to the target. 

    I tried to create a new project using the older SDK version in every possible but IDK it keeps generating the example codes for the newer SDK v9.10. I changed the SDK version from the project properties, but of course I keep getting errors that "wakeSem" symbol isn't defined (linker error). It makes sense not to compile as the example code has changed.

    Now I am stuck at a point where the newer version SDK can't download the code to target and I can't use the older SDK version.

  • UPDATE:

    I have created a new project which was made via SimpleLink F3 SDK v9.10 and it didn't flash as illustrated in the original post.

    I changed the code example with the one I have from the V8.40 SDK version and it wasn't flashed to the target (got the same error)

    I changed the SDK from the project properties back to V8.40 and it was flashed successfully.  

  • UPDATE 2: the no-rtos version of the zigbee base example can be flashed successfully but the rtos version isn't. still trying to understand why

  • Can you please try to switch the following between v8.40 and v9.10 to understand if either of them change the behavior?

    • lpf3_zigbee_freertos.cmd (Command linker file)
    • TI Clang Compiler (Project Properties -> General settings)

    Regards,
    Ryan