"Device is secure. Erase to ensecure?".

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

"Device is secure. Erase to ensecure?".

7,984 Views
arturoarteaga
Contributor II

Hi,

I would like to reprogram a MK20DX64VLH7 microcontroller that I have in a board with , but I haven´t been able to download the new firmware and erase a previous firmware that I´ve just download  before succesfully. In the monitor it appears the next message: "Device is secure. Erase to ensecure?". I repetedly choose "Yes" but without any success, until the next message appears: "Launching LED Debug (4) has encountered a problem. Error in services launch sequence". In details appears written: "Error in services launch sequence Timed out trying to launch GDB Server."

I use KDS application, and "Debug Configuration" Option and GDB PEMicro with "Multilink Universal" programmer.

I´ve followed the KDS User Guide in order to set Debug Configurations.

Maybe there is one problem with the secure configuration of microcontroller, but I don´t know.

How can I erase the flash memory to reprogramm again?

Problemas_acceso_micro.png

I didn´t program the 0x40C address related to "NV_SEC" because I´ve only done the tutorial from Processor Expert, but I don´t know if this application program this address (0x40C) by default when I choose "Generate Processor Expert Code".

Anyway I tell you that it appears in this this address in my application:

NV_SEC (Address: 0x40C):

Init. value. 7E
After reset. FF

whose bits are:

KEYEN bits:
Init. value. 01
After reset. 11

MEEN bits:
Init. value. 11
After reset. 11

FSLACC bits:
Init. value. 11
After reset. 11

SEC bits:
Init. value. 10
After reset. 11

NV_FSEC.png

I don´t know how I can access to these registers by the "Processor Expert Application".

I would like to know how I could erase the firmware loaded in the MK20DX64VLH7 microcontroller to be able to reprogram it, as well as reprogramming in unsecure mode in order not to have this problems again. Or to program a firmware erasing the firmware loaded before. Do you know if there are any application to manage this. I have used "pe_gdb_server" and "multilink_universal" applications before but without any success.

Moreover I didn´t check a box to secure. The security boxes from the flash are disable by default and Protection regions are unprotected in Component Inspector Properties in  the "Processor Expert Application" in KDS.

According to this I think there shouldn´t be any problem with accesses related to security.

Flas_Security_1.png

Flas_Security_2.png

I will continue researching.

Thanks previouslly for your answer.

your sincerelly,

Arturo Arteaga

0 Kudos
33 Replies

2,911 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Arturo Arteaga,

  Could you tell me how many board on your side have this problem?

   Did you check any other board?

   Maybe you can try to solider your chip again with the temperature at max 270, just to exclude the bad pin connection problem.

   Please also check the debugger interface, whether the wire have the bad connection problem.


Have a great day,
Kerry

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

0 Kudos

2,911 Views
arturoarteaga
Contributor II

Hi Kerry,

Thanks for your help, we have managed to program the board correctly. We have solved these problems by taking off some pull-ups and downs connected wrongly to SWD. I have connected also a pull-up to CS pin. Occasionally it faults again but I erase the program with “GDB for kinnetis application”.

I have a question, I haven´t managed to stop running the application with breakpoints except in main fuction that it´s selected by default in “Debug Configuration” in “Start up” tab. I don’t know why, because I have configured ok the breakpoints and they are enable and with a blue circle,

Perhaps, should I install some pluggin?? Another configuration that I don´t know?

Thanks a lot again,

Arturo Arteaga

De: kerryzhou

Enviado el: lunes, 13 de marzo de 2017 11:20

Para: Arturo Arteaga

Asunto: Re: - Re: "Device is secure. Erase to ensecure?".

<https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg> NXP Community

Re: "Device is secure. Erase to ensecure?".

reply from Kerry Zhou <https://community.nxp.com/people/kerryzhou?et=watches.email.thread> in Kinetis Microcontrollers - View the full discussion <https://community.nxp.com/message/886010?commentID=886010&et=watches.email.thread#comment-886010>

0 Kudos

2,910 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Arturo Arteaga,

    You don't need to install the plugin to add the breakpoints.

When you add the breakpoints, just with the tick sign, it is the useful break points:

pastedImage_2.png

Please check it on your side.


Have a great day,
Kerry

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

0 Kudos

2,910 Views
arturoarteaga
Contributor II

Hi,

Sorry Kerry, I have tried to add the tick sign, but I haven´t managed it. I don´t see how you can get tick signs, I know how to get circle blue sign at the left side from the code however although I read and read I don´t see where I can get tick sign or checkmark overlay as it´s mentioned in the help from KDS. Should I configure some parameters? Is there in any option from one of the menu windows? Maybe any option from the “breakpoints perspective view”? or perhaps some commands that I have to write in “Debug configuration? Or any kind of configuration of debug?

I would be great grateful again for your help.

Have a nice day too,

Arturo Arteaga

De: kerryzhou

Enviado el: viernes, 17 de marzo de 2017 6:29

Para: Arturo Arteaga

Asunto: Re: - Re: "Device is secure. Erase to ensecure?".

<https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg> NXP Community

Re: "Device is secure. Erase to ensecure?".

reply from Kerry Zhou <https://community.nxp.com/people/kerryzhou?et=watches.email.thread> in Kinetis Microcontrollers - View the full discussion <https://community.nxp.com/message/887918?commentID=887918&et=watches.email.thread#comment-887918>

0 Kudos

2,910 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Arturo Arteaga,

Please enter the debug mode at first, then put the break point.

 Don't put too much break points.If you still not OK, please give me some pictures from your side, I will help you to investigate it.


Have a great day,
Kerry

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

0 Kudos

2,911 Views
arturoarteaga
Contributor II

Hi kerry,

Hi Kerry again,

I haven’t managed to get tick signs again. After debugging I have put the breakpoint in the left side of one line the code, however I have only one blue circle. I send you two captured images. One it´s from the “Debug configuration” (Breakpoints GDB Multilink_Universal image), where you can find in the bottom from “Startup” tab something related on debugging step by step, and my dude it´s if I have to modify this default configuration. Another image is Debug perspective View (Debug_Breakpoints image), where I show you breakpoints view (red rectangle), the breakpoint by default in main file (blue rectangle), the breakpoint that I’ve chosen (orange rectangle), explanation from the help that it’s mentioned about checkmark overlay (pink rectangle), and in the bottom console explanation after debugging that you can read about breakpoints (green rectangle).

For more information for you, I have managed to debug with another board, with the FRDM-KL25Z board with OpenSDA and I haven’t any problem to see the breakpoints with tick signs in the left side of the code from the beginning. For this reason I think perhaps I need some kind of plugin because I actually I’m debugging with Multilink Universal with my actual board with MK20dx256vlh7 microcontroller.

I hope this serve you to find the solution. Thanks a lot for your help.

Regards,

Arturo Arteaga

De: kerryzhou

Enviado el: viernes, 17 de marzo de 2017 8:59

Para: Arturo Arteaga

Asunto: Re: - Re: "Device is secure. Erase to ensecure?".

<https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg> NXP Community

Re: "Device is secure. Erase to ensecure?".

reply from Kerry Zhou <https://community.nxp.com/people/kerryzhou?et=watches.email.thread> in Kinetis Microcontrollers - View the full discussion <https://community.nxp.com/message/888026?commentID=888026&et=watches.email.thread#comment-888026>

0 Kudos

2,911 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Arturo Arteaga,

   What the KDS version you are using?

  If your version is below KDS3.2, please download the newest version and try again:

Kinetis® Design Studio Integrated Development Environment (IDE)|NXP 

  If your anther board can use the breakpoints, please check you code, make sure the break point position can be executed.


Have a great day,
Kerry

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

0 Kudos

2,911 Views
arturoarteaga
Contributor II

Hi again Kerry,

Do you know where I can find a more extended user guide than one that I send you attached in this mail? I think this is very short and It don’t explain anything about breakpoints and another issues like register view, debug…. or other issues. I have been finding information about another user guide.

I need a more complete user guide to work with this develop tool, because there are a lot of issues to manipulate.

Thank you very much at all.

Regards,

Arturo Arteaga

De: kerryzhou

Enviado el: viernes, 17 de marzo de 2017 10:55

Para: Arturo Arteaga

Asunto: Re: - Re: "Device is secure. Erase to ensecure?".

<https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg> NXP Community

Re: "Device is secure. Erase to ensecure?".

reply from Kerry Zhou <https://community.nxp.com/people/kerryzhou?et=watches.email.thread> in Kinetis Microcontrollers - View the full discussion <https://community.nxp.com/message/888032?commentID=888032&et=watches.email.thread#comment-888032>

0 Kudos

2,910 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Arturo Arteaga,

    You post this picture before:

pastedImage_1.png

Please write these code

pastedImage_3.png

before

:pastedImage_4.png

You add break point in for{;;}, are you sure your while(AS1_GetTxCompleteStatur(..)==false) is executed?

I just want to make sure your code is not blocking before your break points.


Have a great day,
Kerry

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

0 Kudos

2,888 Views
arturoarteaga
Contributor II

Hi Kerry,

I managed to see breakpoints. I have had to reinstall the application and I have had to make some updates in the application.

I have a new dude debugging the program: Which is the UART output register or the UART output buffer for mK20dx256vlh7 microcontroller? I see strange characters in the monitor PC when I send to the PC by UART: “hello world”.

I send you the image of the captured monitor PC attached in this mail.

Thanks a lot for your help.

Regards,

Arturo Arteaga

De: kerryzhou

Enviado el: lunes, 20 de marzo de 2017 6:46

Para: Arturo Arteaga

Asunto: Re: - Re: "Device is secure. Erase to ensecure?".

<https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg> NXP Community

Re: "Device is secure. Erase to ensecure?".

reply from Kerry Zhou <https://community.nxp.com/people/kerryzhou?et=watches.email.thread> in Kinetis Microcontrollers - View the full discussion <https://community.nxp.com/message/888387?commentID=888387&et=watches.email.thread#comment-888387>

0 Kudos

2,888 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Arturo Arteaga,

   strange characters in the UART is caused by the baudrate, check your baud rate configuration and your Tera Term baud rate, is it the same as your code configration?


Have a great day,
kerry

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

0 Kudos

2,888 Views
arturoarteaga
Contributor II

Hi Kerry again,

I’m testing now sending one letter (“2” value), but Tera receives the image that I have attached in the mail. The same it´s wrong with strange characters. Perhaps the baud configuration should be different?

I’m following the Tutorial Kinetis: Processor Expert Software – Microcontrollers Driver Suite Getting Started Guide.

Are there any differences because I’m using a different microcontroller??? (My microcontroller is MK20DX256vlh7) In my application “AS1_SendBlock” function is executed step by step like it should be, but when I want to see where the data are sent (in which output registers) when the transmission interrupt is enable, I don’t know where because they are unknown for me.

Thank you very much for your answer,

Regards,

Arturo Arteaga

De: Arturo Arteaga (CAE, SL - FIDEGAS)

Enviado el: martes, 21 de marzo de 2017 11:52

Para: 'jive-660310512-6ba4-2-j1ys@mail.freescale.jiveon.com'

Asunto: RE: - Re: "Device is secure. Erase to ensecure?".

Hi Kerry,

It’s the same configuration. I send you an attached image about both configurations in UART Component and Tera Configuration. They both work at 9600 bauds.

Yesterday I asked you about some transmission registers, do you Know the registers in which appears the UART output transmission data or the UART output buffer for mK20dx256vlh7 microcontroller?? I´m reading in the datasheet and I don´t find any registers related on them. I want to see if the transmission data in these registers are the same that I want to transmit and also in order to compare with data that arrive to Tera application.

Thanks a lot for your help.

Have a nice day too,

Arturo Arteaga

De: kerryzhou

Enviado el: martes, 21 de marzo de 2017 11:09

Para: Arturo Arteaga

Asunto: Re: - Re: "Device is secure. Erase to ensecure?".

<https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg> NXP Community

Re: "Device is secure. Erase to ensecure?".

reply from Kerry Zhou <https://community.nxp.com/people/kerryzhou?et=watches.email.thread> in Kinetis Microcontrollers - View the full discussion <https://community.nxp.com/message/889012?commentID=889012&et=watches.email.thread#comment-889012>

0 Kudos

2,888 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Arturo Arteaga,

    1.  UART_D is the data register,

This register is actually two separate registers. Reads return the contents of the read-only
receive data register and writes go to the write-only transmit data register.

2. I think it may caused by your clock.

   You can send data 0x55, then use the oscilloscope to check the UART TX pin in the MCU, check the bit rate, is it really 115200?

  If you test the bit, it is 115200(the details value in the baud rate, may 11522x), then it may caused by your UART to PC converter.

  If your test bit rate is not 115200, you need to check your bus clock, because UART2 is using the bus clock. bus clock is not accurate will cause the uart rate is not accurate.

  I find your project use the external crystal 16Mhz, you also can try internal clock.

I have modify your project, use UART1 PTE1, PTE0 as the UART pin, and the internal slow IRC as the clock source, I can get the correct data with my TWR-K20D72M board.

 I attached the project for your reference.

I send the test, you can find I get the correct data.

   pastedImage_1.png


Have a great day,
Kerry

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

0 Kudos

2,887 Views
arturoarteaga
Contributor II

Hi Kerry,

I don´t know where I can find IRC as source clock. I have attached an image where you can see the only possibilities that I am able to choose in the “Clock Source” section. Do you Know where is this clock source?? And also how can I get configure it?

How can I get Internal Oscillator as clock source? In clock settings I can see three clock sources, how can I enable Internal Oscillator?? How can I configure it??

It’s unknown for me. This Internal Oscillator is the IRC??

Is it a problem if you can send me a captured image about your configuration?? I only would like to see clock configuration settings and Serial_LDD component configuration (UART configuration)??

I hope not to be a great problem for you.

Thanks a lot for your efforts.

Have a nice day too,

Arturo Arteaga

De: kerryzhou

Enviado el: miércoles, 22 de marzo de 2017 5:22

Para: Arturo Arteaga

Asunto: Re: - Re: "Device is secure. Erase to ensecure?".

<https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg> NXP Community

Re: "Device is secure. Erase to ensecure?".

reply from Kerry Zhou <https://community.nxp.com/people/kerryzhou?et=watches.email.thread> in Kinetis Microcontrollers - View the full discussion <https://community.nxp.com/message/889318?commentID=889318&et=watches.email.thread#comment-889318>

0 Kudos

2,887 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Arturo Arteaga,

   Please download my attached project in the last email, you will find the configuration with IRC in the cpu page.

   Please check it at first.


Have a great day,
Kerry

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

0 Kudos

2,887 Views
arturoarteaga
Contributor II

Hi Kerry,

Perhaps, should I add another “SERIAL_LDD” component for receiving enter?? I have tried another but I have an error because I have problems to inizialite the components. It seems that it isn´t initialize in the “PE_low_level_init” function.

Thanks again.

Regards,

Arturo Arteaga

De: kerryzhou

Enviado el: miércoles, 22 de marzo de 2017 9:29

Para: Arturo Arteaga

Asunto: Re: - Re: "Device is secure. Erase to ensecure?".

<https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg> NXP Community

Re: "Device is secure. Erase to ensecure?".

reply from Kerry Zhou <https://community.nxp.com/people/kerryzhou?et=watches.email.thread> in Kinetis Microcontrollers - View the full discussion <https://community.nxp.com/message/889421?commentID=889421&et=watches.email.thread#comment-889421>

0 Kudos

2,887 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Arturo Arteaga,

   Actually, we talked to much post which is deviated with your original question: Device is secure, erase to unsecure.

  For the new question, could you please create a new post about it?

  About the K20 72M uart code, you also can refer to the TWR-K20D72M board sample code which can be downloaded from this link:

http://www.nxp.com/assets/downloads/data/en/lab-test-software/KINETIS_72MHz_SRC.zip 


Have a great day,
Kerry

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

0 Kudos

2,888 Views
arturoarteaga
Contributor II

OK, thanks I’ll create a new question.

Have a nice day too,

Arturo Arteaga

De: kerryzhou

Enviado el: jueves, 23 de marzo de 2017 7:21

Para: Arturo Arteaga

Asunto: Re: - Re: "Device is secure. Erase to ensecure?".

<https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg> NXP Community

Re: "Device is secure. Erase to ensecure?".

reply from Kerry Zhou <https://community.nxp.com/people/kerryzhou?et=watches.email.thread> in Kinetis Microcontrollers - View the full discussion <https://community.nxp.com/message/889961?commentID=889961&et=watches.email.thread#comment-889961>

0 Kudos

2,888 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Arturo Arteaga,

   Thank you !

   After you create the new post, you can let me know.

  About this post, please mark the correct answer to close it.


Have a great day,
Kerry

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

0 Kudos

2,888 Views
arturoarteaga
Contributor II

Hi Kerry,

Thanks in advance for your help,

The link for the new issue about receiving problems is the next one:

<https://community.nxp.com/message/889969> https://community.nxp.com/message/889969

I’ll try to answer correctly to the question,

Have a great day too,

Arturo Arteaga

De: kerryzhou

Enviado el: jueves, 23 de marzo de 2017 8:02

Para: Arturo Arteaga

Asunto: Re: - Re: "Device is secure. Erase to ensecure?".

<https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg> NXP Community

Re: "Device is secure. Erase to ensecure?".

reply from Kerry Zhou <https://community.nxp.com/people/kerryzhou?et=watches.email.thread> in Kinetis Microcontrollers - View the full discussion <https://community.nxp.com/message/889964?commentID=889964&et=watches.email.thread#comment-889964>

0 Kudos