Need some guidance getting started with VS Code/nRF Connect

OK, like many people moving across from a different IDE/SOC environment, I'm finding navigating my way through setup and programming with Nordic SOC, even of simple tasks, pretty challenging.

Yes, there are videos and examples I can look at, but everything seems to be focussed on using nRF5 and SEGGER, which means most of the API's that are being used aren't compatible with the recommended setup of VS Code and nRF Connect.

So, whilst I'm pretty confident with programming PSoC/SOC (I have been using Cypress IC's and Cypress's IDE - PSOC Creator for the past 5 years), getting up to speed on the Nordic stuff is painfully slow.  It seems you need a certain baseline level of understanding of most of the development environment before you can get started.  Words like west, Zephyr, kConfig, etc get thrown about as if its common knowledge.  But coming from the Cypress IDE, I can tell you that trying to get started with Nordic is a bit like being given a text book entirely in French and being told "look, here you go - its all in there" (no, I don't speak French, in case you were wondering).

As an example of the sort of process that a beginner needs to go through, I've been looking at the Buttons example in the nRF Connect code examples.  In there, it has an example of how to set up a GPIO to interface to a button on the nRF52832 DK.  There is an API that it calls: gpio_pin_configure_dt.  Now, if I Google this, it takes me to the Zephyr project documentation, where there is about 20 pages of GPIO related API's.  Great.  But it would be nice to have a few training modules showing how to go about setting up GPIO, using these various API's, for some pretty common GPIO arrangements.  That's where Cypress are much, much better - they really help you get up to speed using their system.  If I look at some of the examples online (YouTube, for example), they appear to use an entirely different set of API's for GPIO related applications - stuff all starting with nrf_ and in some cases nrfx_

I then got a bit distracted by all the other API options available in the Zephyr documentation, and honed in on the ones for LEDs.  I then disappear down a wormhole of "WTF" as I look at all the details telling me I need to add CONFIG statements (where?  is it in the .config file under the zephyr directory for my application?  Is it in the in the kconfig directory?  Is it in the prj.conf file?) and then presumably I'm supposed to include the requiste #include statements in my code somewhere, but its not clear what I need to be including, and how I make sure my code knows there these are without putting the full directory listing in there.

Its that sort of process us begineers find ourselves going through for pretty much every single thing we want to learn how to do.  And it takes days of frustrating filtering, and staring at lines of code, trying to get your head around why something doesn't compile or work, or whatever.

There really needs to be a dummy's guide to getting up and running to a certain level.  I'm happy to pay to do an organised course, or have someone who knows how these things all work, to help step me through things initially so I can get a decent baseline of expertise, but even that sort of thing doesn't appear to be available.

Can anyone point in in the direction of some good, beginner friendly resources (either training courses, or online tuition, or whatever) to programming the nRF52 series, using VS Code and nRF Connect?

Cheers,

Mike

  • Hey Mike!

    Yeah, I can imagine it being quite the learning curve if you aren't used to Zephyr and nRF Connect SDK. I guess it is somewhat assumed that you are in the majority of what we post. The nRF5 SDK is a bit different from NCS so it is good that you don't mix those two. Though the difference between VSC and Segger is mainly the IDE - you don't have to specifically look for tutorials for VSC if that is what you are planning to work with. And Visual Studio Code being a part of nRF Connect for Desktop is very new, so I would understand that you would have a hard time finding any beginner tutorials that are using it. There will be more of those eventually.

    - This tutorial is a very beginner friendly resource, that explains how creating projects in NCS works. This also includes explaining the difficult terms such as West, Zephyr and Kconfig, that we might simply throw out there in other tutorials and posts on DevZone, without much of an explanation. This tutorial is like both your French textbook and dictionary. It focuses a bit on Segger, though that doesn't make it any less relevant. Everything mentioned in Segger has a counterpart in VSC. We will probably update this tutorial to show everything on VSC eventually. 

    - From there you might want to take a further look at peripherals and drivers. Here is a tutorial, and here is the essentially the same in a nice webinar format. It is in Segger, but still relevant for you.

    - When it comes to VSC and how to use it, the video tutorials are the best things we have available at the moment.

    - There are several more tutorials out there however, and a lot of documentation.

    Btw, if you have a hard time getting up and running with anything, for instance controlling the LEDs, then opening a demo application and using that as a starting point is the recommended way to get going. That will for instance show you what configurations are needed and provide you with a lot of info with its documentation. There is a lot of a API to get a hang of in Zephyr. I should also mention that you can use the nrfx drivers in NCS as well, though I would recommend you to use the others.

    I hope these resources help. One last resource that I hope you'll use, is our presence here on DevZone. Let us know if there is anything else we can help you with.

    Best regards,

    Elfving

  • Hi Elfving,

    Thanks so much for your extensive reply.  The DevZone is definitely a step up from what I'm used to with Cypress (they used to be great, but since Infineon took over, responses take weeks), so well done.

    I'll have a look through those tutorials you sent the link for and see how much that clarifies for me.

    I had stumbled across those YouTube series from Ali Aljaani, which were a great help.  Although I did come unstuck with the debug session, and have still not worked out why its not working for me (kicks up an error about failing to launch a GDB Server: Error: spawn JLinkGDBServerCL.exe ENOENT).

    I guess the issue is, whenever I come unstuck, being in the southern hemisphere, its probably 12-24 hours before I can get a response that might set me on the right track, which is really slowing me down.  Hence why I was hoping there might be some "how to' resources out there I can tap into so I can fast track my progress a bit.

    Anyway, I'll look into the information you've provided links to, see how far I get

    Thanks again,

    Mike

  • Great! That sounds like a plan!

    Mike Austin (LPI) said:
    its not working for me (kicks up an error about failing to launch a GDB Server: Error: spawn JLinkGDBServerCL.exe ENOENT)

    Hmm, that is weird. If you run into that issue again, go ahead and create another DevZone ticket for it. We prefer to keep the different issues separate so that they are easier to navigate for people later on. 

    Mike Austin (LPI) said:
    its probably 12-24 hours before I can get a response that might set me on the right track

    Yeah, and that might be the case no matter where in the world you are. Though the majority of tech support are in the CET/CEST time zone, and we try to limit our response time to less than 24h. 

    Good luck with the tutorials!

    Best regards,

    Elfving

Related