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.

F28M36H33B2: Unable to connect to core after program load (Unable to access the DAP)

Part Number: F28M36H33B2
Other Parts Discussed in Thread: CONTROLSUITE

I had a project that was working fine on my Concerto Board. The project was written in C and I just made a few changes to port it to C++. The program compiled successfully and I then loaded the program into RAM to test. I noticed that CCS showed the dialog that says Erasing and Loading FLASH, which was not what I expected when loading into RAM. It also did not finish the load and then just hanged. After this I was Unable to connect to the device at all. I get the following error: 

Error connecting to the target:
(Error -1170 @ 0x0)
Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK).
(Emulation package 9.3.0.00042)

I tried a few things to see if it was a hardware problem, but eventually tried another board and the exact same thing happened. It seems that something in my program that I loaded had written to the wrong memory space and now locked up the device. 

Then I tried to startup the device in "wait in reset" mode by doing the following:

* I enabled halt target on connect.

* Then I press and hold the reset button on my PCB to keep the device in reset.

* Then I try to connect to the target in the debug window, which if I understand correctly will then pull the EMU0 pin to 0 and EMU1 pin to 1 which is required to start up in WIR mode.

* I then release the reset so that the device starts up in WIR mode.

Once I release the reset, it seems that it did connect to the M3 core and show the following in the debug window: 

And the console shows:

Cortex_M3_0: GEL Output: Watchdog Timers Enabled
Cortex_M3_0: GEL Output: UARTs Enabled

However, I still cannot load a program. When I try that It only disconnects and the output on the console is the following:

Cortex_M3_0: GEL: Error while executing OnReset(0): Target failed to read 0x00681000
at R1=*(0x681000) [f28m36h33b2_m3.gel:327]
at Read_OTPSECLOCK() [f28m36h33b2_m3.gel:55]
at OnReset(0)
Cortex_M3_0: Breakpoint Manager: Error enabling this function: Target Access Failed
Cortex_M3_0: GEL: Error while executing OnRestart( 0 ): Target failed to read 0x00680430
at *((unsigned long *) 0x400FE004)=*((unsigned long *) 0x00680430) [f28m36h33b2_m3.gel:337]
at Device_Config() [f28m36h33b2_m3.gel:69]
at OnRestart(0)
Cortex_M3_0: Trouble Setting Breakpoint with the Action "Terminate Program Execution" at 0x20018e12: (Error -1170 @ 0x20018E12) Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.3.0.00042)
Cortex_M3_0: Breakpoint Manager: Retrying with a AET breakpoint
Cortex_M3_0: Breakpoint Manager: Error enabling this function: Address exceeds the allowed range
Cortex_M3_0: Trouble Setting Breakpoint with the Action "Finish Auto Run" at 0x20000b20: (Error -1170 @ 0x20000B20) Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.3.0.00042)
Cortex_M3_0: Trouble Removing Breakpoint with the Action "Finish Auto Run" at 0x20000b20: (Error -2044 @ 0x20000B20) Internal error: Requested breakpoint does not exist. Restart the application. If error persists, please report the error. (Emulation package 9.3.0.00042)
Cortex_M3_0: JTAG Communication Error: (Error -1170 @ 0x0) Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.3.0.00042)

I also tried to erase the flash using the on-chip Flash Gui. But it gives the error "Target not connected or does not support current flash operation".

Some posts suggested that the device might me locked, but it does not seem that is the case since the password location are all F's:

I have not changes anything in my linker file from the working version that was written in C.

What in my program that I loaded could have caused this to happen?

Is there a way to manually connect to the device and erase the flash to recover my boards? I have now 3 boards that is lock up in this way.

If it will help I can send the linker file and even the object files and source code with a private message.

Thanks

