[SOLVED] J-Flash Timeout/Error when erasing S25FL127S NOR Flash on LPC4357

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] J-Flash Timeout/Error when erasing S25FL127S NOR Flash on LPC4357

    Hi,

    I'm receiving the error "PC of target system has unexpected value after erasing sector" while erasing external NOR FLASH S25FL127S (Cypress) connected to MCU LPC4357 (NXP) using J-Flash V6.32f. Earlier versions of J-Flash (V6.30 for example) the error message is preceded by a "Timeout" error.
    The issue occurs when I try to "Erase Chip" after power on, around 4% , every time external Flash contains data. If I run "Erase Chip" again, the process continues smoothly.

    Any idea of what could be wrong? I'm attaching the J-Flash logs.


    Best Regards,
    Alfredo
    Images
    • j-flash error screenshot.PNG

      84.22 kB, 931×713, viewed 1,376 times
    Files
    Best Regards,
    Alfredo
  • Hello,

    Thank you for your inquiry.
    Such an issue is not known to us.
    Could you try using the latest J-Link software package?
    Does the behaviour improve then?
    Is there any application running in the target device that might activate a watchdog or similar MCU states that might block debug access?
    Could you try to reset and halt your device and issue e.g. with J-Link commander and issue a chiperase then?
    Does this work?

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi Nino,

    I see no difference with J-Link software V6.32g. Regarding the application, yes, it enables the LPC4357 internal watchdog.

    J-Link> r
    .
    .
    J-Link> h
    .
    .
    J-Link>exec EnableEraseAllFlashBanks
    J-Link>erase
    Erasing device (LPC4357_M4)...
    J-Link: Flash download: Total time needed: 3.403s (Prepare: 0.079s, Compare: 0.000s, Erase: 3.302s, Program: 0.000s, Verify: 0.000s, Restore: 0.021s)

    ****** Error: Timeout while erasing sector, core does not stop. (PC = 0x1040AA44, XPSR = 0x21000000, SP = 0x10089F60)!
    J-Link: Flash download: Total time needed: 14.082s (Prepare: 0.049s, Compare: 0.000s, Erase: 13.962s, Program: 0.000s, Verify: 0.000s, Restore: 0.070s)
    ERROR: Erase returned with error code -5.


    Best Regards,
    Alfredo
    Files
    Best Regards,
    Alfredo
  • Following your comment regarding the hardware watchdog, I disabled it on my application and I couldn' t reproduce the issue anymore!

    Is there a way to make J-Flash disable the watchdog before erase/program or any other workaround?

    Best Regards,
    Alfredo
    Best Regards,
    Alfredo
  • Hi Alfredo,

    The issue with an active watchdog in the programmed application is that it will (in this case) trigger before J-Link can finish programming/erasing the chip.
    To counter this we suggest disabling the watchdog directly after reset.
    This can be done using the init steps in your J-Flash project.
    More information can be found in the J-Flash user guide.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.