How to solve error "readout protection is set and mass erase is disabled" and to use board for debugging purpose.

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

How to solve error "readout protection is set and mass erase is disabled" and to use board for debugging purpose.

4,415 Views
mdisharat
Contributor I

Hi,

I recently purchased FRDM-K82F Board.

I downloaded all software from the official website along with the drivers and make necessary setup in windows 10 PC.

My config. is as follows:

PC Config : Windows 10 x64

IDE : MCUXpresso IDE v10.3.0_2200

SDK : SDK_2.5.0_FRDM-K82F

Debugger : J-LINK SWD Debugger (without any external Hardware)

From the examples, i used LED_Blinky example and successfully ran LED Blinky program in Board.

Now, from next time whenever i try to debug the same example without any modification, It is showing following error.

Error :

Kinetis (connect) protection byte in flashat addr. 0x400 - 0x40F indicate that readout protection is set and mass erase is disabled.J-Link can not unprotect the device. Can not connect to the target.

Please, provide the solution. I want to unprotect my FRDM-K82F Board and want to use it for different applications. Provide a way to use it.Connect Error.PNG

Thanks.

Tags (1)
0 Kudos
9 Replies

3,463 Views
dmstek_kishor
Contributor I

H

0 Kudos

3,463 Views
mdisharat
Contributor I

Hi,

I found many files that contain the flash configuration field related definitions in FRDM-K82F project folder files.

files are as follows:

\device\MK82F25615.h
here search for FTFA_FSEC_SEC(x)

\drivers\fsl_ftfx_adapter.h
here search for FTFA_FSEC_SEC

\startup\startup_mk82f25615.c
here search for Flash_Config = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF3DFE};

My aim is to modify security related register bits to unprotect device (FRDM-K82F).

Which file/files can be helpful to modify the security-related bits. Is it listed here or I need to find another file. Please specify here. 

Waiting for the reply.

Thanks in advanced.

0 Kudos

3,463 Views
mdisharat
Contributor I

Hi,

Anyone is there who has the answer?

0 Kudos

3,463 Views
miduo
NXP Employee
NXP Employee

Hello,

Sorry for my absence of last couple days. I will response you soon.

0 Kudos

3,463 Views
mdisharat
Contributor I

Hi,

To avoid the locking of the board and use it multiple times for debugging purpose, I should provide the proper value in Flash Config. Field.

My interpretation is as follows for FRDM-K82F :

Flash+Config+Field.png

There are many output files like .axf, .bin, .hex. I checked all these files at the 0x40C location. all contain different values for the same program. Which file location should I modify?

Is it the right interpretation. Please, confirm it via reply.

Thanks in advanced.

0 Kudos

3,463 Views
mdisharat
Contributor I

Hi Fang Lee,

Thank you for the help.

My another question is How to debug sample example provided in SDK without securing the board.

So, we can use same board many times to debug different different programs. 

I never touched/edited the security related bits during sample program debugging.

I want to know the procedure. so next time i can avoid the accidental device locking.

0 Kudos

3,463 Views
miduo
NXP Employee
NXP Employee

Hello,

OK, just several steps for your reference:

1. Install the MCUXpresso IDE from the NXP site
2. Generate and download the SDK_2.5.0_FRDM-K82F from the NXP site(https://mcuxpresso.nxp.com/en/select)

3. Open the MCUXpresso IDE
4. Drag/Drop SDK packages directly into the IDE in the Installed SDKs view.

For more detail, you may would like to make reference attached document.

0 Kudos

3,463 Views
mdisharat
Contributor I

Hi,

Ok.

My aim is to debug my program onboard multiple times (edit/debug cycle).

Now, I get to know about security-related registers from the following link: How (not) to Secure my Microcontroller | MCU on Eclipse . This Link describes the registers to protect, secure or (not) and to change the setting of mass erase functionality with respect to  FRDM-KL25Z Board.

That configuration is located at address 0x400-0x40F for the KL25Z. The Flash Security Byte is at address 0x40C.

So, Can I say these address ranges are same for FRDM-K82F Board?

If is it different one then please provide that details. I have to deal with only FRDM-K82F Board.

Thanks in Advanced.

0 Kudos

3,463 Views
miduo
NXP Employee
NXP Employee

Hello,

Well, I am really do not know what you had done with the board... Please be note that the only method to recover a secured device is to launch a mass erase command. If you have secured your device with mass erase disabled, then the device is bricked, because this is what it is supposed to do when you have those bits set :-(

See detail information on "Secure Kinetis " here:

How (not) to Secure my Microcontroller | MCU on Eclipse 

 

The only solution you have is to un-solder the MCU and replace it with a new one on your board.

0 Kudos