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

Programming custom NRF52832 board using SWD interface

Hello NRF,

I have a custom board with NRF52832, and exposed the SWDIO, SWDCLK, GND, VDD, RESET pins for programming the board through the NRF52-DK board.

I started with a sample peripheral_uart, connected the NRF52-DK board to my PC, and managed to BUILD and RUN the sample application.

I verified that the app is working, by connecting to the UART service advertised by this app (on NRF52-DK) through another device that has NRF-TOOLBOX and used the UART service to query the NRF UART (NRF52-DK board) and managed to read write and verified the same over the console.

Now, I want to program my custom board, instead of the NRF52-DK board. Based on some suggestions on this site, I connected the

NRF52-DK        CUSTOM_BOARD

SWDIO             SWDIO

SWDCLK          SWDCLK

GND-DET         GND

VTG                 VDD/3V3

I then powered my board and then tried the BUILD and RUN option on the SEGGER.

It seems like my custom board is not getting programmed.

I would like to know : 

1. Do I have to first program a bootloader on to my custom board. If so, please advise a boot loader that I can download from your site (if possible) and the steps to program the same on to my custom board.

2. How to program the compiled/build binary/hex files on to my custom card? Just BUILD and RUN would download the binary on to the connected custom board, instead of the NRF52-DK board? (because my custom board is connected through the SWD port and GND detected?) If BUILD and RUN wouldn't work, where can I find the compiled binary or hex file where I can program the same on to the custom board , perhaps by using command line nrfjprog tool???

3. I believe the peripheral_uart has it's pin definitions, for the RX, TX, LEDs etc. Since my custom board pin assignments might be different from that of the NRF52-DK, where can I find these definitions, so I can go map the pins?

All I need is to demonstrate this peripheral_uart app on my custom nrf52832 board, where I will connect a serial port on to its RX/TX to a putty terminal (on my pc) and then able to rx/tx data back and forth with the other connected device (NRF toolbox -> UART).

I appreciate your help in this regard.

regards,

Dinesh.

Parents
  • Hi

    I'm not suggesting to edit the NRF52DK board file, but rather make your own custom board file for your custom board, where the TX/RX pins used in HW are set in this board file. Yes, they are "just" pin assignments, but in our example projects we call these defines so that they are used by the project as well. See the RX_PIN_NUMBER and TX_PIN_NUMBER calls in the UART peripheral example for instance, which are called from the board file used in your project.

    Best regards,

    Simon

  • Hello Simon,

    Could you kindly advise me the location of the NRF52DK board file for the peripheral_uart project? I am using the nRF Connect -> Tool Chain -> IDE and then I open File -> nRF Connect SDK project and choose the project and the hardware (board), in this case NRF52DK_NRF52832. 

    The sparkfun breakout board's connections are as follows.

    1. Reset pin <pin 21>

    2. LED pin <pin 07> 

    3. Push button <pin 06>

    4. RX pin <pin 26>

    5 Tx pin <pin 27>

    All the other pins are left open and are not connected anywhere. What would be the minimum set of requirement on the NRF52DK board, when it is running the peripheral_uart sample project? I believe, it requires Reset pin, LED, push button, serial port (perhaps with RTS/CTS??). My understanding is, that, if I change these pin assignments, then the peripheral_uart app should work on the Sparkfun breakout board as well. So kindly advise me, where I can find this definition file for the nRF Connect SDK projects.

    Also, I think when I was trying these options, I BRICKED a couple of my sparkfun boards (where they are not responding through the nrfjtool when I try to erase them and reflash the bootloader) through the NRF52DK SWD port.

    Is there a utility / method to get these bricked boards working now?

    Your help is much appreciated.

    Thanks.

    regards,

    Dinesh.

Reply
  • Hello Simon,

    Could you kindly advise me the location of the NRF52DK board file for the peripheral_uart project? I am using the nRF Connect -> Tool Chain -> IDE and then I open File -> nRF Connect SDK project and choose the project and the hardware (board), in this case NRF52DK_NRF52832. 

    The sparkfun breakout board's connections are as follows.

    1. Reset pin <pin 21>

    2. LED pin <pin 07> 

    3. Push button <pin 06>

    4. RX pin <pin 26>

    5 Tx pin <pin 27>

    All the other pins are left open and are not connected anywhere. What would be the minimum set of requirement on the NRF52DK board, when it is running the peripheral_uart sample project? I believe, it requires Reset pin, LED, push button, serial port (perhaps with RTS/CTS??). My understanding is, that, if I change these pin assignments, then the peripheral_uart app should work on the Sparkfun breakout board as well. So kindly advise me, where I can find this definition file for the nRF Connect SDK projects.

    Also, I think when I was trying these options, I BRICKED a couple of my sparkfun boards (where they are not responding through the nrfjtool when I try to erase them and reflash the bootloader) through the NRF52DK SWD port.

    Is there a utility / method to get these bricked boards working now?

    Your help is much appreciated.

    Thanks.

    regards,

    Dinesh.

Children
Related