Albert

  • Albert,

                    I wonder if the device got locked inadvertently. Have you looked at your .map file to see if anything got written into the password locations? The two posts below sound similar to your situation, but I get a feeling you have already looked at both: 

    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/510932/concerto-unable-to-access-the-dap

    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1059671/f28m36p63c2-concerto-f28m36-unable-to-access-the-dap-problem

  • Hareesh

    Yes I have indeed looked at both those posts. 

    If I look at the In-flash Gui the Passwords show FFFFFFFF. In the memory browser at address 0x200000 and 0x2FFFDC it's all zeros.

    Does this mean the passwords were changed?

    In the .map file it does not seem that anything was written to the password locations. (I am trying to upload the file to this post but it does not work)

  • 6724.map.zip

    Here is the .map file. If I can't recover the boards, at least I need to fix whatever in my program has caused the problem.

  • I had a project that was working fine on my Concerto Board.

    I presume the project was configured to run completely off RAM and you never had issues loading and running off RAM.

    I noticed that CCS showed the dialog that says Erasing and Loading FLASH, which was not what I expected when loading into RAM.

    OK, this is strange considering you used the same linker command file as in the previous step.

    In the memory browser at address 0x200000 and 0x2FFFDC it's all zeros.

    The Memory browser images you have attached are not showing the correct starting address. Can you please choose 32-Bit hex - TI Style?

    Here is the .map file.

    I looked at your .map file. What is .init_array that is assigned to 0x681000 (OTP - Security lock)?

    Are you using a linker command file supplied as part of controlSUITE? Or did you modify the supplied linker command file for your application? If it is the former, please provide the name of the file and the controlSUITE version. If it is the latter, please rename the extension to .txt and provide it.

    What version of CCS are you using?

  • Hi Hareesh.

    Thanks for that clue. I further investigated the .init_array and narrowed it down to the standard vector library. It was when I declared a vector in my new C++ code, when this init_array was added by the compiler and automatically placed in that memory space. After some searching I came across this post with a similar problem:

    https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/231783/concerto-f28m35x-can-i-use-standard-vector-template

    I then added a section in the linker file to place the init_array in a valid memory space like this:

    .init_array :   >> C0 | C1 | C2 | C3 | C4

    This seems to have sorted out the cause of the problem and I can now load my program onto the target. However the program does not run correctly and If I view the variables it seems that the symbols are all mixed up. It also doesn't stop at a break point where I expect it to stop. What is the correct way to edit the linker file, or anything else I should do, to ensure that this init_array is placed in the correct location? Here is my current linker file:

    /*
    //###########################################################################
    // FILE:    F28M36x_generic_wshared_M3_RAM.cmd
    // TITLE:   Linker Command File For F28M36x examples that run out of RAM
    //          This does not include flash or OTP.
    //          Keep in mind that C0 and C1 are protected by the code
    //          security module.
    //          What this means is in most cases you will want to move to
    //          another memory map file which has more memory defined.
    //###########################################################################
    // $TI Release: F28M36x Support Library v207 $
    // $Release Date: Mon Sep 21 16:44:39 CDT 2015 $
    // $Copyright: Copyright (C) 2012-2015 Texas Instruments Incorporated -
    //             http://www.ti.com/ ALL RIGHTS RESERVED $
    //###########################################################################
    */
    
    --retain=g_pfnVectors
    
    /* 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                                           */
    
    
    /* System memory map */
    
    MEMORY
    {
        C0 (RWX)         : origin = 0x20000000, length = 0x2000
        C1 (RWX)         : origin = 0x20002000, length = 0x2000
        BOOT_RSVD (RX)   : origin = 0x20004000, length = 0x0FF8
        RESETISR (RWX)   : origin = 0x20004FF8, length = 0x0008
        INTVECS (RWX)    : origin = 0x20005000, length = 0x0258
        C2 (RWX)         : origin = 0x20005258, length = 0x0DA8
        C3 (RWX)         : origin = 0x20006000, length = 0x2000
        S0 (RWX)         : origin = 0x20008000, length = 0x2000
        S1 (RWX)         : origin = 0x2000A000, length = 0x2000
        S2 (RWX)         : origin = 0x2000C000, length = 0x2000
        S3 (RWX)         : origin = 0x2000E000, length = 0x2000
        S4 (RWX)         : origin = 0x20010000, length = 0x2000
        S5 (RWX)         : origin = 0x20012000, length = 0x2000
        S6 (RWX)         : origin = 0x20014000, length = 0x2000
        S7 (RWX)         : origin = 0x20016000, length = 0x2000
        
        C4  (RWX)        : origin = 0x20018000, length = 0x2000
        C5  (RWX)        : origin = 0x2001A000, length = 0x2000
        C6  (RWX)        : origin = 0x2001C000, length = 0x2000
        C7  (RWX)        : origin = 0x2001E000, length = 0x2000
        C8  (RWX)        : origin = 0x20020000, length = 0x2000
        C9  (RWX)        : origin = 0x20022000, length = 0x2000
        C10 (RWX)        : origin = 0x20024000, length = 0x2000
        C11 (RWX)        : origin = 0x20026000, length = 0x2000
        C12 (RWX)        : origin = 0x20028000, length = 0x2000
        C13 (RWX)        : origin = 0x2002A000, length = 0x2000
        C14 (RWX)        : origin = 0x2002C000, length = 0x2000
        C15 (RWX)        : origin = 0x2002E000, length = 0x2000
        
        CTOMRAM1 (RX)    : origin = 0x2007F000, length = 0x0100
        CTOMRAM2 (RX)	 : origin = 0x2007F100, length = 0x0100
        CTOMRAM3 (RX)	 : origin = 0x2007F200, length = 0x0100
        CTOMRAM4 (RX)	 : origin = 0x2007F300, length = 0x0100
        CTOMRAM5 (RX)	 : origin = 0x2007F400, length = 0x0100
        CTOMRAM6 (RX)	 : origin = 0x2007F500, length = 0x0100
        CTOMRAM7 (RX)	 : origin = 0x2007F600, length = 0x0100
        CTOMRAM8 (RX)	 : origin = 0x2007F700, length = 0x0100
        MTOCRAM1 (RWX)   : origin = 0x2007F800, length = 0x0100
        MTOCRAM2 (RWX)   : origin = 0x2007F900, length = 0x0100
        MTOCRAM3 (RWX)   : origin = 0x2007FA00, length = 0x0100
        MTOCRAM4 (RWX)   : origin = 0x2007FB00, length = 0x0100
        MTOCRAM5 (RWX)   : origin = 0x2007FC00, length = 0x0100
        MTOCRAM6 (RWX)   : origin = 0x2007FD00, length = 0x0100
        MTOCRAM7 (RWX)   : origin = 0x2007FE00, length = 0x0100
        MTOCRAM8 (RWX)   : origin = 0x2007FF00, length = 0x0100
    	
    	OTPSECLOCK       : origin = 0x00681000, length = 0x0004
        OTP_Reserved1    : origin = 0x00681004, length = 0x0004
        OTP_Reserved2    : origin = 0x00681008, length = 0x0004
        OTP_Z2_FLASH_START_ADDR             : origin = 0x0068100C, length = 0x0004
        OTP_EMACID       : origin = 0x00681010, length = 0x0008
        OTP_Reserved3    : origin = 0x00681018, length = 0x0004
        CUSTOMER_OTP_MAIN_OSC_CLK_FREQ      : origin = 0x0068101C, length = 0x0004
        OTP_Reserved4    : origin = 0x00681020, length = 0x0004
        OTP_BOOT_MODE_GPIO_CONFIGURE        : origin = 0x00681024, length = 0x0004
        OTP_Reserved5    : origin = 0x00681028, length = 0x0004
        OTP_ENTRY_POINT  : origin = 0x0068102C, length = 0x0004
        OTP_Reserved6    : origin = 0x00681030, length = 0x0010
    }
    
    /* Section allocation in memory */
    
    SECTIONS
    {
        .intvecs:   > INTVECS
        .resetisr:  > RESETISR
        .text   :   >> C0 | C1 | C2 | C3 | C4, crc_table(AppCrc, algorithm=CRC32_PRIME)
        .const  :   >> C0 | C1 | C2 | C3 | C4, crc_table(AppCrc, algorithm=CRC32_PRIME)
        .cinit  :   >  C0 | C1 | C2 | C3 | C4, crc_table(AppCrc, algorithm=CRC32_PRIME)
        .pinit  :   >> C0 | C1 | C2 | C3 | C4, crc_table(AppCrc, algorithm=CRC32_PRIME)
        .init_array :  > C0 | C1 | C2 | C3 | C4
    
        .vtable :   >> C0 | C1 | C2 | C3
        .data   :   >> C2 | C3 | C0 | C1 
        .bss    :   >> C2 | C3 | C0 | C1 
        .sysmem :   >  C0 | C1 | C2 | C3
        .stack  :   >  C0 | C1 | C2 | C3
    
        .TI.crctab : > C3  
        
        SHARERAMS0  : > S0
        SHARERAMS1  : > S1
        SHARERAMS2  : > S2
        SHARERAMS3  : > S3
        SHARERAMS4  : > S4
        SHARERAMS5  : > S5
        SHARERAMS6  : > S6
        SHARERAMS7  : > S7
    
       //AS: Added because the F28M36H33B22 does not have shared ram (S0 - S7).
       // This is utelizing the IPC MTOC and CTOM ram as shared ram
       MTOCSHARED          				: > MTOCRAM1
       MTOCSHARED_HANDCONTROLLER 		: > MTOCRAM2
       MTOCSHARED_MOTORCONTROLLER 		: > MTOCRAM3
       MTOCSHARED_LINACTUATOR			: > MTOCRAM4
       CTOMSHARED          				: > CTOMRAM1, TYPE = NOINIT
       CTOMSHARED_HANDCONTROLLER 		: > CTOMRAM2, TYPE = NOINIT
       CTOMSHARED_MOTORCONTROLLER 		: > CTOMRAM3, TYPE = NOINIT
       CTOMSHARED_LINACTUATOR			: > CTOMRAM4, TYPE = NOINIT
    
    #ifdef __TI_COMPILER_VERSION
       #if __TI_COMPILER_VERSION >= 15009000
        .TI.ramfunc : {} > C0 | C1
       #endif
    #endif
        
    //    GROUP : > MTOCRAM
    //    {
    //        PUTBUFFER
    //        PUTWRITEIDX
    //        GETREADIDX
    //    }
    
    //    GROUP : > CTOMRAM
    //    {
    //        GETBUFFER : TYPE = DSECT
    //        GETWRITEIDX : TYPE = DSECT
    //        PUTREADIDX : TYPE = DSECT
    //    }
    
    }
    
    
    __STACK_TOP = __stack + 256;
    

    Also, I still sit with 3 boards that is now locked and not usable. It also seems that I cannot unlock them because the password locations have been written with zero's:

    If I try to access the OTPSECLOCK at address 0x681000 the device disconnects:

      

    Does this mean the device is permanently locked or is there a way that I can recover it?

  • I also need to add that Initially when I included the <vector> I got error messages:

     Description Path Resource Location Type
    #306 no instance of overloaded function "std::__2::__c11_atomic_exchange" matches the argument list /Concerto_RogueTest_M3 .ccsproject line 1730, external location: C:\ti\ccs901\ccs\tools\compiler\ti-cgt-arm_18.12.1.LTS\include\libcxx\atomic C/C++ Problem
    #306 no instance of overloaded function "std::__2::__c11_atomic_exchange" matches the argument list /Concerto_RogueTest_M3 .ccsproject line 1733, external location: C:\ti\ccs901\ccs\tools\compiler\ti-cgt-arm_18.12.1.LTS\include\libcxx\atomic C/C++ Problem
    #306 no instance of overloaded function "std::__2::__c11_atomic_store" matches the argument list /Concerto_RogueTest_M3 .ccsproject line 1736, external location: C:\ti\ccs901\ccs\tools\compiler\ti-cgt-arm_18.12.1.LTS\include\libcxx\atomic C/C++ Problem
    #306 no instance of overloaded function "std::__2::__c11_atomic_store" matches the argument list /Concerto_RogueTest_M3 .ccsproject line 1739, external location: C:\ti\ccs901\ccs\tools\compiler\ti-cgt-arm_18.12.1.LTS\include\libcxx\atomic C/C++ Problem
    gmake: *** [src/Concerto_M3-Main.obj] Error 1 Concerto_RogueTest_M3 C/C++ Problem
    gmake: Target 'all' not remade because of errors. Concerto_RogueTest_M3 C/C++ Problem

    Then I found a workaround in a post (e2e.ti.com/.../compiler-omap-l138-ti-arm-cgt-v18-12-2-lts-ti-c6000-cgt-v8-3-3-lts-compiler-error-when-vector-or-functional-included) to just add the following before the #include <vector>

    #ifdef true
    #undef true
    #endif
    #ifdef false
    #undef false
    #endif

    But this workaround could also not be the correct way?

  • Does this mean the device is permanently locked or is there a way that I can recover it?

    I wonder if the passwords are shown as all zeroes because (i) the device is locked or (ii) the passwords are indeed all zeroes. If the password locations have indeed been programmed with all zeroes, I am afraid there is no way to recover those devices. However, I wonder why the flash locations would have been programmed in the first place, since I don't see flash memory in your .map file. Did you try unlocking your device with a "password" of all F's?

  • But this workaround could also not be the correct way?

    Albert,

                    I discussed this with a compiler expert and he had the following to say: 

    "The problem described in this post was that the user's C++ program included a C header file from StarterWare that defined "true" and "false" as macros.

    This is a big no-no in C++, and there's nothing the compiler can do about it.  The best fix is for the StarterWare header file hw_types.h to be updated to be C++ safe, most likely by checking whether it is being compiled under C++ before trying to define true and false."

  • If I try to unlock using the on-chip Flash Gui with all F's I just get the message "Target not connected or does not support current flash operation". There was one occasion where it actually said the target is unlocked successfully, but I still could not erase the flash or load a program. Unfortunately I don't have those console output any more and I can't seem to duplicate that result. 

    There does however seem to be an issue with this memory address 0x681000 because it keeps crashing when I try to access it.

  • Ok, noted thanks. I will keep on using this workaround for now. But for some reason my program still behaves strangely as soon as I declare a vector. Even after I added the line in the linker file section to place the .Init_array in a proper location.  Is there some other way to deal with this Init_array form the standard vector library?

    Edit: Update! I found the reason why it was still not behaving correctly. I was calling some function in my class constructor before the relevant registers were initialized. 

    So my project is working now. Only problem left is those boards that I cannot access.

  • There does however seem to be an issue with this memory address 0x681000 because it keeps crashing when I try to access it.

    Address 0x681000 is OTPSECLOCK location, part of the code-security-module. Access to secure resources when the device is secured would break the debugger connection, which is probably what you are seeing.

    Regarding the boards you cannot access, it appears the devices got locked inadvertently with unknown passwords. Unfortunately, there is no way to recover from this. One thought: Up until the M3ZxPSWDLOCK bit is set, the device is not secured. The password locations may contain the passwords, but the device is not secured until that bit is set. We now understand your project unintentionally wrote to OTPSECLOCK, thus locking the device. However, the password locations themselves should contain all F's, so I don't quite understand why you are unable to unlock the device with a password of all F's, unless the password locations also got written with some unknown values. Anyway, I will go ahead and close this post, since your original issue appears to be resolved.

    On a different note, I noticed that the link in my previous post is kind of obscured. I wanted to make sure you saw that post. I am reproducing the actual URL here: https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/811785/compiler-omap-l138-ti-arm-cgt-v18-12-2-lts-ti-c6000-cgt-v8-3-3-lts-compiler-error-when-vector-or-functional-included 

  • HI Hareesh

    Yes, the root cause is now resolved. Thanks for giving some pointers to narrow down that issue.

    However, the side effect of the boards being locked was actually the original reason for this post. And I would please like to continue looking at the boards, even if we have to create a new thread, because I am not convinced yet that they are permanently locked. Here is me reason why. I was able to reproduce what I had seen earlier. I can connect to the device and this is what the password memory looks like.

    Then I Click on Unlock and this is the output:


    Cortex_M3_0: Performing Security Operation...
    Cortex_M3_0: The device is currently unlocked, and therefore it is not necessary to perform the unlock operation.
    Cortex_M3_0: Operation completed successfully.

    Which means the device is not locked right? But if I then try to erase the flash, this is what I get:

    Cortex_M3_0: Erasing Flash memory...
    Cortex_M3_0: GEL: Error while executing OnReset(0): Target failed to read 0x00681000
    at R1=*(0x681000) [f28m36h33b2_m3.gel:327]
    at Read_OTPSECLOCK() [f28m36h33b2_m3.gel:55]
    at OnReset(0)
    Cortex_M3_0: Error occurred during flash operation: Target failed to read 0x400FE05C
    Cortex_M3_0: Error occurred during flash operation: Target failed to read 0x00681000
    Cortex_M3_0: Error occurred during flash operation: Target failed to read 0x00200000
    Cortex_M3_0: Error occurred during flash operation: Target failed to read 0x00200004
    Cortex_M3_0: Error occurred during flash operation: Target failed to read 0x00200008
    Cortex_M3_0: JTAG Communication Error: (Error -1170 @ 0x0) Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.3.0.00042)
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x0020000C: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB400: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB404: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB408: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB40C: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x002FFFF0: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x002FFFF4: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x002FFFF8: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x002FFFFC: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB418: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB41C: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB420: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB424: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x00200010: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x00200014: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB410: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB414: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x002FFFE8: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x002FFFEC: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB428: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB42C: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FA600: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x00200020: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x002FFFDC: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x00200018: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x0020001C: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x002FFFE4: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x002FFFE0: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x00680430: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FE004: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x00680410: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB900: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x00680414: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB904: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x0068042C: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB930: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x00680400: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FE014: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x00680404: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FE01C: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x00680408: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FE024: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x0068040C: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FE194: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x00680418: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB910: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x0068041C: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB914: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x00680420: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB918: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x00680424: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB91C: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x00680428: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB920: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x00680434: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FE308: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x400FB8C0: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB8C0: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB980: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FE100: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FA600: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FA000: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FA048: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FA040: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FA300: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x20004000: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Cannot enable while the target is disconnected
    Cortex_M3_0: Error occurred during flash operation: Failed to run target while trying to execute pwrite_en.alg
    Cortex_M3_0: Flash operation timed out waiting for the algorithm to complete. Operation cancelled.
    Cortex_M3_0: Perform a debugger reset and execute the Boot-ROM code (click on the RESUME button in CCS debug window) before erasing/loading the Flash. If that does not help to perform a successful Flash erase/load, check the Reset cause (RESC) register, NMI shadow flag (NMISHDFLG) register and the Boot-ROM status register for further debug.
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x400FB800: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x400FB804: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x400FB80C: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x400FB810: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x20004000: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Cannot enable while the target is disconnected
    Cortex_M3_0: Error occurred during flash operation: Failed to run target while trying to execute pwrite_dis.alg
    Cortex_M3_0: Flash operation timed out waiting for the algorithm to complete. Operation cancelled.
    Cortex_M3_0: Perform a debugger reset and execute the Boot-ROM code (click on the RESUME button in CCS debug window) before erasing/loading the Flash. If that does not help to perform a successful Flash erase/load, check the Reset cause (RESC) register, NMI shadow flag (NMISHDFLG) register and the Boot-ROM status register for further debug.
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB74C: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x400FB74C: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x20004000: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x200041F4: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x200041FC: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x20004200: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x20004204: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Cannot enable while the target is disconnected
    Cortex_M3_0: Error occurred during flash operation: Failed to run target while trying to execute wr_pll.alg
    Cortex_M3_0: Error writing the PLL values (Flash algorithm timed out). Operation cancelled.
    Cortex_M3_0: Perform a debugger reset and execute the Boot-ROM code (click on the RESUME button in CCS debug window) before erasing/loading the Flash. If that does not help to perform a successful Flash erase/load, check the Reset cause (RESC) register, NMI shadow flag (NMISHDFLG) register and the Boot-ROM status register for further debug.
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FB74C: target is not connected
    Cortex_M3_0: Flash Programmer: Error initializing device. Please check if the device is locked.
    Cortex_M3_0: Error occurred during flash operation: Could not write register PC: target is not connected


    If I load a program this is what I get:

    Cortex_M3_0: GEL Output: UARTs Enabled
    Cortex_M3_0: GEL: Error while executing OnReset(0): Target failed to read 0x00681000
    at R1=*(0x681000) [f28m36h33b2_m3.gel:327]
    at Read_OTPSECLOCK() [f28m36h33b2_m3.gel:55]
    at OnReset(0)
    Cortex_M3_0: File Loader: Verification failed: Values at address 0x20000000 do not match Please verify target memory and memory map.
    Cortex_M3_0: GEL: File: C:\Users\alberts\Documents\Albert Work\Software Projects (Git repo's)\Concerto_RogueTest_M3\RAM\Concerto_RogueTest_M3.out: a data verification error occurred, file load failed.
    Cortex_M3_0: JTAG Communication Error: (Error -1170 @ 0x0) Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.3.0.00042)
    Cortex_M3_0: Trouble Halting Target CPU: (Error -1266 @ 0x0) Device is held in reset. Take the device out of reset, and retry the operation. (Emulation package 9.3.0.00042)

    Then I tied the unlocking again and this is the result:

    Cortex_M3_0: Performing Security Operation...
    Cortex_M3_0: Error occurred during flash operation: Target failed to read 0x00681000
    Cortex_M3_0: Error occurred during flash operation: Target failed to read 0x00200018
    Cortex_M3_0: Error occurred during flash operation: Target failed to read 0x0020001C
    Cortex_M3_0: Error occurred during flash operation: Target failed to read 0x00200000
    Cortex_M3_0: Error occurred during flash operation: Target failed to read 0x00200004
    Cortex_M3_0: JTAG Communication Error: (Error -1170 @ 0x0) Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.3.0.00042)
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x00200008: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x0020000C: target is not connected
    Cortex_M3_0: Error occurred during flash operation: Could not read 0x400FB480: target is not connected
    Cortex_M3_0: Device unlock failed. Device is still locked. Please check the provided password.
    Cortex_M3_0: Error occurred during flash operation: Could not write 0x400FA000: target is not connected
    Cortex_M3_0: Trouble Halting Target CPU: (Error -1266 @ 0x0) Device is held in reset. Take the device out of reset, and retry the operation. (Emulation package 9.3.0.00042)

    So what is going on with this device? Is it locked or not?

  • Albert,

         We are making some assumptions about the state of the device, which may or may not be true. In theory, we have reasons to believe you should be able to unsecure the device, but evidently, you are unable to do so. It is hard to debug such issues without access to the hardware. I am thinking through this some more and brainstorming with colleagues. I will get back to you sometime middle of next week with possibly more leads.

  • Albert,

        Just wanted to check on where you are with this. Did you face this problem with any new devices? I am unable to think of reasons why a device's password locations were ostensibly untouched by the project and yet you are unable to unlock the device (unless a brownout during programming left the password locations in an unknown state).

  • Not any progress. No, not with new devices. Only the ones that I have programmed with my faulty code where .init_array was accidentally placed in 0x00681000.  

    It seems that the device is not just simply locked and I have to unlock it. It is as if the device got corrupted and now It behaves strangely. Whether I try to load a program, erase flash or unlock, it has some error related to memory address 0x00681000.

      
    Erasing Flash Output
    Cortex_M3_0: GEL Output: Watchdog Timers Enabled
    Cortex_M3_0: GEL Output: UARTs Enabled
    Cortex_M3_0: Erasing Flash memory...
    Cortex_M3_0: GEL: Error while executing OnReset(0): Target failed to read 0x00681000
    at R1=*(0x681000) [f28m36h33b2_m3.gel:327]
    at Read_OTPSECLOCK() [f28m36h33b2_m3.gel:55]
    at OnReset(0)

    Unlock output:
    Cortex_M3_0: GEL Output: Watchdog Timers Enabled
    Cortex_M3_0: GEL Output: UARTs Enabled
    Cortex_M3_0: Performing Security Operation...
    Cortex_M3_0: Error occurred during flash operation: Target failed to read 0x00681000
    Cortex_M3_0: Error occurred during flash operation: Target failed to read 0x00200018
    Cortex_M3_0: Error occurred during flash operation: Target failed to read 0x0020001C
    Cortex_M3_0: Error occurred during flash operation: Target failed to read 0x00200000
    Cortex_M3_0: Error occurred during flash operation: Target failed to read 0x00200004
    Cortex_M3_0: Error occurred during flash operation: Target failed to read 0x00200008
    Cortex_M3_0: Error occurred during flash operation: Target failed to read 0x0020000C
    Cortex_M3_0: Error occurred during flash operation: Target failed to read 0x400FB480
    Cortex_M3_0: Device unlock failed. Device is still locked. Please check the provided password.
    Cortex_M3_0: Error occurred during flash operation: Target failed to read 0x20004000

    Load program output:
    Cortex_M3_0: GEL Output: Watchdog Timers Enabled
    Cortex_M3_0: GEL Output: UARTs Enabled
    Cortex_M3_0: GEL: Error while executing OnReset(0): Target failed to read 0x00681000
    at R1=*(0x681000) [f28m36h33b2_m3.gel:327]
    at Read_OTPSECLOCK() [f28m36h33b2_m3.gel:55]
    at OnReset(0)
    Cortex_M3_0: File Loader: Verification failed: Values at address 0x20000000 do not match Please verify target memory and memory map.
    Cortex_M3_0: GEL: File: C:\Users\alberts\Documents\Albert Work\Software Projects (Git repo's)\Concerto_RogueTest_M3\RAM\Concerto_RogueTest_M3.out: a data verification error occurred, file load failed.
    Cortex_M3_0: JTAG Communication Error: (Error -1170 @ 0x0) Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.3.0.00042)

  • OK, thanks for the update. I am afraid there isn't much we can do to debug this further.