Hard Fault when erasing Flash sector 3

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

Hard Fault when erasing Flash sector 3

751 Views
patrickhudson
Contributor III

Hello,

We're working on an IAP solution.  The iap function is running in ram (placed via RAMFUNC macro).

Erasing of flash sectors 0,1, 2  and 4 through 15 are successful (via FLASHIAP_EraseSector()) but if we attempt to erase sector 3 we experience a Hard Fault.  The image size is ~ 260k bytes.  We believe we have all application level interrupts disabled (can, usb etc).  The Interrupt Vector Table has been copied to ram and the VTOR is pointing at the table in ram.

Anyone have any ideas or experience with a similar issue?

LPC54608 MPU

Thanks

Labels (1)
0 Kudos
2 Replies

542 Views
patrickhudson
Contributor III

Hello,

I determined the issue.  We had placed the FLASHIAP_* functions in ram and needed to set the THUMB bit in the function call to iap_entry (which was also in ram).

   ((IAP_ENTRY_T)(FSL_FEATURE_SYSCON_IAP_ENTRY_LOCATION | 1))(command, result);

I have no idea why the HARD_FAULT was only being seen when erasing sector # 3.

Thanks

0 Kudos

542 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Patrick Hudson,

Thank you for your interest in NXP Semiconductor products and 
the opportunity to serve you.

I was wondering if you can share a compile-able demo, then I can replicate the phenomenon on my site.

Have a great day.

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