@electrik
upload_port does not specify the target. It just selects if you'll use the gdb port or the uart port from the BMP. The target I'm talking about is what comes up when trying to do upload.
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, jlink, nrfjprog, nrfutil, stlink
CURRENT: upload_protocol = blackmagic
Looking for BlackMagic port...
Auto-detected: COM2
Uploading .pio\build\MyBoardNRF5\firmware.hex
Target voltage: 3.45V
Available Targets:
No. Att Driver
1 Nordic nRF52 M3/M4
2 Nordic nRF52 Access Port
0x000020d8 in transportProcessFIFO() ()
Loading section .text, size 0x895c lma 0x0
Loading section .ARM.exidx, size 0x8 lma 0x895c
Loading section .data, size 0x23c lma 0x8964
Start address 0x32e0, load size 35744
Transfer rate: 42 KB/sec, 916 bytes/write.
Section .text, range 0x0 -- 0x895c: matched.
Section .ARM.exidx, range 0x895c -- 0x8964: matched.
Section .data, range 0x8964 -- 0x8ba0: matched.
Kill the program being debugged? (y or n) [answered Y; input not from terminal]
If I don't do
#define MYBOARDNRF5
then PlatformIO complains about undefined reference to 'g_ADigitalPinMap', which is in compat_pin_mapping.h and is called from MyBoardNRF5.cpp when MYBOARDNRF5 is defined. But I see that your variant.h/.cpp is different than the ones coming with ArduinoHwNRF5, which I'm using. Maybe try your version instead and see what happens...