PlatformIO Community

Custom nRF52840 board configuration JSON file for Zephyr

Working though the process of making a custom nRF52840 board to use with Zephyr and I am wondering what I should use for the “variant” field in the board configuration JSON structure.

"variant": "nRF52DK",
"zephyr": {
  "variant": "nrf52840_pca10056"
}

If this is going to be used for a custom nRF52840 board, it would not be a variant on the nRF52DK. As for the Zephyr variant, in the release notes for nordicnrf52 v4.3.0 and for the Zephyr framework v2.3.0 mentions that the nRF52 boards were renamed. So should this variant board name even be recognized?

Following is my new, renamed and slightly modified, “Test_Custom_nrf52840_dk.json” file.

{
  "build": {
    "arduino": {
      "ldscript": "nrf52_xxaa.ld"
    },
    "core": "nRF5",
    "cpu": "cortex-m4",
    "extra_flags": "-DHELLO_PLATFORMIO",
    "f_cpu": "64000000L",
    "mcu": "nrf52840",
    "variant": "nRF52DK",
    "zephyr": {
      "variant": "nrf52840_pca10056"
    }
  },
  "connectivity": [
    "bluetooth"
  ],
  "debug": {
    "default_tools": [
      "jlink"
    ],
    "jlink_device": "nRF52840_xxAA",
    "onboard_tools": [
      "cmsis-dap",
      "jlink"
    ],
    "svd_path": "nrf52840.svd"
  },
  "frameworks": [
    "zephyr"
  ],
  "name": "Test Custom Nordic nRF52840-DK",
  "upload": {
    "maximum_ram_size": 262144,
    "maximum_size": 1048576,
    "protocol": "jlink",
    "protocols": [
      "jlink",
      "nrfjprog",
      "stlink",
      "blackmagic",
      "cmsis-dap",
      "mbed"
    ]
  },
  "url": "https://os.mbed.com/platforms/Nordic-nRF52840-DK/",
  "vendor": "Nordic"
}

Turns out that before the update of nordicnrf52 and the Zephyr framework, the json for my custom board did not need these fields to work.

However, after the update I had to include the following, replacing “nRF52DK” and “nrf52840_pca10056” with my custom board name.

"variant": "nRF52DK",
"zephyr": {
  "variant": "nrf52840_pca10056"
}