The project of demonstration is
[Application] Nrf51_sdk_10.0.0_dc26b5e\examples\ble_peripheral\ble_app_hrs\pca10028\s110_with_dfu
[Bootload] nrf51_sdk_10.0.0_dc26b5e\examples\dfu\bootloader\pca10028\dual_bank_ble_s110
[Softdevice] Nrf51_sdk_10.0.0_dc26b5e\components\softdevice\s110\hex\s110_nrf51_8.0.0_softdevice.hex
1, first sassafras except
2. Download Softdevice
3. Open the Bootload project and compile the download
Need to be aware of where to modify bootloader
If you use Nrf51822_xxac (256kb-flash,32kb-ram)
If you use NRF51822_XXAA (256kb-flash,16kb-ram)
From the official forum
Follow the above steps in the options ... window, click on the "Utilities" tab, arguments a column--family nRF51--program "#H"
4, now return to our BLE_APP_HRS\PCA10028\S110_WITH_DFU Compile Download
5, in the mobile app can see
6. Use the script to generate the zip used by the upgrade
This hex file uses hex files for the ble_app_hrs project.
Generate_application_bin. The bat script is as follows:
@echo off set /Pfile_name=%file_name%%file_name%0xFFFFFFFF0xffff 0xFFFF 0xFFFE del Application.hexpause
View Code
Send this zip file to your phone and then upgrade it on your phone
After the program is burned, the product defaults to the DFU mode, to make the product into normal mode, one way is to perform an update. The second method is to modify the Bootloder project.
Now we will explain the method two:
Modified in the Bootload project
1 #ifDefined (__cc_arm)2uint8_t M_boot_settings[code_page_size] __attribute__ ((at (bootloader_settings_address))) __attribute__ ((used));/**< This variable reserves a codepage for bootloader specific settings, to ensure the compiler doesn ' t locate any CO De or variables at he location. */3uint32_t m_uicr_bootloader_start_address __attribute__ ((at (nrf_uicr_boot_start_address))) = BOOTLOADER_REGION_ START;/**< This variable ensures the linker script would write the bootloader start address to the UICR register. This value would be written in the HEX file and thus written to UICR when the bootloader was flashed into the chip. */4 #elifDefined (__gnuc__)5__ATTRIBUTE__ (Section (". Bootloadersettings"))) uint8_t M_boot_settings[code_page_size];/**< This variable reserves a codepage for bootloader specific settings, to ensure the compiler doesn ' t locate any CO De or variables at he location. */6__ATTRIBUTE__ (Section (". Uicrbootstartaddress")))volatileuint32_t m_uicr_bootloader_start_address = Bootloader_region_start;/**< This variable ensures the linker script would write the bootloader start address to the UICR register. This value would be written in the HEX file and thus written to UICR when the bootloader was flashed into the chip. */7 #elifDefined (__iccarm__)8__no_init uint8_t M_boot_settings[code_page_size] @0x0003fc00;/**< This variable reserves a codepage for bootloader specific settings, to ensure the compiler doesn ' t locate any CO De or variables at he location. */9__rootConstuint32_t m_uicr_bootloader_start_address @0x10001014= Bootloader_region_start;/**< This variable ensures the linker script would write the bootloader start address to the UICR register. This value would be written in the HEX file and thus written to UICR when the bootloader was flashed into the chip. */Ten #endif
Replace line 2nd with the revised
uint8_t M_boot_settings[code_page_size] __attribute__ ((at (bootloader_settings_address))) __attribute__ ((used) ) = {Bank_valid_app};
Official forum
https://devzone.nordicsemi.com/question/60745/nrfgo-studio-and-bootloader-programming/
Compile and download after modification
In order to distinguish it from the previous app, we will modify the name and compile the download
This time we saw the device name in the phone
For more information, refer to https://devzone.nordicsemi.com/blogs/685/common-faq-on-dfu/
NRF51822 's DFU use mobile upgrade