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

nRF51822 controller connection through UART/SWD.

I need to program the nrf51 controller directly from PC. How to connect nRF51822 controller from PC through UART/SWD pins to program.

Parents Reply Children
  • Hi,

     

    You need to translate the SWD interface and the UART interface to something the PC understands. For SWD a J-Link debugger is typically used, other SWD debuggers can be used but you might experience various incompatibility with our other tools. For UART any UART to USB translator can be used.

    nRF51-DK comes with an on-board J-Link debugger and UART translator combo MCU for easy interfacing. Furthermore it is 100% supported with all our tools. If you do not have any debugger or UART translator I recommend getting your hands on a nRF51-DK, or even nRF52-DK (compatible with external nRF51 boards).

     

    The setup is the same though, you need to connect SWD as explained below to the debugger, no matter which debugger is used, and UART RXD->TXD and TXD->RXD no matter which translator is used.

     

    Best regards,

    Andreas

  • Thanks for the reply.

    In nRF51 DK board will it support UART connection for programming even if we bypass the connection of MCU and try direct programming form pc to nRF controller.

  • Hi,

     

    There is a nRF51822 on the DK itself which you will need to disconnect from the UART lines in order to use UART with your external nRF51822 board. Or you can just remove the power supply for the on-DK nRF51822, there are solder bridges for easy cutting of all relevant lines.

    For programming of the external board SWD will be used, this can be done in parallel with the nRF51822 on the DK.

     

    Best regards,

    Andreas

  • The thing is if i have the nRF51 DK board can i program the nRF51822 controller which is on the DK board directly from PC using the nRF51822 UART pins and USB to UART converter.

    The interface MCU will be bypassed by cutting the soldering edge.

    Is it possible to do kindly reply or i need any other software or debugger to program the controller.

  • Hi,

     

    I am not quite sure I understand what you mean, but if you have a nRF51-DK you have all that you need to program/debug your nRF51822 board, and the nRF51822 IC that sits on the nRF51822. Some slight modifications might be needed on the DK in order to have the interface MCU communicate with the external nRF51822 over UART.

     

    The principle for both programming a nRF51822, and communicating with a nRF51822 over UART is the same, regardless if it is your custom PCB or a nRF51-DK. See this blog post for details. The difference is that on the DK, UART and SWD(for programming/debug) lines are hard-wired to the nRF51822 that is on the DK itself. If that NRF51822 sits in parallel with your custom board nRF51822 then the communication will be disrupted.

     

    Best regards,

    Andreas

Related