Hard Fault on Custom PCB

Hello :smiley:

I’ve made a custom PCB that has a particle P1. After putting one together with no custom firmware I was getting the blink codes for a hard fault. Now I’m trying to narrow down the issue and determine what the issue could be.

I’ve tried flashing a blink led example,
I’ve tried an empty loop,
I’ve tried tinker
All of them end up giving me the hard fault :frowning:

Some other things I’ve tried:

  1. particle device doctor

partickle flash --usb tinker particle update

Any guidance here would help thanks :grin:

Other forum post with similar issues


Hard faults are usually caused by your code rather than hardware.
But without knowing your code nor anything about your hardware setup we can’t know for sure.

You could also provide a video (~30 sec.) that shows the blink code to assess whether it really is a hard fault.

What does happen with the device in Safe Mode?

1 Like

Here is a link to the video I took of me plugging it in to power (Behaves the same with USB or LiPo)

Here is the code I’m using ( I Get the same behavior even when I flash tinker)

void setup() {
}

void loop() {   
}

I get the same behavior on tinker, safe mode or with the code below

I flashed the code using VS Code Particle Workbench “Flash Applicatin & Device OS”,
deviceOS@2.0.0-rc.1

Got the fallowing output:

> Executing task: make -f 'C:\Users\Admin\.particle\toolchains\buildscripts\1.9.2\Makefile' flash-user -s <


:::: PUTTING DEVICE INTO DFU MODE

Done.

:::: FLASHING APPLICATION

   text    data     bss     dec     hex filename
   3244     108    1204    4556    11cc c:/Users/Admin/Documents/SmartPippet/BlinkLed/blinkLed/target/2.0.0-rc.1/p1/blinkLed.elf
dfu-suffix (dfu-util) 0.9

Copyright 2011-2012 Stefan Schmidt, 2013-2014 Tormod Volden 
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Suffix successfully added to file
Serial device PARTICLE_SERIAL_DEV : not available
Flashing using dfu:
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Opening DFU capable USB device...
ID 2b04:d008
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x080a0000, size = 3352
Download        [=========================] 100%         3352 bytes
Download done.
File downloaded successfully

*** FLASHED SUCCESSFULLY ***


Press any key to close the terminal.

let me know what else I can provide to help debug

You could have a mismatch in the DeviceOS components. Can you place the device in listening mode and run particle serial inspect on the port used by the Photon?

1 Like

Ok I tried putting the device into listening mode using the fallowing methods:

  1. press and hold the setup button for 3 seconds
  2. using cli particle usb start-listening

I tried the first method multiple times at different times.

  • When the device is first plugged in
  • when the device was blinking red
  • when the device had white Led

Every single time it would go back to the hard fault state

I also tried getting into safe mode

  1. by pressing reset and setup, releasing reset then releasing setup when magenta
  2. using cli command particle usb safe-mode

the CLI always gave me errors and would stay inhard fault state every time I tried

Unable to get serial number descriptor: LIBUSB_TRANSFER_CANCELLED

C:\Users\Admin>particle usb safe-mode
Unable to get serial number descriptor: LIBUSB_TRANSFER_STALL

C:\Users\Admin>particle usb safe-mode
Unable to get serial number descriptor: LIBUSB_TRANSFER_TIMED_OUT

C:\Users\Admin>particle usb safe-mode
No devices found

since you mentioned the DeviceOS I tried flashing the P1 with different os versions using Flash application & Device OS(local)

and all the fallowing versions that I tried resulted in the same issue so I gave up trying after a couple versions ( I can try the rest?):

  • 1.3.1
  • 1.4.0
  • 1.5.2
  • 2.0.0-rc.1

I purchased this P1 from mouser on June 15, 2020 here:
https://www.mouser.com/ProductDetail/465-P1REEL

Could it be the batch from mouser?
Would it be helpful to get a programmer/debugger to flash the firmware using JTAG or SWD?
I would just need to update the PCB design and get myself a programmer?

If this is the entire log of your “Flash Applicatin & Device OS”, then something is wrong.
You should get at least three individual module reports (system part 1, part 2 and application) but I can only see one.

You could try putting the device in DFU Mode and first run particle flash --usb tinker -v followed by particle update -v. This should give you a report for at least three modules and put the device on on v1.5.2 (assuming you are using the most recent CLI version).

1 Like

Thank you very much for being so responsive!

Ok so here is what I did

  1. “Flash Application & DeviceOS” in VS Code particle workbench
> Executing task: make -f 'C:\Users\Admin\.particle\toolchains\buildscripts\1.9.2\Makefile' flash-all -s <


:::: PUTTING DEVICE INTO DFU MODE

Done.

:::: FLASHING APPLICATION & DEVICE OS

  /cygdrive/c/Users/Admin/.particle/toolchains/deviceOS/1.5.2/modules/photon/system-part1/makefile /cygdrive/c/Users/Admin/.particle/toolchains/deviceOS/1.5.2/modules/photon/system-part2/makefile /cygdrive/c/Users/Admin/.particle/toolchains/deviceOS/1.5.2/modules/photon/user-part/makefile
   text    data     bss     dec     hex filename
 238292     212     424  238928   3a550 ../../../build/target/system-part1/platform-8-m/system-part1.elf
Serial device PARTICLE_SERIAL_DEV : not available
Flashing using dfu:
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY      
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/  

Opening DFU capable USB device...
ID 2b04:d008
Run-time device DFU version 011a 
Claiming USB DFU Interface...    
Setting Alternate Setting #0 ... 
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x08020000, size = 238504
Download        [=========================] 100%       238504 bytes
Download done.
File downloaded successfully
   text    data     bss     dec     hex filename
 259024    2596   40248  301868   49b2c ../../../build/target/system-part2/platform-8-m/system-part2.elf
Serial device PARTICLE_SERIAL_DEV : not available
Flashing using dfu:
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Opening DFU capable USB device...
ID 2b04:d008
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x08060000, size = 261620
Download        [=========================] 100%       261620 bytes
Download done.
File downloaded successfully
   text    data     bss     dec     hex filename
   4380     108    1368    5856    16e0 c:/Users/Admin/Documents/SmartPippet/BlinkLed/blinkLed/target/1.5.2/p1/blinkLed.elf
Serial device PARTICLE_SERIAL_DEV : not available
Flashing using dfu:
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Opening DFU capable USB device...
ID 2b04:d008
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x080a0000, size = 4488
Download        [=========================] 100%         4488 bytes
Download done.
File downloaded successfully

*** FLASHED SUCCESSFULLY ***


Press any key to close the terminal.
  1. Particle flash --usb tinker -v
Microsoft Windows [Version 10.0.18363.1016]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\Admin>particle flash --usb tinker -v
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Opening DFU capable USB device...
ID 2b04:d008
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x080a0000, size = 5324
Download        [=========================] 100%         5324 bytes
Download done.
File downloaded successfully
Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!

I followed it with particle update -v and got the fallowing error

C:\Users\Admin>particle update -v

!!! I was unable to detect any devices in DFU mode...

> Your device will blink yellow when in DFU mode.
> If your device is not blinking yellow, please:

1) Press and hold both the RESET/RST and MODE/SETUP buttons simultaneously.

2) Release only the RESET/RST button while continuing to hold the MODE/SETUP button.

3) Release the MODE/SETUP button once the device begins to blink yellow.

I placed the device in DFU mode again and tried again with the fallowing output

C:\Users\Admin>particle update -v

> Your device is ready for a system update.
> This process should take about 30 seconds. Here it goes!

▌ Updating system firmware on the device...dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Opening DFU capable USB device...
ID 2b04:d008
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x080c0000, size = 16008
Downloadng syste[=========================] 100%        16008 bytes
Download done.
File downloaded successfully
Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
▐ Updating system firmware on the device...dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Opening DFU capable USB device...
ID 2b04:d008
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #1 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "DCT Flash   "
Downloading to address = 0x000006d9, size = 1
Downloadng syste[=========================] 100%            1 bytes
Download done.
File downloaded successfully
File too short for DFU suffix
A valid DFU suffix will be required in a future dfu-util release!!!
▌ Updating system firmware on the device...dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

▀ Updating system firmware on the device...Opening DFU capable USB device...
ID 2b04:d008
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x08020000, size = 238504
Downloadng syste[=========================] 100%       238504 bytes
Download done.
File downloaded successfully
Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
▄ Updating system firmware on the device...dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

▌ Updating system firmware on the device...Opening DFU capable USB device...
ID 2b04:d008
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x08060000, size = 261636
Downloadng syste[=========================] 100%       261636 bytes
Download done.
File downloaded successfully
▐ Updating system firmware on the device...Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
! System firmware update successfully completed!

> Your device should now restart automatically.

after all this the device would still behave as the video with the hard fault blinks.
Let me know what else I can provide to give more insight

Hmm, that’s odd and probably best to file a support ticket at support.particle.io

1 Like

No problem thanks for the help I’ll go ahead and post the solution here once I get it resolved

Just to be sure: Do you have nothing connected to the NC pins (8, 9, 10, 11, 12, 14)? Connecting those P1 pins to GND (or VCC) or using the space to route a signal can cause the P1 to behave erratically. They really do need to be unconnected.

Also are you using P1S6/TESTMODE? There are some caveats with that pin as well.

2 Likes

All those pins are disconnected on the schematic, but since you are mentioning hardware, what I will do is solder up another PCB more carefully. its possible that some pins might have had too much paste and some of those pins are shorted to ground or something.

I’ll get back to you on the results of the second PCB, I’m glad to hear it might be a hardware issue since that’s more under my control :grin:

Don’t mean to be picky, but looking at your schematic, you should have current limiting resistors in series with the anodes of the red, green and blue LED’s. 820 Ohms to 1K Ohms should do it.

It’s a stretch, but the I/O pads are being stressed the way it looks on the schematic unless the LED’s have internal current limiting resistors.

My 2 cents.

Good luck!
Bill

1 Like

I am being picky, but VCC is 3.3V, right? Best modern practice is to name it something like “3V3” or something more descriptive. I would also add a small capacitance to the wiper of your pot so the value doesn’t jump all over the place when you move it.