# A debug question

**URL:** <https://forum.legato.io/t/a-debug-question/6216>\
**Category:** Uncategorized\
**Created:** [June 1, 2022, 4:27pm UTC](https://forum.legato.io/t/a-debug-question/6216 "2022-06-01T16:27:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![gi1](https://avatars.discourse-cdn.com/v4/letter/g/e79b87/32.png) [@gi1](https://forum.legato.io/u/gi1)\
**Post date:** [June 1, 2022, 4:27pm UTC](https://forum.legato.io/t/a-debug-question/6216/1 "2022-06-01T16:27:22Z")

</div>

Hello,  
I’m debugging my application on WP7702 on field, but I’m finding some problems with Legato behaviour. When my app crashes (at least i guess) the entire system is reverted to a legato copy ( a safe one) and i’m not able to get logs about what really happen with my app.  
Is it possible to disable the fallback legato image? If not… how can forcly sytart the “bad” version to get logs?

I’ve tried with “update --mark-good” but it seems have no effect.

Regards,  
Gianmaria

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [June 1, 2022, 4:44pm UTC](https://forum.legato.io/t/a-debug-question/6216/2 "2022-06-01T16:44:18Z")

</div>

You can see here

> [@Rollback despite system being marked as good](https://forum.legato.io/t/rollback-despite-system-being-marked-as-good/3391/11):
>
> You can build your app to legato.cwe

---

<div class="post-metadata">

**Author:** ![gi1](https://avatars.discourse-cdn.com/v4/letter/g/e79b87/32.png) [@gi1](https://forum.legato.io/u/gi1)\
**Post date:** [June 1, 2022, 4:50pm UTC](https://forum.legato.io/t/a-debug-question/6216/3 "2022-06-01T16:50:19Z")

</div>

Good Idea… i will try…  
Thanks!

---

<div class="post-metadata">

**Author:** ![gi1](https://avatars.discourse-cdn.com/v4/letter/g/e79b87/32.png) [@gi1](https://forum.legato.io/u/gi1)\
**Post date:** [June 2, 2022, 3:55pm UTC](https://forum.legato.io/t/a-debug-question/6216/4 "2022-06-02T15:55:08Z")

</div>

Can you ponint me in the right direction on how to add my app as it was a system app (keep running also on rallback)? I cant understabd where to add in my legato build…

Gian

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [June 2, 2022, 3:59pm UTC](https://forum.legato.io/t/a-debug-question/6216/5 "2022-06-02T15:59:26Z")

</div>

how about adding it in wifi.sdef and recompile the legato.cwe?

> [@Flash size wp7607](https://forum.legato.io/t/flash-size-wp7607/3805/35):
>
> you can go to legato-19.02.0/modules/WiFi/wifi.sdef, under “apps:” section, add e.g. $LEGATO\_ROOT/apps/sample/helloWorld/helloWorld.adef [image] Now the new app will be included in legato.cwe. Please also note that the max size for legato partition is 8MB.

---

<div class="post-metadata">

**Author:** ![gi1](https://avatars.discourse-cdn.com/v4/letter/g/e79b87/32.png) [@gi1](https://forum.legato.io/u/gi1)\
**Post date:** [June 2, 2022, 4:45pm UTC](https://forum.legato.io/t/a-debug-question/6216/6 "2022-06-02T16:45:18Z")

</div>

Unfortunly I’m not using the mangoH source from a bit of time…  
I followed this help:

> **[System Definition .sdef - Legato Docs](https://docs.legato.io/18_10/defFilesSdef.html)**
>
> legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development

It build.  
Is it the same?

Gian

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [June 3, 2022, 1:57am UTC](https://forum.legato.io/t/a-debug-question/6216/7 "2022-06-03T01:57:21Z")

</div>

Sdef will not build to legato cwe, you need to port the application to wifi.sdef and rebuild legato.cwe

---

<div class="post-metadata">

**Author:** ![gi1](https://avatars.discourse-cdn.com/v4/letter/g/e79b87/32.png) [@gi1](https://forum.legato.io/u/gi1)\
**Post date:** [June 3, 2022, 8:42am UTC](https://forum.legato.io/t/a-debug-question/6216/8 "2022-06-03T08:42:30Z")

</div>

1. Added $LEGATO\_ROOT/apps/Acg/Acg.adef in wifi.sdef

```auto
#include "$LEGATO_ROOT/default.sdef"
#include "wifi.sinc"
#include "wifi_samples.sinc"

$LEGATO_ROOT/apps/Acg/Acg.adef

```

1. Dir Acg contains full code (c, api, and so on), but also Acg.wp77xx.update  
3)Build legato cwe with “make wp77xx”
2. executed “swiflash -m “WP77XX” -i legato.cwe” from dir myWorkspace/legato-src/legato/build/wp77xx

But no app were included in legato running on target…

What am I missing?

---

<div class="post-metadata">

**Author:** ![gi1](https://avatars.discourse-cdn.com/v4/letter/g/e79b87/32.png) [@gi1](https://forum.legato.io/u/gi1)\
**Post date:** [June 3, 2022, 9:55am UTC](https://forum.legato.io/t/a-debug-question/6216/9 "2022-06-03T09:55:08Z")

</div>

Solved. My fault. Forget to surround with app: {}.  
thanks a lot.
