# VSCode debug Return code: 255

**URL:** <https://forum.legato.io/t/vscode-debug-return-code-255/5553>\
**Category:** VSCode\
**Created:** [December 24, 2020, 11:18am UTC](https://forum.legato.io/t/vscode-debug-return-code-255/5553 "2020-12-24T11:18:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![french](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@french](https://forum.legato.io/u/french)\
**Post date:** [December 24, 2020, 11:18am UTC](https://forum.legato.io/t/vscode-debug-return-code-255/5553/1 "2020-12-24T11:18:23Z")

</div>

I am attempting to debug using VScode however I am keep getting “Return code: 255”.

I am on a fresh installation of of Ubunto 20.04 (minimal), vscode 1.52.1, Leagto plugin 1.2 and leaf 2.3.1.

I have followed the instruction for vscode setup here [Install the Legato Plugin for VSCode - Legato Docs](https://docs.legato.io/20_04/tools_vsCodeInstall.html) and trying to debug using the same steps mentioned here [How to use vscode Debugger](https://forum.legato.io/t/how-to-use-vscode-debugger/5284).

Everyting appears to be running normally I can buiild and install the app however when I attempt to debug I never get prompted to install DevMode. I do get prompted to Toggle debug mode with symbols and that appears to run and install. I set a break point and run debug vscode starts the debugger and exits with code 255. The is the same with either launch configuration or attach configuration.

Any ideas?

---

<div class="post-metadata">

**Author:** ![french](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@french](https://forum.legato.io/u/french)\
**Post date:** [December 30, 2020, 7:08am UTC](https://forum.legato.io/t/vscode-debug-return-code-255/5553/2 "2020-12-30T07:08:15Z")

</div>

So it would appear the Return Code 255 is VSCode notifying that it cant open the terminal, after numerous attempts on different Ubuntu distros I still cant get the debugger to run. VSCode never prompts to install DevMode (I have even installed DevMode manaully through leaf but still no luck).

Would someone be willing to share there setup so I can compare against what Im doing? Is there any additional packages that need to be installed on Ubuntu to enable debugging?

---

<div class="post-metadata">

**Author:** ![mehdiALL1](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mehdiALL1](https://forum.legato.io/u/mehdiALL1)\
**Post date:** [January 7, 2021, 10:11am UTC](https://forum.legato.io/t/vscode-debug-return-code-255/5553/3 "2021-01-07T10:11:50Z")

</div>

Hi @french, it’s my case also, I’m not able to install the Devmode (each time I do it, vscode ask me to install it again…) … this bug is was pushed to SW R&D …

---

<div class="post-metadata">

**Author:** ![french](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@french](https://forum.legato.io/u/french)\
**Post date:** [January 9, 2021, 6:47am UTC](https://forum.legato.io/t/vscode-debug-return-code-255/5553/4 "2021-01-09T06:47:18Z")

</div>

Hi @mehdiALL1, I never get prompted to install devMode. I am currently using a mangoh yellow with R12 WP77XX spk.

When I start a debug session i can SSH traffic start between my machine and the target, but it eventually fails with vsCode giving a notification of " Return code: 255" in the bottom right of the the IDE and the debugger exiting. I cant see any additional info in any of the OUTPUT terminals within vscode.

I am also having issues were I cant reset the user partition using swiflash -r however I am unsure if these 2 issues are related.

---

<div class="post-metadata">

**Author:** ![french](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@french](https://forum.legato.io/u/french)\
**Post date:** [January 11, 2021, 7:12am UTC](https://forum.legato.io/t/vscode-debug-return-code-255/5553/5 "2021-01-11T07:12:16Z")

</div>

I managed to get debug to work by flashing the SPK image generated by my toolchain. Im not sure what the real problem was I am pretty sure I had my toolchain configured to align with the official SPK image I downloaded.

---

<div class="post-metadata">

**Author:** ![mehdiALL1](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mehdiALL1](https://forum.legato.io/u/mehdiALL1)\
**Post date:** [January 11, 2021, 8:39am UTC](https://forum.legato.io/t/vscode-debug-return-code-255/5553/6 "2021-01-11T08:39:41Z")

</div>

Hi @french,  
When you said _“flashing the SPK image generated by my toolchain”_, this means that you work with your own spk image? if yes, what are the components (versions)? and what is the official SPK image that solved the problem?

FYI, “swiflash -r” is no longer supported now (for security reason)

---

<div class="post-metadata">

**Author:** ![french](https://avatars.discourse-cdn.com/v4/letter/f/7ea924/32.png) [@french](https://forum.legato.io/u/french)\
**Post date:** [January 11, 2021, 10:13am UTC](https://forum.legato.io/t/vscode-debug-return-code-255/5553/7 "2021-01-11T10:13:58Z")

</div>

@mehdiALL1 I am using the vscode plugin to build. I have selected the latest SDK for my module (swi-wp77\_4.2.0) which has Release13 + Legato 20.08.0.

```
root@swi-mdm9x28-wp:~# cm info
Device: WP7702
IMEI: 352653090159435
IMEISV: 5
FSN: VU929300081310
Firmware Version: SWI9X06Y_02.35.02.00 5208b3 jenkins 2020/06/10 00:30:12
Bootloader Version: SWI9X06Y_02.35.02.00 5208b3 jenkins 2020/06/10 00:30:12
MCU Version: 002.014
PRI Part Number (PN): 9908741
PRI Revision: 002.001 
Carrier PRI Name: TELSTRA
Carrier PRI Revision: 001.044_000
SKU: 1104214
Last Reset Cause: Power Down
Resets Count: Expected: 16 Unexpected: 0
root@swi-mdm9x28-wp:~# legato version
20.08.0_90538deba41726558e83590ee6735ea0
root@swi-mdm9x28-wp:~# uname -a
Linux swi-mdm9x28-wp 3.18.140 #1 PREEMPT Wed Jun 10 03:41:13 UTC 2020 armv7l GNU/Linux

```

Upon install of the SDK in vscode you should have a folder with SPK files, mine are located in /home/user/leaf-workspace/leaf-data/current/wp77-image/

---

<div class="post-metadata">

**Author:** ![dave-k](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@dave-k](https://forum.legato.io/u/dave-k)\
**Post date:** [September 10, 2021, 4:29pm UTC](https://forum.legato.io/t/vscode-debug-return-code-255/5553/8 "2021-09-10T16:29:04Z")

</div>

I’m having the same problem with debugging, it immediately aborts with a return code of 255 and I can’t find any information as to what the issue is. I’ve manually installed devMode (it was uninstalled though I was not prompted about that) and tried installing the .SPK file per the fix that worked for _french_ but it made no difference. I tried running the most basic command from the Legato | How To | Debug using GDB page _“remoteDebug appName processName targetIP”_ as a test and when I do that I just get continually prompted for the password - not sure if that suggests what the actual problem is. I’m using the WP76xx with the most recent SDK for the module (Release 16 + Legato 20.08). Anybody have any suggestions?

---

<div class="post-metadata">

**Author:** ![dave-k](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@dave-k](https://forum.legato.io/u/dave-k)\
**Post date:** [September 10, 2021, 7:17pm UTC](https://forum.legato.io/t/vscode-debug-return-code-255/5553/9 "2021-09-10T19:17:07Z")

</div>

Starting debugging with the target logs open I get this:

Sep 10 15:12:24 swi-mdm9x28-wp authpriv.info dropbear[29299]: Child connection from 192.168.2.3:54340  
Sep 10 15:12:24 swi-mdm9x28-wp authpriv.warn dropbear[29299]: Bad password attempt for ‘root’ from 192.168.2.3:54340  
Sep 10 15:12:24 swi-mdm9x28-wp authpriv.warn dropbear[29299]: Bad password attempt for ‘root’ from 192.168.2.3:54340  
Sep 10 15:12:25 swi-mdm9x28-wp authpriv.warn dropbear[29299]: Bad password attempt for ‘root’ from 192.168.2.3:54340  
Sep 10 15:12:25 swi-mdm9x28-wp authpriv.info dropbear[29299]: Exit before auth (user ‘root’, 3 fails): Exited normally

I’m guessing it might be some ssh keys issue although when I open the target’s shell from within VS Code it opens normally (after prompting for the password). I’m guessing I may have missed some setup step altogether but don’t know what…
