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

DFU not working from application

Hi, I loaded S110 v8 to nrf51. Then I loaded dfu_dual_bank_ble_s110_pca10028 bootloader.

With this setup, I'm able to download my application via the bootloader.

The problem is: When I trigger bootloader from my application, it almost immediately resets back to my application.

I examined that the bootloader is launched (main function of dfu_dual_bank_ble_s110_pca10028) with NRF_POWER->GPREGRET = 0xB1 which is correct.

bootloader_dfu_start() function in bootloader is called however, something inside the function causes reset almost immediatelly after the function is entered.

Can you please help?

Bootloader project: dual_bank_ble_s110.zip

  • So, my final finding is that my whole problem is caused by app_pwm module I use in my application. When I don't call functions: app_pwm_enable(), app_pwm_channel_duty_set() in my application, then bootloader works all the time. When I call either function then updating my applicaton from bootloader triggered from application ends with freezed bootloader. Then when I do power cycle, I can see DfuTarg device advertising. Then after dfu timeout I can my newly updated application running. However, after another power cycle, dfu runs again. Please provide information how to use app_pwm module in conjuction with bootloader. Obviously, calling app_pwm_disable and app_pwm_uninit in reset_prepare() of main.c file isn't sufficient. This doesn't solve my issue.

  • So, OK, I added these lines: NRF_TIMER1->TASKS_STOP = 1; NRF_TIMER1->TASKS_SHUTDOWN=1; NRF_TIMER1->EVENTS_COMPARE[0]=0; NRF_TIMER1->EVENTS_COMPARE[1]=0; NRF_TIMER1->EVENTS_COMPARE[2]=0; NRF_TIMER1->EVENTS_COMPARE[3]=0; NVIC_DisableIRQ(TIMER1_IRQn); in reset_prepare() function in my application. Then it seems I'm more or less able to update my application (bootloader launched from application). Can you please explain why I have to do this and why the app_pwm's disable/uninit functions don't care of this? Is that documented anywhere?

Related