P2 unable to flash error - fails at 27%

This is the second time I have got a P2 based device that has got itself in a state where it always fails to local flash (via Serial USB) at around 27%. The device can be setup again using setup.particle.io but does not connect to the cloud after it has connected to the WLAN. I understand the only solution is to SWDIO update the Device OS. Is this a recognised issue or am I alone in experiencing this problem?

One possibility is that the flash file system is corrupted. Do you have any code that uses the file system? There is a known issue where iterating the directory while deleting files can corrupt the file system. Newer versions of PublishQueuePosixRK and other libraries work around this issue.

If the device cannot connect to the cloud, it's best to get a log. It's possible that the device keys were lost, which would cause that behavior. It's rare on the P2, but could happen.

Hi Rick,

I am using PublishQueuePosixRK and other dependencies as follows:

name=PublishQueuePosixRK

version=0.0.7

dependencies.SequentialFileRK=0.0.2

dependencies.BackgroundPublishRK=0.0.2

Which version should I replace this with?

Thanks

Definitely update PublishQueuePosixRK to 0.0.8 as the earlier versions can corrupt the file system. Another symptom of this happening is that the device does a SOS+10 at boot, and you can't get into DFU mode.

0.0.8 (2025-09-29)

  • Updated to SequentialFileRK 0.0.4 to fix an issue that could cause file system corruption.

Hi Rick,

Your library files don’t have change logs, if I install a library from the Workbench having changed the properties file will the copy that was already installed be updated just for the specific file to the correct version? I need to confirm this as I am unclear what was changed in SequentialFileRK.

[Edit] Sorry - it is in the library.properties!

For SequentialFileRK there is a workaround noted and a FIX ME - I assume 0.0.4 was the workaround?

If you go to the Github for the library, the end of the README file contains a change log for most libraries, for example for SequentialFileRK. If you've copied the library locally in Workbench, the README is in the lib directory as well.

If you update the project.properties in your project to change a library version you can do a particle library copy <library_name> to update the local version. It's not automatic, and Workbench uses the local version for local compiles, not the version in the project.properties!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.