Arm Cortex-M: Flash programming fails

03-Jun-2024

Check that the Flash memory is not secured or perform a special Unsecure operation (this erases Flash content). This can happen either by intentionally or accidentally writing to the memory locations managing the Flash security levels.


Possible solutions

Perform Reset action

If a device uses initialization scripts for establishing debug connection it might display a warning (error line in red color) in the Progress Window if the device is secured.

1.Open Help | Support | Log.

2. Enable log option (27) EVE.

3. Perform Reset action in winIDEA.

4. Check the Progress Window by clicking View | Workspace | Progress for the result of the operation.


Perform Unsecure action

The device supports special Unsecure/Chip Erase/Mass Erase operation, that can be initiated when the device is secured to regain debug control.

1. Open Help | Support | Log.

2. Enable log option (27) EVE.

3. Select Hardware | Initialize to prepare the debugger for connection to the target device.

4. Perform Hardware | Scripts | Unsecure (might also be called Mass Erase or Chip Erase).

5. Check Progress Window by clicking View | Workspace | Progress for the result of the operation.

Unsecure option might not be available on your microcontroller. See the specific device Reference Manual for more information.


XMC1000

Refer to the topic System reset fails for more information. 


General Flash programming

Check this general topic on Flash programming.


winIDEA 9.17.100 Verified build and later: 

Open Hardware | <Flash device> Unsecure

Was this answer helpful?