Here is the verbose for the Arduino IDE:
Flashing with command:/Users/hakan/.arduino-create/arduino/openocd/0.11.0-arduino2/bin/openocd -d2 -s /Users/hakan/.arduino-create/arduino/openocd/0.11.0-arduino2/share/openocd/scripts/ -f interface/cmsis-dap.cfg -c transport select swd; adapter speed 1000 -f target/nrf52.cfg -c telnet_port disabled; init; reset init; halt; adapter speed 10000; program {/var/folders/dy/qqk78q1956s1pb94hc4y_x5m0000gn/T/arduino-create-agent511362936/sketch_mar22a.elf}; reset run; shutdown
Open On-Chip Debugger 0.11.0+dev-gab95bac57-dirty (2021-05-11-10:57)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
adapter speed: 1000 kHz
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: FW Version = v1.0
Info : CMSIS-DAP: Serial# = AA7EAA93
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x2ba01477
Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for nrf52.cpu on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00006dc4 msp: 0x20010000
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00006dc4 msp: 0x20010000
** Programming Started **
Info : nRF52832-CIAA(build code: E0) 512kB Flash, 64kB RAM
Warn : Adding extra erase range, 0x0001d8f8 .. 0x0001dfff
** Programming Finished **
shutdown command invoked
Here is the one for PlatformIO:
AVAILABLE: blackmagic, cmsis-dap, jlink, nrfjprog, nrfutil, sam-ba
CURRENT: upload_protocol = cmsis-dap
openocd -d2 -s /Users/hakan/.platformio/packages/tool-openocd/scripts -f interface/cmsis-dap.cfg -f target/nrf52.cfg -c "transport select swd;" -c "adapter speed 1000" -c "program {.pio/build/nicla_sense_me/firmware.hex} verify reset; shutdown;"
xPack OpenOCD x86_64 Open On-Chip Debugger 0.11.0+dev (2021-10-17-00:18)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
Warn : Transport "swd" was already selected
swd
adapter speed: 1000 kHz
Info : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: FW Version = v1.0
Info : CMSIS-DAP: Serial# = AA7EAA93
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x2ba01477
Info : nrf52.cpu: Cortex-M4 r0p1 processor detected
Info : nrf52.cpu: target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for nrf52.cpu on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x000008e4 msp: 0x20000400
** Programming Started **
Info : nRF52832-CIAA(build code: E0) 512kB Flash, 64kB RAM
Warn : Adding extra erase range, 0x00052738 .. 0x00052fff
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
shutdown command invoked
Platform.ini content:
[env:nicla_sense_me]
platform = nordicnrf52
board = nicla_sense_me
framework = arduino
monitor_speed = 115200
debug_speed = 1000
upload_protocol = cmsis-dap
lib_deps =
Wire
/Users/marcopolo/Documents/PlatformIO/Projects/C1/include/Arduino_BHY2
/Users/marcopolo/Documents/PlatformIO/Projects/C1/include/ArduinoBLE-master
The code is a very basic blink example.
Edit: Here is the error:
++ MbedOS Fault Handler ++
FaultType: HardFault
Context:
R 0: 20010000
R 1: 0001BB1C
R 2: 00000005
R 3: 00000000
R 4: 20010000
R 5: 20010000
R 6: 0001BB1C
R 7: 00000000
R 8: 00000000
R 9: 00000000
R 10: 00000000
R 11: 00000000
R 12: FFFFFFFF
SP : 20002CA0
LR : 00010CB7
PC : 00013B3E
xPSR : A1070000
PSP : 20002C80
MSP : 2000FFC0
CPUID: 410FC241
HFSR : 40000000
MMFSR: 00000000
BFSR : 00000082
UFSR : 00000000
DFSR : 00000000
AFSR : 00000000
BFAR : 20010000
Mode : Thread
Priv : Privileged
Stack: PSP
-- MbedOS Fault Handler --
++ MbedOS Error Info ++
Error Status: 0x80FF013D Code: 317 Module: 255
Error Message: Fault exception
Location: 0x13B3E
Error Value: 0x2000303C
Current Thread: main Id: 0x20001A78 Entry: 0x13057 StackSize: 0xC00 StackMem: 0x200020D0 SP: 0x20002CA0
For more info, visit: https://mbed.com/s/error?error=0x80FF013D&tgt=NICLA
-- MbedOS Error Info --
Edit: Same board works pretty fine in Windows OS.