This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Newbie about to program a prototype board

So I'm only use to programing PICs with mplabX

I've designed my board and am ready to dive into programing the Nrf51822

I'm a little overwhelmed by the different information on this topic and unfamiliar with certain concepts so a ELI5 is almost necessary.

What do I need hardware wise to connect to a 4 pin debugging/programming port. can i whip up a custom connector?

I noticed there was a Nordic SDK, does this integrate into mplab? are there libraries included with this sdk?

Can i create a custom programmer, I saw some guides for cheap opensource arm debuggers that work with the nrf51822, I also was told somewhere that I need a segger programmers the 4 pin one seems to be $1000, whats that about?

Any information would be great, thanks

  • You can whip up a custom connector but I don't recommend it, debugging interfaces run at high speed and stray capacitance, long cables, different lengths and other factors mean a properly specified connector helps. Apart from that you can attach a number of standard debuggers/programmers to standard connectors.

    ARM publishes the spec for connectors here, most implementations now use the 0.5" pitch 10-pin FTSH connector.

    There's also TagConnect which I use on small boards where I don't want to mount a connector or don't have room for one. It works fine, can be a bit frustrating to attach, but it's another option.

    No nothing is going to integrate into MPlab, you can close that and put it away, you will need entirely different tools for this. You'll need Keil or IAR or some people use Eclipse, Segger has Segger Embedded Studio, I use Crossworks, you can even use gcc from the command line. You're going to be doing some reading for a while.

    Get a dev kit, really, get a dev kit. Get the nRF51-DK or the nRF52-DK. Why have you picked nrf51822 by the way, the nrf52832 is out, available, more powerful, slightly less BOM required, very similar cost. The nrf51822 is a wonderful chip and if it's all you need ok, but at this point you should look at the nRF52 series for new designs.

    Why get a dev kit? First of all, they run all the examples nordic publishes in their SDK, all the bluetooth samples, all the device driver samples, this will save you about a billion years of time getting up to speed. Secondly they aren't very expensive. Thirdly they come with a Segger programmer built right into the board which will do debug out, ie you can use it to program your 3rd party board later, at least non-commercially. So you get a complete kit with buttons, LEDs, USB interface and a free Segger all for $40 which is designed to get you up to speed as soon as possible.

    If you are doing it non-commercially then Segger does sell the JLink EDU for about $60 (if I remember correctly). I have one, it's quite nice to have a standalone JLink although as I said the dev kit will act as a pass-through segger to program a custom board.

    You can use ST-Link with openocd, you can use the CMSIS-DAP adaptor Nguyen sells (his message above mine). Advantages of using Segger are that's what Nordic uses, that's what's built into their boards, if you use the free (again non-commercially free) Segger Embedded Studio to do your programming then that uses Segger of course. So if you can use Segger, use it, it's one more thing you don't have to fiddle with, it just works.

Related