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

Program nRF52832, without the development board

I am looking ahead to the time when I will graduate from using the nRF52 development board to building a custom device with the SoC. The PCA10036 chip will obviously not be on our custom board. We will need to program our device. I expect we will include a USB to UART chip to transfer data.

Reading through the nRF52832 specification sheet, it would appear that the UART is routed through GPIO pins. Which ones? There must be a default configuration on boot-up in order to get data into the on-board flash memory.

What is the protocol for programming the flash without the PCA10036 chip? I know how to do it with JLink, but I expect that JLink won't work without the PCA10036.

Last question: is it possible, through carelessness, to assign the UART pins to another function?

Parents
  • You can't really use a USB/UART chip to program the module from scratch because there's no code on the nRF52 out of the factory to accept programming over serial. Programming over serial is a facility provided by a bootloader you write and put onto the chip in the first place, which then allows you to write new firmware to the chip.

    So no there is no default configuration on bootup to do anything. A blank chip is a blank chip, it does nothing at all.

    Once you put a bootloader on it however you can choose any pins you like for the UART, the hardware files for the PCA10038 show you which ones are used by that design, but you can use any which are conveniently located on your board.

    To get the initial code on the chip it needs to be programmed through the debug, SWD, interface. So you need to put a header or bed of nails pads on the design, connected to the SWD pins and then use an external programmer, like a JLink or gang programmer or whatever your design/build house uses, to program it.

    Your comment "expect that JLink won't work without the PCA10036" is a bit confusing. The PCA10036 includes an nRF52 chip and a chip which is both a USB/UART and a JLink, the JLink piece is connected on the board to the SWD interface, and externally the USB drives it. That's no different from having an entirely separate JLink connected to the SWD interface, no magic on the PCA10036, just an integrated solution.

    It's possible, through carelessness, to pretty much do anything, including assigning the UART pins to something else, so don't do that.

  • (annoyed that comments are restricted to 900 characters) .. continuing ...

    usually production boards are initially programmed via a few pads on the board which an external debugger/programmer connects to, you don't need a JLink or equivalent on the board. If you want to make DFU available then serial is a good (and fairly cheap) way to do that, if you don't need to, you don't need it for anything else. Since you have a BLE chip on the board, you can do over the air DFU as well. Since I don't know your boss I have no idea why he specified a UART/USB :). I hope it's clear now that you don't need USB/SWD either, you just need a place an external programmer can attach once to put the initial software on the chip.

Reply
  • (annoyed that comments are restricted to 900 characters) .. continuing ...

    usually production boards are initially programmed via a few pads on the board which an external debugger/programmer connects to, you don't need a JLink or equivalent on the board. If you want to make DFU available then serial is a good (and fairly cheap) way to do that, if you don't need to, you don't need it for anything else. Since you have a BLE chip on the board, you can do over the air DFU as well. Since I don't know your boss I have no idea why he specified a UART/USB :). I hope it's clear now that you don't need USB/SWD either, you just need a place an external programmer can attach once to put the initial software on the chip.

Children
No Data
Related