Use codewarrior11 MCU:KEA64 when debug a problem occurs:The Debugger can not write memory.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Use codewarrior11 MCU:KEA64 when debug a problem occurs:The Debugger can not write memory.

1,879 Views
Wangerxi
Contributor II

I use SWD download software, it doesn't work. Information as below:

Failed to resume target process.
ARM GDI Protocol Adapter : An error occurred while trying to write memory. The Debugger can not write memory.

Looking forward your reply, thanks in advance.

0 Kudos
Reply
6 Replies

1,841 Views
Wangerxi
Contributor II

Thanks for your declare, I got it.

0 Kudos
Reply

1,832 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @Wangerxi 

Thank you for your reply, 

Let me know if you still have related questions or problems. 

Diego. 

0 Kudos
Reply

1,853 Views
Wangerxi
Contributor II

Hi Diego,

Thank you for your reply, my issue seems different, I might erased the first sector of the flash begins at 0x0000_0000, and will the chip be bricked?

Best

Erxi

 

0 Kudos
Reply

1,847 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @Wangerxi 

Thank you for letting me know.

In that case , yes it could be the case that you have bricked the MCU.

At the first sector of the flash there is field at 0x400 , containing security settings. Specially at 0x40C offset there is a byte called FSEC, normally it has to be written with  ones ; it contains  critical fields controlling Security and mass erase enable that if they are written with zeroes, they will protect the MCU.

You did not necesarilly bricked for ever the MCU. If you only enabled security you could disable it back, regaining debug access. But if you also disabled the Mass erase, you will not be able to recover the MCU with the SWD/ JTAG  or any external interface.

 

 

 

 

0 Kudos
Reply

1,876 Views
Wangerxi
Contributor II

/*Here is my code*/

#define SEC_SECTOR 0xFE00

uint8_t *pData8Bytes = 0;
uint8_t dataSend[4] = {0x01,0x02,0x03,0x04};

FLASH_EraseSector(SEC_SECTOR);
FLASH_Program(SEC_SECTOR,dataSend,4);
pData8Bytes = ((uint8_t *)SEC_SECTOR);

 

After download the code ,the next time i can't download and print "Failed to resume target process.
ARM GDI Protocol Adapter : An error occurred while trying to write memory. The Debugger can not write memory."

0 Kudos
Reply

1,863 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @Wangerxi 

There is a check-list , that our colleague Erich Styger made,  time ago : Debugging Failure: Check List and Hints I just recommend it as it is very handy . Regarding your problem, like point 19 of the post, verify if you have not bricked the MCU, and try to perform a mass erase on the MCU. 

As I understand, you are now facing that problem, after you have tried to write a specific sector of the MCU from the application.

Other recommendation is to try to use an aligned address for #define SEC_SECTOR, considering that there first sector of the flash begins at 0x0000_0000 and that there is a sector every 512 bytes.

diego_charles_0-1635031801887.png

All the best, 

Diego.

0 Kudos
Reply