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

NRF52832 boot loader flashing

Hi,

We are going to use NRF52832 for a project, and planning to design our own PCB card and assemble the NRF52832 chips, purchased through Digikey or a similar distributor.

My question is, when we purchase sample chips from a distributor like Digikey,

1. do they come with a standard "bootloader" , or do we have to flash a bootloader?

2. for flashing the boot loader, what are the supported interfaces, software tools?

When it comes to the DFU modes, I am of the view that NRF52832 supports DFU over (a). serial and (b). over the air.

Are there any documentation that shows how to ,

1. setup the bootloader to support over the air DFU

2. setup the bootloader to support over the serial 

3. How to put the device into bootloader mode? (Reset button and a predefined button?)

At the moment, I am evaluating the functionality of the NRF52832 with a SparkFun breakout board, and I am of the view that their board has their own bootloader? Please advise.

If they do, then for me to flash their bootloader, what are the tools required? 

Thanks in advance,

Dinesh.

Parents
  • Hello Edvin,

    Thank you for your response. I was busy with some other work, so couldn't get back to you promptly.

    Well, this is the scenario at hand.

    1. I have a set of custom PCB boards with nRF52832 mounted on them. Their SWD port pins are exposed.

    2. I have a NRF52-DK board

    3. I have installed the nrfjprog command line program on my windows PC.

    4. I have the custom hex files for the bootloader and the softdevice , which I downloaded from the SparkFun site.

    I would like to know the following.

    1. In order for me to program the softdevice + bootloader on to the new PCB, how should I setup the boards?

    I am under the impression that, the custom boards SWDIO/SWDCLK/RESET/3V3/GND should be connected to the NRF52-DK boards

    single raw 8 pin connectors SWDIO/SWDCLK/RESET/VTG/GND pins. 

    Do I have to separately power my custom NRF52832 board? Or the SWD port will give the power to my board?

    Do I have to merge the 2 files together and program one hex file, or can I just first program the softdevice.hex file and then the booltader?

    2. Then I connect the NRF52-DK to my Windows PC where the nrfjprog utility is installed. 

    Provided, I have the bootloader.hex and softdevice.hex files, please advise how I should program my custom board which has

    an on board NRF52832 chip.

    ./nrfjprog -e -f nrf52

    ./nrfjprog --program  softdevice.hex -f nrf52

    ./nrfjprog --program bootloader.hex -f nrf52

    ./nrfjprog --reset -f nrf52

    Are the above steps correct? Or am I missing something?

    Note : I am under the impression that, NRF52-DK has an on-board NRF52x chip. So when you us the nrfjprog util, how do you make sure

    that you are programming the external chip, instead of the nrf52x chip on the NRF52-DK board?

    Also, I couldn't find the schematics for the NRF52-DK. If the schematics is available, please advise me from where I can download the same. Thanks.

    Finally, it would make sense for NRF community to publish a bootloader + softdevice hex files, for a given reference design, and the users

    then can easily use the utils to program the bootloader and make use of the reference design to customize to their own needs, without spending so much time on customizing bootloaders and softdevices etc. Just a thought.

    I would like to hear back from you soon.

    Thanks.

    Dinesh.

  • Hello Dinesh,

    1.

    In order to program the custom PCB, you can use the Debug Out port on the DK, or an external programmer. Please see the figure from the user "Remi" in this post. You need to apply power, like in the figure from his answer. VTG and GND Detect does not supply power. They are used to check whether an external device is connected to the debugger, so power needs to be supplied from GND and VDD. 

    You don't need to merge the files. You can program the softdevice first, and then the bootloader. No problem.

    2.

     

    DineshB said:

    ./nrfjprog -e -f nrf52

    ./nrfjprog --program  softdevice.hex -f nrf52

    ./nrfjprog --program bootloader.hex -f nrf52

    ./nrfjprog --reset -f nrf52

    Are the above steps correct? Or am I missing something?

     That is correct. 

     

    DineshB said:
    Note : I am under the impression that, NRF52-DK has an on-board NRF52x chip. So when you us the nrfjprog util, how do you make sure

     That is correct. But if you connect VTG and GND DETECT to another nRF chip, and it is powered, it will detect the external device and program that one instead. 

     

    DineshB said:
    Also, I couldn't find the schematics for the NRF52-DK. If the schematics is available, please advise me from where I can download the same. Thanks.

     That can be found in the first link in this reply. I am not sure exactly what schematics you are looking for, but you should find it on www.infocenter.nordicsemi.com. Let me know if there is something you struggle to find.

    BR,

    Edvin

Reply
  • Hello Dinesh,

    1.

    In order to program the custom PCB, you can use the Debug Out port on the DK, or an external programmer. Please see the figure from the user "Remi" in this post. You need to apply power, like in the figure from his answer. VTG and GND Detect does not supply power. They are used to check whether an external device is connected to the debugger, so power needs to be supplied from GND and VDD. 

    You don't need to merge the files. You can program the softdevice first, and then the bootloader. No problem.

    2.

     

    DineshB said:

    ./nrfjprog -e -f nrf52

    ./nrfjprog --program  softdevice.hex -f nrf52

    ./nrfjprog --program bootloader.hex -f nrf52

    ./nrfjprog --reset -f nrf52

    Are the above steps correct? Or am I missing something?

     That is correct. 

     

    DineshB said:
    Note : I am under the impression that, NRF52-DK has an on-board NRF52x chip. So when you us the nrfjprog util, how do you make sure

     That is correct. But if you connect VTG and GND DETECT to another nRF chip, and it is powered, it will detect the external device and program that one instead. 

     

    DineshB said:
    Also, I couldn't find the schematics for the NRF52-DK. If the schematics is available, please advise me from where I can download the same. Thanks.

     That can be found in the first link in this reply. I am not sure exactly what schematics you are looking for, but you should find it on www.infocenter.nordicsemi.com. Let me know if there is something you struggle to find.

    BR,

    Edvin

Children
  • Hello Edvin,

    Thank you for taking the time to explain the procedure.

    During the weekend, I did manage to program the bootloader on to a 3rd party board with NRF52832 (over SWD port) and also verify the same by changing some pin assignments to make sure the changes are reflected.

    The DFU mode that I compiled supports over the serial programming. However, I would like to investigate and start working on over the air (BLE) dfu mode, where I can program the soc through the BLE. If you have any links that you can refer, please advise me. I believe, first I  have to load a bootloader that supports OTA dfu, and then install some app on an android device or on a PC (which has attached BLE device) to deploy the app with OTA facility. 

    Looking forward to hearing back from you soon.

    Thanks.

    regards,

    Dinesh.

  • I suggest that you check out the "DFU Getting Started Guide" link from my first reply. It contains guidance on all your questions here. OTA DFU, how to perform the dfu using nRF Connect for Android/iOS. 

Related