0
\$\begingroup\$

I want to be able to program a nRF51822 with this programmer but I'm not sure what pins on the actual chip I should use, and all the guides seemed to be using a different chip

\$\endgroup\$
  • 2
    \$\begingroup\$ What you have is a module, not a chip. You connect the SWD pins, ground, and target supply as a reference input to the programmer, except that what you have isn't a real STLINK, and so doesn't need a reference but unlike a real one can power the target if you like. You'll have to consult the module's documentation to find SWCLK and SWDIO. And yes, before someone unaware jumps in, you can in fact use an STLINK for this non-ST ARM Cortex M0. \$\endgroup\$ – Chris Stratton Jun 27 at 17:41
  • \$\begingroup\$ Thanks for the info \$\endgroup\$ – yanagibashi Jun 27 at 17:52
  • \$\begingroup\$ @ChrisStratton so if I had the chip already on a pcb and powered would I be able to have a debug port using just SWCLK and SWDIO? \$\endgroup\$ – yanagibashi Jun 27 at 18:01
  • 1
    \$\begingroup\$ And ground. Provided it is running at approximately 3v3, otherwise you need a programmer with a target voltage buffer. \$\endgroup\$ – Chris Stratton Jun 27 at 22:06
2
\$\begingroup\$

@chrisstratton has it right; connect SWDCK, SWDIO and GND to the appropriate pins on the programmer. You'll want to use software such as OpenOCD to talk to the nRF51822 using the ST-Link interface.

I've written a lot of software for these chips; if you're doing basic blinky stuff it's not too bad but if you want to use BLE and get into their soft devices there will be a bit of a learning curve because you must flash multiple images to different parts of the nRF51822 memory. If you were using a J-Link debugger it'd be a little easier as Nordic's tools understand how to talk to these programmers and will save you some initial headaches in getting your software, the soft device and (most likely) a bootloader into the memory without erasing the previous bits you've flashed.

A quick google search revealed links such as this one or this Nordic Devzone one which can help you get over the initial hurdles. Be patient, and start simple: blinky is always a good start.

DevZone used to be a lot better before they redesigned everything. Now it's a bit of a crapshoot to find info you want and navigating their terrible "Web 2.0" experience drives me mad, but perhaps you'll weather it better.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.