# How to debug crashing application?

**URL:** <https://community.particle.io/t/how-to-debug-crashing-application/3292>\
**Category:** Firmware\
**Created:** [March 7, 2014, 8:19am UTC](https://community.particle.io/t/how-to-debug-crashing-application/3292 "2014-03-07T08:19:25Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![david\_s5](https://avatars.discourse-cdn.com/v4/letter/d/53a042/32.png) [@david\_s5](https://community.particle.io/u/david_s5)\
**Post date:** [March 8, 2014, 5:30am UTC](https://community.particle.io/t/how-to-debug-crashing-application/3292/10 "2014-03-08T05:30:32Z")

</div>

If you are building localy use DEBUG\_BUILD=y and add

```auto
void debug_output_(const char *p)
    {
      static boolean once = false;
     if (!once)
       {
         once = true;
         Serial1.begin(115200); // You can choose where the debug goes 
       }

     Serial1.print(p);
    }

```

in you application.cpp.

Then add all the `DEBUG("connection closed %d 0x%04x",retValue, address);` you want.

You get to leave em all in and in a release build they are automagically removed!

Happy debugging!

If you have an JTAG add USE\_SWO\_JTAG=y too!

See for details

> **[Latest firmware released to Spark Build](https://community.particle.io/t/latest-firmware-released-to-spark-build/3127/7)**
>
> @RWB @RWB Yes! This adds Reliability, Reliability, Reliability: The core will re-connection in ~20 seconds or less, on CFOD, wifi resets with no address within 30 seconds or no wifi reconnect after being connected. (try it pull the WAN plug...

---

_[View the full topic](https://community.particle.io/t/how-to-debug-crashing-application/3292)._
