Hi, I'm trying to add buttonless dfu to my own application (unbonded). I have followed the tutorials listed below:
2, https://github.com/gamnes/nRF52832-buttonless-dfu-development-tutorial
3, https://rigado.zendesk.com/hc/en-us/articles/360025376053-Add-Nordic-DFU-to-a-SDK-Example
And I'm able to run the sample code, ble_app_buttonless_dfu.
However, when I tried to add the sample code into my own application, the code doesn't work. Here are the things I have done:
1, I tried to add bottonless dfu into ble_app_uart sample code.
2, copy necessary c files and headers and paths from ble_app_buttonless_dfu into ble_app_uart.
3, Add the following to the Preprocessor definitions
Fullscreen12BL_SETTINGS_ACCESS_ONLYNRF_DFU_TRANSPORT_BLE=1
4, modify the options and open sdk_config.hFullscreen123#define BLE_DFU_ENABLED 1#define NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY 1#define NRF_SDH_BLE_SERVICE_CHANGED 1
5, add the following code into main.c file:Fullscreen123456789101112131415161718192021static void ble_dfu_buttonless_evt_handler(ble_dfu_buttonless_evt_type_t event){...}static bool app_shutdown_handler(nrf_pwr_mgmt_evt_t event){...}NRF_PWR_MGMT_HANDLER_REGISTER(app_shutdown_handler, 0);static void services_init(void){...ble_dfu_buttonless_init_t dfus_init ={.evt_handler = ble_dfu_buttonless_evt_handler};err_code = ble_dfu_buttonless_init(&dfus_init);APP_ERROR_CHECK(err_code);}
6, generate the setting.hex file for bootloader.
7, flash the merged bootloader, softdevice, setting and application hex files into the chip.
Then, I got the code stuck at advertising_init() in the main() function.
I thought it might be the starting address problem of the RAM. Then, I modify it according to ble_app_buttonless_dfu:Fullscreen12345678FLASH_PH_START=0x0FLASH_PH_SIZE=0x80000RAM_PH_START=0x20000000RAM_PH_SIZE=0x10000FLASH_START=0x26000FLASH_SIZE=0x52000RAM_START=0x20002228RAM_SIZE=0xddd8
Then I got in the RTT Viewer,Fullscreen12345670> <info> app: Setting vector table to bootloader: 0x000780000> <info> app: Setting vector table to main app: 0x000260000> <warning> nrf_sdh_ble: Insufficient RAM allocated for the SoftDevice.0> <warning> nrf_sdh_ble: Change the RAM start location from 0x20002228 to 0x20002A98.0> <warning> nrf_sdh_ble: Maximum RAM size for application is 0xD568.0> <error> nrf_sdh_ble: sd_ble_enable() returned NRF_ERROR_NO_MEM.0> <error> app: Fatal error
Does anybody know what's the problem here?