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.

OK I finally had some time to try out some stuff

I got the board soldered by a pick and place company
I got X-rayes done on the board (No issue soldering was good)
I ordered a new PCB from JLC PCB instead of Dirty Cheap PCBS

everything I tried gave me the same resultsā€¦ Iā€™m forced to conclude that the likely candidate is the batch of P1ā€™s that I have. I fallowed the PCB guides provided by the particle datasheet so I think my design is fine but I think Iā€™ll need more attention to be put into this issue.

Iā€™ll go ahead and open another ticket
I might also order another set of P1ā€™s from mouser, hopefully its just an issue with the batch??

File a ticket and we will take it from there. :slight_smile:

A few things (some of which have already been mentioned):

  • You are missing the bypass capacitors. There should be 6x 0.1 uF capacitors.
  • The RGB LED is missing the current-limiting resistors on R,G, and B.
  • The SETUP button is missing the pull-up resistor and is floating.

This is a sample design that Iā€™ve used. I blurred out the parts that are not relevant.

1 Like

Thank you very much for the feedback.

Iā€™ve tested the board with the fixes you suggested:

  • Added 6x 0.1 uF bypass capacitors
  • Added 470Ohm resistors to each RGB LED pin
  • Added a pull-up resistor to the setup button (missing in P1 datasheet under Schematic - User I/O)

I tried all the suggested steps above with the exact same results

What version of Device OS is on your P1? There is a bug in 1.2.1 - 1.4.3 where a P1 can SOS at boot if there are no Wi-Fi credentials. Itā€™s fixed in 1.4.4 but you can run into this if your device from the factory has 1.2.1 on it.

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