'Device is secure' when trying to flash a custom KV31 PCB

cancel
Showing results for 
Search instead for 
Did you mean: 

'Device is secure' when trying to flash a custom KV31 PCB

763 Views
spencerpallas
Contributor II

Hello,

 

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_2.3.7.201602251755\win32\pegdbserver_console -device=NXP_KVx_KV31F512M12 -startserver -singlesession -serverport=7224 -interface=USBMULTILINK -speed=5000 -port=USB1 -confiø

CMD>RE

Initializing.

Target has been RESET and is active.

CMD>CM C:\Freescale\KDS_3.0.0\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_2.3.7.201602251755\win32\gdi\P&E\supportFiles_ARM\NXP\KVx\freescale_kv31f512m12_1x32x128k_pflash.arp

Initializing.

Initialized.

;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 ...

Done.

CMD>EM

Erasing.

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.

Labels (1)
Tags (1)
0 Kudos
3 Replies

238 Views
harshpatel
Contributor IV

Hello  Spencer Pallas

We have faced same issue while bring up our custom devices with three freescale controllers. in our case we have sorted reset pin of all 3 controllers.

1] if more than one freescale controller in your custom device and reset pins of  controllers are sorted then isolate reset pins.

2] make sure that reset pin of controller is properly connected to the SWD pin connector. especially pin Num 10 must be connected with RESET pin of controller.

we have followed 2 steps and fixed issue permanently.

Let me know if any

Thanks & regards

Harsh 

Einfochips, INDIA

238 Views
spencerpallas
Contributor II

Update:

I updated the GNU ARM PEMicro Interface Debugging Support to the latest version (2.7) but I am still seeing the 'Device is secured' message.

0 Kudos

238 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Spencer,

- The reason for  " device is secure " is in the code have download into flash set

the register of FTFA_FSEC ->SEC =00 , 01 or 11 :

pastedImage_1.png

When the flash is secured programmer interfaces are only  allowed to launch mass erase operations and have no access to memory locations .

So you can   set the FTFA_FSEC-SEC to 10 , then you still can use the debugger to accesses it .

- About the detail Flash Security , please check the Reference Manual for KV31: pastedImage_2.png

- The FSEC register is read-only register , during the reset sequence, the register is loaded with the contents of the flash security byte in the Flash Configuration Field located in program flash memory.  So please configure the Flash configuration field byte Address 0x0_040C .

pastedImage_3.png


Have a great day,
Alice Yang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos