Error with flash memory, PE_DEBUGHALT ();

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

Error with flash memory, PE_DEBUGHALT ();

1,284 Views
danilolima
Contributor II

I was conducting tests with the recording in flash memory using the expert processor , and the program stopped working. I had an earlier version that was running normally but even she was not . The error is as follows: When clicked to start the program he showed PE_DEBUGHALT (); within the vector and let not run the program . I'm using kds with frdm k64f . If anyone knows of a solution I will be very grateful.

0 Kudos
11 Replies

1,020 Views
danilolima
Contributor II

Many thanks to all who tried to help me , I ended up finding the solution alone. Only changed the memory storage location and has solved .

0 Kudos

1,020 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Danilo,

    I run your code on my side, it works ok:

pastedImage_1.png

  I think your problem is caused by the 0X1F000 didn't do flash erase before, and 0X1F000 already have data.

  To the flash, when you want to write the data, you should make sure that area is erased, so normally, customer need to do the sector erase before do the flash write.

  You can do a sector erase before :

    Error = FLASH1_Write(MyFLASH_Ptr, Data, MY_FLASH_LOCATION, sizeof(Data));   //Start writing to the flash memory

  Your code can work on my side, because I do the mass erase before download the data, so the 0X1F000 is 0xff on my side before do flash write operation.

Wish it helps you!


Have a great day,
Jingjing

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

0 Kudos

1,020 Views
danilolima
Contributor II

Dear Jingjing Zhou. It's hard , worked 3 times, but when I run the fourth already gave no further . I deleted everything that had added and left as it was working yesterday and continued giving error . Even adding what you told me, the damn error persists.

0 Kudos

1,020 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Danilo,

     I find you didn't add :

DataWrittenFlg = TRUE;

in FLASH1_OnOperationComplete function.

  Now I modified your code, and do the erase, write, read operation in the for(;;).

  I have test the modified project on my FRDM-K64 board, and it works ok.

   You can try my modified project on your side, I have attached it.

  If you still have problem, please let me know.


Have a great day,
Jingjing

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

0 Kudos

1,020 Views
danilolima
Contributor II

Dear Kerry Zhou , thanks for the help , everything is working as desired now .

0 Kudos

1,020 Views
BlackNight
NXP Employee
NXP Employee

Hi Danilo,

do you know which interrupt is causing this? I recommend that you set one interrupt handler for each interrupt vector, see https://mcuoneclipse.com/2012/02/20/oh-my-an-interrupt/ .

I hope this helps,

Erich

0 Kudos

1,020 Views
danilolima
Contributor II

Thanks for trying to help me.
      I tested the method you passed me but got no result, still not running because of this interruption. my main basically consists of the following lines :

  • MyFLASH_Ptr = FLASH1_Init(NULL);
  • Error = FLASH1_Write(MyFLASH_Ptr, Data, MY_FLASH_LOCATION, sizeof(Data));      
  • while (!DataWrittenFlg) {                                                       
  • FLASH1_Main(MyFLASH_Ptr);  
  • }  
  • DataWrittenFlg = FALSE;  
  • if (FLASH1_GetOperationStatus(MyFLASH_Ptr) == LDD_FLASH_FAILED)
  • }   
  • Error = FLASH1_Read(MyFLASH_Ptr, MY_FLASH_LOCATION, Buffer, sizeof(Buffer));
  • do {
  •      FLASH1_Main(MyFLASH_Ptr);
  •      OpStatus = FLASH1_GetOperationStatus(MyFLASH_Ptr);  
  • } while (!((OpStatus == LDD_FLASH_IDLE) | (OpStatus == LDD_FLASH_FAILED)));   
  • if (OpStatus == LDD_FLASH_FAILED)
  • {    
  • }

  I believe that the error is FLASH1_Main(MyFLASH_Ptr);

0 Kudos

1,020 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Danilo,

   You can upload your test project, I would like to help you to check it.


Have a great day,
Jingjing

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

0 Kudos

1,020 Views
danilolima
Contributor II

This is my program:

0 Kudos

1,020 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Danilo,

   Please check these two points:

1. When do the flash operation, please disable the global interrupt at first, after the flash operation is finished, then enable the interrupt again.

2. Put the flash command operation code in the RAM.

Wish it helps you!

If you still have question, please let me know!


Have a great day,
Jingjing

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

0 Kudos

1,020 Views
danilolima
Contributor II

Thanks for trying to help me . I'm dificuldado to disable interrupts global can you help me ?

0 Kudos