Custom nRF52832 board pinout

It looks the same as the adafruit feather nrf52832 one, but no need to look at it, only the “variant” and “name” have been changed into “my_board”.

I am onto something. Look, adafruit.py has this interesting piece of code:

if isdir(usb_path):
if env.subst("$BOARD") != "adafruit_feather_nrf52832" :
    env.Append(
        CPPDEFINES=[
            "USBCON",
            "USE_TINYUSB"
        ]
    )

so it adds something with TINYUSB if the board is NOT adafruit feather nrf52832. Now, if I include my board into this logic expression in the if statement:

if env.subst("$BOARD") != "adafruit_feather_nrf52832" and env.subst("$BOARD") != "my_board"

it treats it the same way as adafruit feather one and the issue gets doesn’t appear anymore. Could this be a good way to go?

Looks like I have to resurrect this thread…

I have tried, to the best of my abilities (which doesn’t necessarily say much… :slight_smile: ), to follow the suggestions in this thread, but I’m stuck with a different problem.

I’m using a custom board with a Rigado BMD-300 module, based on nRF52832, and I have looked at several different nRF52832-based boards’ JSON-files to cook up a suitable JSON-file for my board, but when I try to build, I get the error message: "Error: Could not load broken JSON ". I have tried to put the JSON-file and the accommodating variant.xxx and pins_arduino.h in the appropriate folders both in my project directory and in the C:\Users<etc,etc>\framework-arduinonordicnrf5 folder, without any luck.

My platformio.ini

[env:MyBoardNRF5]
platform		= nordicnrf52
board			= MyBoardNRF5
framework		= arduino
board_build.mcu = nrf52832
monitor_speed	= 115200
monitor_port	= COM10
upload_protocol	= blackmagic

build_flags = 
	-I variants/MyBoardNRF5
lib_deps = 
	mysensors/MySensors@^2.3.2
	adafruit/Adafruit BME280 Library@^2.2.2

My MyBoardNRF5.json:

{
  "build": {
    "arduino": {
        "ldscript": "nrf52_xxaa.ld"
    },
    "core": "nRF5",
    "cpu": "cortex-m4",
    "f_cpu": "64000000L",
    "mcu": "nrf52832",
    "variant": "MyBoardNRF5",
    "variants_dir" : "variants"
  },
  "debug": {
    "jlink_device": "nRF52832_xxAA",
    "openocd_chipname": "nrf52832",
    "openocd_target": "nrf52832",
    "svd_path": "nrf52.svd",
  },
  "frameworks": [
    "arduino"
  ],
  "name": "MyBoardNRF5",
  "upload": {
    "maximum_ram_size": 65536,
    "maximum_size": 524288,
	"require_upload_port": true,
	"speed": 115200,
    "protocol": "jlink",
    "protocols": [
      "stlink",
      "blackmagic",
      "jlink",
      "nrfjprog",
	  "cmsis-dap",
	  "nrfutil"
    ]
  },
  "url": "https://www.mysensors.org",
  "vendor": "Generic"
}

Anyone able to spot where I’ve goofed up?
PlatformIO is 6.1.6a4, running in VS Code 1.74.2

Edit: I don’t know if “nrf52_xxaa.ld” and “nrf52.svd” needs to be put somewhere or if they are loaded from somewhere automatically? If it is not done automatically, where can I find them and where should they be put?

The JSON file is syntactically broken, you put a comma after an attribute value but no new attribute followed (svd_path).

Using https://jsonformatter.curiousconcept.com/ with “FIx JSON” unticked will tell you the same.

Hi, maxgerhardt.

Thanks! It’s the small details that trip you up… :laughing:
Didn’t know about the JSON checker site. Seems handy. Thanks again.