I am trying to test a custom hardware module with a KV31 MCU. When I try and flash custom firmware using a PEMicro Multilink (mini 10-pin SWD), the project builds fine but I get a message stating 'Device is secure. Erase to unsecure?'. I have been clicking ‘No’ because the KV31 has the KMS library stored which we need for the motor control. This brings up a KDS error window stating ‘Error in services launch sequence.’ The console has this message:
Connection from "127.0.0.1" via 127.0.0.1
Copyright 2012 P&E Microcomputer Systems,Inc.
Command Line :C:\Freescale\KDS_3.0.0\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_126.96.36.199602251755\win32\pegdbserver_console -device=NXP_KVx_KV31F512M12 -startserver -singlesession -serverport=7224 -interface=USBMULTILINK -speed=5000 -port=USB1 -confiø
Target has been RESET and is active.
;version 1.02, 09/10/2015, Copyright 2015 P&E Microcomputer Systems, Inc. All rights reserved. www.pemicro.com [kv_31f512_n_pflash]
;device freescale, kv31f512m12, 1x32x128k, desc=pflash
;begin_cs device=$00000000, length=$00080000, ram=$20000000
Loading programming algorithm ...
Module could not be erased.
Error Erasing flash of device
Error occured during Flash programming.
Device is Secure.
PE-ERROR: Error downloading to the device.
PE-ERROR: CAN'T READ REGISTERS. TARGET IS RUNNING
Error setting BP @40c8
Warning - Not all breakpoints could be written.
Interrupt command received. Halting execution.
Any idea what may be happening? I tried the same debug configuration on a TWR-KV31 boards and it ran with no errors. I am using the KDS 3.0 and have attached an image of the error as well as the configuration I am using.