how to configure "nrf52840_qfaa" instead of "nrf52840_qiaa" in device tree?

Hello Nordic Team,

I am using my custom board, which uses nrf52840 qfaa chip. I am working with nRF Connect SDK v2.8.0

When I worked with blinky project on nrf52840DK, it works fine.

In order to make the blinky project work on my custom board,  I modified SDK/zephyr/boards/nordic/nrf52840dk/nrf52840dk_nrf52840.dts file to include nrf52840_qfaa.dtsi instead of nrf52840_qiaa.dtsi. (I don't know this is right way or it shoud be done in an project overlay file anyhow)

In nrf52840dk_nrf52840.dts file:

#include <nordic/nrf52840_qfaa.dtsi>
#include <nordic/nrf52840_partition.dtsi>
#include "nrf52840dk_nrf52840-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>

When I tried build, there was an error like this:

devicetree error: C:/DevTools/nRF/ncs/v2.8.0/zephyr/boards/nordic/nrf52840dk/nrf52840dk_nrf52840.dts:135 (column 1): parse error: undefined node label 'reg0'
CMake Error at C:/DevTools/nRF/ncs/v2.8.0/zephyr/cmake/modules/dts.cmake:295 (execute_process):
execute_process failed command indexes:

1: "Child return code: 1"

Call Stack (most recent call first):
C:/DevTools/nRF/ncs/v2.8.0/zephyr/cmake/modules/zephyr_default.cmake:133 (include)
C:/DevTools/nRF/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
C:/DevTools/nRF/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate)
CMakeLists.txt:4 (find_package)

looking at nrf52840_qfaa.dtsi file, there is no "reg0" node, while nrf52840dk_nrf52840.dts file has following setting in it:


&reg0 {
status = "okay";
};

So, my question is:

what is right way to change the device tree to reflect nrf52840_qfaa 

Thanks,

Robin

Parents
  • Hello,

    what is right way to change the device tree to reflect nrf52840_qfaa 

    There is an easy, and a right way to do this.

    First of all, the intention is never that you should edit anything in the .dts or the .dtsi files directly. In your application folder, you can create a file called <board_name>.overlay inside a boards folder (you will see it in many of our samples). In fact, most customers prefers to not change any files inside the nRF Connect SDK at all.

    So the easy way (which you can use for testing) is to add a folder called boards in your application's root folder. In there, create a file called nrf52840dk_nrf52840.overlay, and in that file, write:

    /delete-node/ &reg0;

    which will tell the devicetree system to ignore that register. 

    The correct way to do this, however, since you have a custom board, would be to create your own board files, and build for that board instead of the nrf52840dk_nrf52840. To do so, the simplest way is pretty much to copy everything you find in the folder ncs/v2.8.0/zephyr/boards/nordic/nrf52840dk/

    And paste it into a folder where you keep your custom boards. Then replace all occurences of nrf52840dk with your own name, as well as nrf52840dk_nrf52840. Then go in and make the adjustments that would fit for your custom board, such as changing the qfaa instead of the qiaa. This would also be where you would move any buttons or leds, if you have any, as well as removing/replacing the external flash chip.

    Best regards,

    Edvin

Reply
  • Hello,

    what is right way to change the device tree to reflect nrf52840_qfaa 

    There is an easy, and a right way to do this.

    First of all, the intention is never that you should edit anything in the .dts or the .dtsi files directly. In your application folder, you can create a file called <board_name>.overlay inside a boards folder (you will see it in many of our samples). In fact, most customers prefers to not change any files inside the nRF Connect SDK at all.

    So the easy way (which you can use for testing) is to add a folder called boards in your application's root folder. In there, create a file called nrf52840dk_nrf52840.overlay, and in that file, write:

    /delete-node/ &reg0;

    which will tell the devicetree system to ignore that register. 

    The correct way to do this, however, since you have a custom board, would be to create your own board files, and build for that board instead of the nrf52840dk_nrf52840. To do so, the simplest way is pretty much to copy everything you find in the folder ncs/v2.8.0/zephyr/boards/nordic/nrf52840dk/

    And paste it into a folder where you keep your custom boards. Then replace all occurences of nrf52840dk with your own name, as well as nrf52840dk_nrf52840. Then go in and make the adjustments that would fit for your custom board, such as changing the qfaa instead of the qiaa. This would also be where you would move any buttons or leds, if you have any, as well as removing/replacing the external flash chip.

    Best regards,

    Edvin

Children
Related