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

nRF52810 DFU attempt #2

I'm trying to set up DFU for a custom board with a nRF52810 module (Rigado BMD-330).  I created the secure bootloader from the recent project for SDK 15 posted by Vidar Berg.  All seems to be working and I can connect to the DFUTARG.  The DFU download works .... once.  I discovered I need to add the buttonless DFU service to my application in order to  switch from the application back to the bootloader if I want to support multiple DFUs.

I started this task using the guidelines on the infocenter and with the buttonless DFU example, only to find I'm getting compile errors from nrf_dfu_types.h.  This is looking for  NRF52 defined or I get: #error "Architecture not set."  However, my application followed the PCA10040e path and does not use the NRF52 flag and also uses gcc_startup_nrf52810.S and system_nrf52810.c versus gcc_startup_nrf52.S and system_nrf52.c ..... which seems the right thing to do for nRF52810 development and the app without DFU service is running nicely.   I attempted to add the NRF52 flag and as you might expect that resulted in linker errors.

I don't know how to resolve this ..... if it even can be resolved.  It seems rather ugly at this point. 

Any suggestions?  I know there's working example of nRF52810_S112 buttonless DFU service for SDK 14.2 but I'd like to stick with SDK 15 if possible.  I'd be happy to beta test a SDK 15 buttonless DFU service for the nRF52810. 

Thanks,  Max

 

  • Hi Max,

    Glad you found it helpful. You may also want to have a look at this blog post by Hung Bui here. Merging of settings page is explained in Appendix 1.

    Yes, Bank 0 code 0x1 indicates a valid application. Here is the settings structure for reference: http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/structnrf__dfu__settings__t.html   

  • I got everything working, but it wasn't easy.  I'll outline the steps below for anyone else struggling with this and maybe it will help.  The most significant hurdle was to eliminate the application preserve pages.  I do not think Nordic should have 3 pages of flash reserved for a nRF52810.  My final application size was around 55 KB using GCC and there was only 60 KB of flash left after loading the SoftDevice and the bootloader.

    Good work on the nRF52810 bootloader!  It seems to be running well.

    Development/Debug steps:

    1. Set up the existing application program to run on nRF52832 and the nRF52 DK.  For me, this required reconfiguring LEDs and an ADC channel.

    2. Merge the Buttonless DFU Service into the application.  Run with nRF52832 bootloader and S132 SoftDevice.  Use ble_app_buttonless_dfu SDK example for guidance on what to include in the program as well as how to set up the project or GCC Makefile.  Verify operation of everything (application and DFU Service) from nRF Connect.

    3. Migrate the project to a nRF52810 using the PCA10040e setup.  Run on the nRF52 DK with the nRF52810 bootloader and S112 SoftDevice.  Note that this will reduce the flash available significantly.  I found I had to set the application preserve pages in nrf_dfu_types.h to 0 using: #define DFU_APP_DATA_RESERVED               (CODE_PAGE_SIZE * 0).  Again, verify operation of everything (application and DFU Service) from nRF Connect.

    4. Migrate the project to the nRF52810 board.  Reconfigure peripherals and GPIO as required.  Use the PCA10040e config or Makefile to not have the DEVELOP_IN_NRF52832 setting.   Verify operation of everything (application and DFU Service) from nRF Connect.

    So far I've been using DFU to load the application.  I still have to figure out how to load the application directly to flash from either nRFgo Studio or nrfjprog, but I'm confident I can do that now that I have a working application.

    Thanks for the outstanding support with this.  I'll mark this as answered.  Much more testing to be done!

    Max

  • Thanks for the update. I agree, we shouldn't reserve 3 pages on the 52810, glad you noticed it.

    Vidar

Related