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.

CCS/CC2640: The program works perfectly on first launch, but has "Memory write failed" error on the next launch.

Part Number: CC2640
Other Parts Discussed in Thread: CC2650

Tool/software: Code Composer Studio

Hello,

I use the "simple_peripheral_cc2650_em" as the basis of a project. 

Firstly, I launched the stack and then launched the app for the first time and it worked perfectly, and I could connect with nRF scanner. But when I try to launch the app a second time I have some errors : 

Cortex_M3_0: GEL Output: Memory Map Initialization Complete.
Cortex_M3_0: GEL Output: Board Reset Complete.
Cortex_M3_0: Command=20 -- addr=0x00002000 -- length=0x00001000
Cortex_M3_0: File Loader: Memory write failed: Timed out waiting for target flashloader to execute command.
Cortex_M3_0: GEL: File: C:\Users\Public\Workspace_Max30101_2\simple_peripheral_cc2650em_app\FlashROM\simple_peripheral_cc2650em_app.out: Load failed.

So, I checked these two boxes :

Run--> Debug Configurations --> Target: "Reset the target on a connect" and "Reset the target on a program load or restart"

It launches correctly, but then I can't see anything on nRF Scanner. I guess it's because the stack is also reset, so I can't make it works like that.

Do you have any ideas why I can't launch twice without resetting the device ?

  • Hey,
    Assigning this to one of our experts.
  • Hi,

    Do you have this same problem when using an unmodified example?

    Does this happen when you stop debugging, then click the bug icon again? Or when you perform a reset (board reset)?

    Is it possible that you have disabled either debug access or write enable in the CCFG file or via Flash Programmer 2?

    If you use Flash Programmer 2, are you then able to load the .out or .hex files onto the device?

    Which CCS, XDCTools, BLE SDK and TI ARM Compiler version are you using?

    Best regards,
    Aslak
  • Hi,

    I have the same problem with the unmodified example.

    It happens when I click on the bug icon again.

    It already made that before i downloaded Flash Programmer 2 and I didn't modify any CCFG file.

    I didn't manage to program the .hex of the unmodified project with Flash Programmer 2

    I have CCS 8.2.0, I use ble_sdk 2_02_02_25, and I believe I have the TI v16.9.11.LTS has compiler.

    Could you tell me where I can see the XDCTools version ?

    Thank you

  • Hi,

    The XDCTools doesn't really matter. What sort of kit are you using? SmartRF06EB + CC2650EM? Custom board? Launchpad?

    Can you go and enable verbose output for the flash loader? Run -> Debug Configurations -> Your project (left side menu) -> Target (right side tab) -> Flash Settings -> Enable Verbose Output (scroll to bottom) -> Apply -> Debug (or close and hit bug button)

    Also, in Flash Programmer 2, can you click the wrench icon top right and choose Forced Mass Erase? Can you flash after this?

    Best regards,
    Aslak

  • Hi,

    We're actually using a CC2650EM mount on a EM adapter booster pack which is programmed with a XDS100V3.

    With the verbose output, It writes :

    Cortex_M3_0: GEL Output: Memory Map Initialization Complete.
    Cortex_M3_0: Flashloader: Verbose output enabled.
    Cortex_M3_0: GEL Output: Board Reset Complete.
    Cortex_M3_0: Writing Flash @ Address 0x00000000 of Length 0x00007c00
    Cortex_M3_0: Loading flashloader to target: FlashLoaderCC26x0.out
    Cortex_M3_0: Chunk 1: addr=0x00000000, length=4096, crc=0x29F28E99 (using block 0)
    Cortex_M3_0: Chunk 2: addr=0x00001000, length=4096, crc=0xBD56674E (using block 1)
    Cortex_M3_0: Chunk 3: addr=0x00002000, length=4096, crc=0xEC6499F8 (using block 0)
    Cortex_M3_0: Command=20 -- addr=0x00002000 -- length=0x00001000
    Cortex_M3_0: File Loader: Memory write failed: Timed out waiting for target flashloader to execute command.
    Cortex_M3_0: GEL: File: C:\Users\Public\Workspace_Max30101_3\simple_peripheral_cc2650em_app\FlashROM\simple_peripheral_cc2650em_app.out: Load failed.

    With Flash Programmer 2, I can flash if I erase first (Like if it was a simple debug with CCS), whether it is forced or a simple erase.

    Thanks,
  • Hi,

    Thank you - our tools team is away on external training, but I'll get back to you as soon as I can. This is a bit confusing.

    In the mean-time, does this happen if you use a different emulator, like XDS110, or if you use another EM?

    Best regards,
    Aslak
  • Also, after a forced mass erase, does this same scenario repeat itself if you use another sample application?
  • Some questions:

    1. Is the fail location (somewhere in [0x2000, 0x2000+0x1000]) consistent every time you program?
    2. Do you see this issue with all images you program, or just this one? Can you share it with us?
    3. Do you see the issue if you program a different CC2650 device (if you have access to another device), or is it isolated to a single device?

    TIABO

  • Hi,

    sorry for the late answer.

    First, it doesn't happen if I use a XDS 110, I can launch the debug as much as I want, but it happens with another CC2650-EM.

    Secondly, I have the issue with every image I try to program.

    I always have the same error message, so, I guess it always is the same fail location.