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.

Parents
  • When NRF_LOG_DEFAULT_LEVEL set as 1, the compiled app uploaded to the device by OTA, the device didn't get start. I don't know how to catch the logs.

  • Hi,

    The example should print out the logs over RTT. Use J-link RTT viewer to view the logs.

    regards

    Jared 

  • 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.

  • 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.

  • Hi Cynthia, 
    Could you provide us the userbootloader code that we can test here ? 

    Could you please clarify: 

    - If you only change the advertising name (nothing else) the original bootloader works ? 

    - If you add a timer in nrf_bootloader_dfu_timers the bootloader stopped working ? 

    If it's the case please provide the code you added to the nrf_bootloader_dfu_timers ()

    Have you tried to step in the code in image_copy() and checked what's wrong ? 

Reply
  • Hi Cynthia, 
    Could you provide us the userbootloader code that we can test here ? 

    Could you please clarify: 

    - If you only change the advertising name (nothing else) the original bootloader works ? 

    - If you add a timer in nrf_bootloader_dfu_timers the bootloader stopped working ? 

    If it's the case please provide the code you added to the nrf_bootloader_dfu_timers ()

    Have you tried to step in the code in image_copy() and checked what's wrong ? 

Children
  • Hi Hung,

    - I changed orginal bootloader's advertising name and NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED's value as 0 , It works .

    -  I added app timer based on original bootloader. I  changed nrf_bootloader.c and nrf_bootloader_dfu_timers.c as shown in attachment. 

    If I remove the external watchdog from the board, I dfu the app with user bootloader,It works. It seems also  have to do something with the external watchdog.

  • Hi Cynthia,

    I noticed that the WDT timeout is 100ms (?). This might be too short because the time to erase one page is 85ms. You may want to do a WDT feed right before the image_copy() is called. 

    Could you do a test by only doing LED blinking in your user timer handler ? So there is no WDT related activity and simply adding one extra timer. If this also crash, I can try to test here to reproduce and figure out what's wrong. 

    Have you tried to use the internal WDT ? Is the external WDT an obligation for your application ? 

  • Hi Cynthia, 

    Please let us know if you still have issue with the external WDT. 

Related