This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

when set NRF_LOG_DEFAULT_LEVEL as 1 in sdk_config.h, OTA failed

I am using nRF52840 development software based on ble_app_uart_c, and I found that when I set NRF_LOG_DEFAULT_LEVEL as 1, if I download the software by Segger, the device worked well.  If I updated the software by OTA, the devcie cannot start.  If I set NRF_LOG_DEFAULT_LEVEL  as 3, updating the software by OTA, the device worked well.

  • Hi Cynthia, 

    I'm taking over the case from Jared as it's more of a DFU case  . 

    Could you give me more information about your SDK version ? Also the board/IC version. Are you testing on a DK ? 

    If you try doing DFU with an unmodified bootloader do you see the same issue ? 

    Also could you you explain a little bit about the log, I can find that there are quite a lot of WDT feed before the actual activity in main. Have you made sure the WDT is fed when the bootloader started ? 

    From what I can see in the log, the assert happened inside app_activate()  , most likely inside image_copy() function. 

    I would suggest to use the _debug version of the bootloader and put a breakpoint inside app_activate() and step through the code. 

  • Hi Hung,

    Thanks for your reply.

    1. I'm developing bootloader on  pca10056_s140_ble_debug. I'm using SDK16 + nRF52840. PCA10056+s140. I'm testing  on our borad.

    2. I did DFU with SDK bootloader only changing NRF_DFU_BLE_ADV_NAME, I didn't see the same issue.

    3. There is a extern WDT on our board. Initialy I want to add a app timer to feed the extern WDT and control a green LED and a blue LED to flash in cycle, but it failed. So I open inner wdt , and added code in wdt_feed()  function of nrf_bootloader_wdt.c to feed  extern wdt and control the two LED flash.

    Could you give me any advice about how to add an app timer ?

    Thanks in advance.

  • Hi Cynthia, 

    At point 2, you meant if you test with unmodified bootloader example you don't see the issue and you can complete the DFU update without any issue ? 

    Which modification did you add to the bootloader besides the external WDT handling ? If you remove the external WDT handling would it work ? 

    Regarding the app timer, the bootloader has its own timer library called nrf_bootloader_dfu_timers.c You can find how the mp_wdt_feed and mp_inactivity is defined in the file. You can add your own timer in by modifying m_timers[]. Note that each timer occupy one CC register and with nRF52840 you have max 4 CC registers.

  • OriginBootloader_LOG_LEVE_1-J-Link RTT Viewer_logs.logoriginBootloader-loglevel-1-Log 2022-03-22 14_45_30.txtUSERBootloader_LOG_LEVE_1-J-Link RTT Viewer_logs.loguserbootloader-loglevel-1-Log 2022-03-22 14_48_57.txt

    Hi Hung,

    I added timer in nrf_bootloader_dfu_timers.c, after DFU, the device can't start.  The failed log file show in USERBootloader- . This test's done with my bootloader.  The successful log file show in orginBootloader-. This test's done with sdk bootloader only ADV name is changed.

Related