VSCode debug Return code: 255

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 and trying to debug using the same steps mentioned here How to use vscode Debugger.

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?

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?

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 …

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.

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.

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)

@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/

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?

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…