Building vscode on the N2

Post Reply
wallyz21
Posts: 104
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 9 times
Been thanked: 12 times
Contact:

Building vscode on the N2

Unread post by wallyz21 » Fri Apr 12, 2019 11:26 am

You can build vscode on the N2 Ubuntu Arm64 if you follow the vscode on XU4 guide found here:

https://www.hardkernel.com/blog-2/visua ... ntu-18-04/

However replace any references to armhf with arm64. (eg ./scripts/npm.sh install --arch=armhf --> ./scripts/npm.sh install --arch=arm64)

Also the command :

Code: Select all

 curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt
will not work on 18.04 because /etc/apt is no longer a file but is instead a directory.

Instead launch Ubuntu "Software & Updates" goto the "Other Software" tab and manually add this entry (cut n paste)

Code: Select all

deb https://dl.yarnpkg.com/debian/ stable main.
The install should then proceed as described in the article.

Once finished you will notice there are no extensions in the extension store. To fix this add the following entry to the product.json file and you will be able to add any extension you like.

Code: Select all

"extensionsGallery": {
    "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
    "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
    "itemUrl": "https://marketplace.visualstudio.com/items"
}
(Add it after the last entry and restart vscode)

Everything including the extensions appear to work! However I am having trouble getting vscode to attach to the debugger! I'll get back to you'll on this!

For those unfamiliar with vscode you will want to add the C/C++ (IntelliSense, debugging, and code browsing. Extension) as this provides your basic debugging support.
And another good extension is gitlens which add GUI support for git.

Buon Odroiding
Last edited by wallyz21 on Fri Apr 12, 2019 11:36 am, edited 1 time in total.

joshua.yang
Posts: 286
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: Korean, English
ODROIDs: XU4, XU4Q + Cloudshell2, H2, N2
Has thanked: 2 times
Been thanked: 40 times
Contact:

Re: Building vscode on the N2

Unread post by joshua.yang » Fri Apr 12, 2019 11:32 am

Great guide. :)

Is any laggy behaves on VS Code?

wallyz21
Posts: 104
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 9 times
Been thanked: 12 times
Contact:

Re: Building vscode on the N2

Unread post by wallyz21 » Fri Apr 12, 2019 11:38 am

@ joshua.yang : The only lag is when vscode first launches but it's not that bad. Once open it is acceptably quite good!

Keep in mind the very first time you open vscode it completes the build process so this can take 30 minutes or so. As stated in the guide this only occurs once (on the first open). Subsequent opens are good!

joshua.yang
Posts: 286
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: Korean, English
ODROIDs: XU4, XU4Q + Cloudshell2, H2, N2
Has thanked: 2 times
Been thanked: 40 times
Contact:

Re: Building vscode on the N2

Unread post by joshua.yang » Fri Apr 12, 2019 3:06 pm

Sounds it works flawlessly. Glad to hear that, thanks :)

wallyz21
Posts: 104
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 9 times
Been thanked: 12 times
Contact:

Re: Building vscode on the N2

Unread post by wallyz21 » Sun Apr 14, 2019 2:17 pm

As to getting the debugger working for C/C++. Unfortunately MS only provide runtime libraries for certain environments. Linux ARM64 is not one of them. We'll just have to wait until it is provided.

Even if you build vscode-cpptools from the source the finished extension downloads two final dependent runtime binaries from MS when you first install/run the extension.

wallyz21
Posts: 104
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 9 times
Been thanked: 12 times
Contact:

Re: Building vscode on the N2

Unread post by wallyz21 » Fri Aug 02, 2019 10:18 pm

I have now managed to get native debugging working in vscode on the N2. The secret is not to use Microsoft's intellisense and debugger but to instead install "Native Debug" by webfreak from the vscode extensions store.
Then configure a launch.json as per usual and it works as expected.
These users thanked the author wallyz21 for the post (total 2):
odroid (Mon Aug 05, 2019 9:51 am) • xabolcs (Mon Aug 12, 2019 11:34 pm)

wallyz21
Posts: 104
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 9 times
Been thanked: 12 times
Contact:

Re: Building vscode on the N2

Unread post by wallyz21 » Mon Aug 12, 2019 9:56 pm

Another visual debug tool that works on the N2 is gdbgui which runs in the browser. Works well and disassembles to arm64 code if required.

https://www.gdbgui.com/

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 0 guests