PUREmodules‎ > ‎

How to Create and Flash a DFU package to a CoreModule

This tutorial will cover a couple of topics:
    1-Building an NRF52 project from the SDK. 
    2-Steps to convert the application into a .zip distribution package
    3-How to DFU from a smartphone to the CoreModule.

1- Building an NRF52 project from the SDK. 
    For this example we will be flashing the blinky project provided by the NRF52 SDK. The first step is to build the project. 
    1.1- For steps on setting up the necessary tools (GCC, MinGW) follow this tutorial. 
    1.2- For steps on setting up the Nordic NRF52 SDK follow this tutorial. 

    1.3- Open a command terminal and navigate to the Blinky Project in the NRF52 SDK. Using:                    >cd [YourDirectory]\PUREmodules\nrf52\nRF5_SDK_12.2.0_f012efa\examples\peripheral\blinky\pca10040\s132\armgcc
 Note: Pictures contain paths on my computer. Just replace "Users/Michael/Desktop/" with your directory for the PureModules repo. 

    1.4- Run make command 

2- Create a zip distribution package from the built application

    2.1- Create public key. 
        -It is important that the zip package you build has the same key as the one we have flashed to the CoreModule. Here are the steps for getting the correct public key. Our private key is located in the Puremodules/nrf52 folder.  

        > nrfutil keys display --key pk --format code ../../../../../../../private.pem --out_file dfu_public_key.c

       -This will create a dfu_public_key file as shown below. 

    2.2- Create zip distribution package. 
        -We want to create a distribution package that also contains the Bootloader so that you can continue to wirelessly re-flashing the board. 

    2.2.1- Create a Settings.hex file

    > nrfutil settings generate --family NRF52 --application nrf52832_xxaa.hex --application-version 3 --bootloader-version 2 --bl-settings-version 1 settings.hex

    2.2.2-  Combine Softdevice with Bootloader