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

How to program custom PCB uisng SWCLK AND SWDIO TEST PINS

Hello Everyone,

I have deveoped my custom Board using(NRF51) which has four test pins VCC GND SWCLK,SWDIO. I would like to program the custom board. So could anyone tell me some safe methods to load the software on the PCB? Previously i have used NRF51DK and USB cable JLINK to flash the software on the development board, but i reckon to use only SWCLK AND SWDIO pins to flash the custom PCB. What are the methods I should follow to flash the softdevice110 and the .hex file? Please suggest me some possible methods to flash the custom PCB. It would be really helpful for me. Do I need to connect like in this picture? Please correct me if i am wrong.

image description

Thank you

  • Almost - right connections but not the best connector. P20 is debug out but it's the one for a connected shield. What you really want to connect to is P19, which is the real debug out. I suppose, if the pins on P20 are easier to connect to than the P19 .5" pitch debug out connector you can use them, but it's probably better to use P19 if you can. I use a breakout adaptor which makes patching that connector to just about anything fairly easy.

  • could you tell me how can i check the putty terminal (serial emulator to see the funvtionality of NRF51 custom board because previously i have used NRF51DK to test the sfotware it works fine but now i would like to check each and every functions of the custom board by using putty terminal (UART) using printf statements could you suggest what would be best methods to follow inorder to check the output

  • you should really ask separate questions for things which are totally separate questions.

    Just hook the test board's UART output pins up to P.08-P.11 on the nRF-DK you are using as a programmer, and make sure whatever the NRF-DK is running isn't using those pins too, then you can use the on-board USB serial to talk to the test board.

    If you haven't routed any more pins out, then you can't do this because you have nothing to connect.

    There are however SO many better ways than the ancient, troublesome UART for getting information out of a connected board. Since you're connected via the SWD interface, why not use SEGGER RTT which travels over the same pins, requires no extra connections nor a UART, UART-USB bridge and a terminal program on the PC.

  • do you mean i have to connect P0.08 ofNRF51DK to P0.08of my custom PCB ?and p0.11 to p0.11 inorder to see my printf statements

  • Doesn't have to be P08-P11 on your custom board, it can be any GPIOs you like, as long as you change the UART mapping to use them. But yes if you connect those pins to P.08-P11 on the DK and this is important make sure the DK itself is running something which DOES NOT USE THEM, ie a null piece of software which does nothing, then you should be able to use the USB-UART bridge on the DK with data from your custom board.

    If you use SEGGER RTT however, you don't have to do any of this stuff and can just use the SWDIO and SWDCLK you already have connected.

Related