Panic, bus_fault

My newly acquired Photon2 started displaying "panic, bus_fault" in the event log after a few days of working properly.

I did go through the setup procedure to re-install the OS FirmWare, but continue to see the same "panic, bus_fault" event.

What is the procedure to confirm whether the part has a hardware problem and whether to replace it.

What version of Device OS did you install? 6.3.0 is recommended.

Are you running your own firmware, or just the default Tinker app? That panic can also be caused by a bug in user firmware. It's rarely a hardware failure.

I reinstalled the OS to version 6.3.0 (had to hunt for it; setup showed only 5.9.0)
The Photon2 continues to display "panic, bus_fault" events.

As a check, I then am running my FW code on an Argon and no panic events are being displayed.

When does the fault occur, right at boot or later? I presume since you're getting fault events, it's after cloud connection. A constant amount of time later? Does it coincide with a network change (Wi-Fi disconnection, for example).

And does it occur if you flash the default Tinker firmware instead of your firmware?

Hi, there are differences in hw and MCU from Argon to Photon 2, have you checked the migration guide just in case there is a pin that changed or something else?

attached is a screen shot of what I am seeing in the events log

The device is rebooting, so trying to figure out when that occurs would be helpful. The first step is to add

SerialLogHandler logHandler(LOG_LEVEL_TRACE);

and monitor the USB serial debug log and see what happens before it disconnects. That might help isolate where the problem is.

In any case, bus fault typically occurs when you are using invalid memory: overwriting a block of memory, using freed memory, using a null pointer. The problem with these bugs is that you will often crash later, not when the corruption occurred, and there's a certain randomness to it.

I am using just pins SDA(D0) and SCL(D1) and I understand they are the same for both Argon and Photon2.

Thank you for your suggestions.
Let me follow-up on them.

Do you have log.info() or serial.print/ln in your code?

There are little issues here and there depending how they are used in the firmware:

Is the fw logging on event handlers? do not do it:

Hi everyone,

I have the same problem with a Photon 2 (OS version 5.9.0, which is the latest default). I get bus errors pretty randomly, even with the tinker firmware.

It seems to be happening when the Photon is trying to connect to the wifi network (looking at the serial logs with the TRACE log level):

See picture. In red, the last log I see when I get the bus error. I can reset the Photon a couple of time, and once in a while, it will connect to the wifi network correctly, then to the particle cloud, and then the firmware works well.

EDIT: I also get the bus error when I boot the photon in safe mode (magenta led).
I downgraded to OS version 5.6.0 (random version) and don't have the bus error anymore... Seems something related to more recent versions...

You should upgrade to Device OS 6.3.0. It may or may not fix this particular problem, but it will fix other related issues on the Photon 2.

It's currently listed as a preview release but you can easily enable pre-release versions in Workbench.

Hi @rickkas7,

Yesterday evening I used 5.6.0, flashed the photon 2 about 30 times (during development) and never had the issue. Connection to wifi was ok everytime. Tried 5.9.0 again, crashed right away

Based on what @gxbene2025 said, 6.3.0 seems to have the same behavior as 5.9.0, this is why I downgraded the version instead of upgrade while trying to solve the issue

I can still try 6.3.0 tonight to clear this out, will report back

You can stay on 5.6.0 if that is working. There will be a 6.3.1 or 6.4.0 at some point in the future that may also help.

Hi again,

I confirm that 6.3.0 has the same behavior. As soon as I updated to 6.3.0, photon 2 is crashing in a loop while trying to connect to wifi (multiple times in a row).

Reverting to 5.6.0 fixes this problem. I will stay at 5.6.0 for now.

This should still be investigated for other users. Let me know if I can help with that.

EDIT: The problem seems to be related to the toolchain version, not the OS version itself. When setting the toolchain to 5.6.0, but with the Photon being at OS version 6.3.0, I don't have any issue (same for OS version 5.9.0)

1 Like

That is somewhat surprising, thanks! That points to a problem in the ABI, the connection between the user firmware and Device OS, which can lead to a hard fault if there is a bug.

1 Like