JN5189 Suddenly Stops Working in the Field and Recovers After Full Flash Erase and Reprogramming Hello, I am using the JN5189 in a custom lighting control module with SDK version 2.6.16. One unit suddenly stopped working in the field, and I would like to understand the possible root causes, diagnostic methods, and preventive measures. What Happened 1. I removed the faulty module and read the entire Flash contents using DK6 Programmer. 2. I programmed the dump into another new JN5189 module, which worked normally. This suggests that the firmware and data contained in the dump are valid. 3. I programmed the same dump back into the original faulty chip, but the issue was not resolved. 4. I performed a 'full Flash erase' on the original chip and then programmed the same dump again. The module started working normally. Questions 1. Possible Root Causes What could cause this behavior? Why would programming the same Flash dump fail to recover the original chip, while performing a full erase before programming successfully restores normal operation? 2. Diagnostic Methods If this issue occurs again, what should I check before performing a full erase to identify the root cause? Are there any recommended debugging procedures or tools for investigating this type of failure? 3. Preventive Measures in Firmware Are there any firmware-level measures that could help prevent this issue from occurring again? I would appreciate any advice, similar experiences, or references to relevant technical documentation. Thank you for your help. Johnny9 Re: JN5189 Suddenly Stops Working in the Field and Recovers After Full Flash Erase and Reprogramming Hello,
Hope you are doing well. Thank you for the detailed description.
1. Possible root cause
The fact that the Flash dump works when programmed into another JN5189 indicates that the extracted image itself can result in a functional device. Also, since the original device recovered after a full Flash erase followed by programming the same dump, the device does not appear to have suffered a permanent failure.
An important point is that programming Flash and erasing Flash are different operations. For the JN5189, a Flash page must be erased before it is programmed. Consecutive FLASH_Program() operations can be performed at different addresses, provided that the page has previously been erased.
Therefore, programming the dump back to the affected device without first erasing the Flash does not necessarily restore the Flash to the intended state. Performing a full erase first ensures that the Flash pages are in the appropriate state before the image is programmed again.
This can explain why the erase + program sequence recovered the device.
However, based only on the observations above, we cannot determine what originally caused the unit to stop working. A power interruption, reset, or another event occurring while the application is modifying Flash may be worth investigating if the application performs Flash erase/program operations during normal operation, but the current evidence does not confirm one of these as the root cause.
2. Diagnostic steps
If the issue occurs again, I would recommend preserving the device state before performing any erase or programming operation.
In particular:
Read and save the complete Flash contents, as you did in this case.
Compare the dump against the expected programmed image.
Identify which Flash regions differ and determine whether those regions are expected to be modified during normal operation.
Check whether the application performs any Flash erase/program operations at runtime.
If runtime Flash operations are used, investigate whether a reset or power interruption could occur while those operations are in progress.
If possible, preserve reset-cause information and other diagnostic information from the failing unit before reprogramming it.
The most valuable evidence would be a Flash dump from another failed device taken before any recovery operation, together with information about which Flash regions are modified by the application.
3. Firmware considerations
For application-managed Flash storage, make sure that a page is erased before it is programmed. FLASH_ErasePages() can be used for page erase operations, and consecutive programming operations to different locations are possible once the corresponding page has been erased.
If the application modifies nonvolatile data during normal operation, it would also be useful to review the application's handling of interruptions or resets occurring during those operations.
At this point, the erase + reprogram recovery indicates that the previous Flash state was relevant to the observed behavior, but it is not sufficient to identify how that state was originally reached.
Best regards,
Ricardo
記事全体を表示