Build own custom board on nrf Connect SDK(Devicetree)

Hello,

hello i have created my own devicetree (.dts) file for a self developed board(nrf52dk_nrf52832_customer) based on the nrf52 chip. So I created an folder( named: nrf52dk_nrf52832_customer)  at the following file path:

 ncs\v2.3.0\zephyr\boards\arm\nrf52dk_nrf52832_customer.

he devicetree can be found at this file path:

How can I now flash an application on the customer board. In Visual Studio Code the board does not appear (see picture), So I can not build the whole thing.

  • Make sure you choose the button for "all boards" hidden behind that dropdown.

    Since you placed the board in ncs/v2.3.0, make sure ncs v2.3.0 is your selected ncs version in the vscode settings. (Visible on the home screen)

    There are also a few more files if I recall correctly you need in the custom board folder aside from the .dts, but it's been a long while since I made the custom board

    Here's a really handy video that I used to make a custom board for customer: www.youtube.com/watch

  • thank you for your answer. I tried it with the video. However it dosnt work. When I want to build it with the west build commands.The following error appears: 

    I did some research and found out that you can also create custom boards with VS Studio code. Is there maybe an instruction or something like that, how I have to proceed exactly here. I have tried it via the Create a new board button to proceed (see picture).  After I have then clicked on Create Board a board file is created. But how can I now build an application.

  • hank you for your answer. I tried it with the video. However it dosnt work. When I want to build it with the west build commands.The following error appears: 

    I did some research and found out that you can also create custom boards with VS Studio code. Is there maybe an instruction or something like that, how I have to proceed exactly here. I have tried it via the Create a new board button to proceed (see picture).  After I have then clicked on Create Board a board file is created. But how can I now build an application.

  • For starters, in that error message I'm noticing that it says v2.3.0, but the SDK selected in your screenshot of the gui is pathing to v2.4.0

    Make sure you click the "Open welcome page" and change the SDK to the one you're trying to use, or change it in the extension settings of VS code.

    ~~~~

    That aside, I'll walk through the process of custom board -> application with screenshots of the GUI.

    After you've created the new board, in the same menu is a "create new application"

    This is where you can choose from samples or whatnot. For now, let's just use blinky.

    I created a custom board in the same process you have (via vscode gui) named exampleboard.

    I tick "freestanding," for the SDK/NRF Connect toolchain I use v2.4.0 since that's the version you're on, and here I just choose hello world sample as a template for the application. (Note: You could certainly choose blinky, but blinky requires some device tree updates since your custom device tree won't have any i/o to add the LED)

    After creating it, you'll see it under the applications section on the left hand side beneath where you have the "Welcome" menu options.

    You'll notice under the application you just created it says "No build configurations"

    from here, you can click to create it, and create a build configuration for the custom board you've created.

    You can either choose "custom boards" or "all boards" and filter for the board you want. 

    From here you can click "build configuration"

    Now it will start building for the board you've selected. The first build (and any pristine build) can take a little bit, keep an eye on your nRF Terminal outputs to see it progressing.

    (Here is my terminal output for reference)

    Now, I plug in my board, and flash it with the "ACTIONS" menu

    and there we go.

    (Note: If you want the uart output, you've gotta update your .dts with some of the uart features. Recommend looking at the nRF52840DK device tree as a sample. Your custom board .dts is, for the most part, quite empty, so you need to update it. Here's a link for some background on device tree : https://docs.zephyrproject.org/3.2.0/build/dts/intro.html)

    Also, as a heads up, don't neglect your prj.conf

Related