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

DFU Bootloader with S340 Softdevice

Hi, I learned how to replace the softdevice for a normal application. I've replaced 140 with 340 in my app. However I don't know to do that for the boolloader.

What I want to achieve is

- Have a BLE bootloader with S340

- Have my app on top, which will support the Buttonless DFU (next step)

For now I'm struggling to make the step 1 work. The example works when I use the S140, but when I replace with S340 it does not. I guess I don't have to change the the target addresses, because the bootloader goes to it's place no matter the softdevice, but what should be changed? Are there major differences between 140 and 340? I thought it was just an addition of ANT+? Maybe I just to need to midify some macros? 

Please help. Thanks

  • I have it compiled with debug and I use RTT. There's nothing there :(

  • Your application or the bootloader? You need to build the _debug version of the bootloader, which has RTT logging. I also suggest you disable RTT logging in the application (if you use it) while testing this, as if not you can get problems with the RTT viewer (it searches for a n RTT buffer in memory, and if it finds the RTT buffer from the application before the bootloader that will be used, even though the bootloader may have it's RTT buffer located at a different place in RAM).

  • Ok. But it does not get to the bootloader... I think. I mean it does the first time, when there is no app. Then I can connect to it and upload a zip with my app. Next when I connect to my app and try the DFU it reboots back to my app. I will check what you wrote though. Thanks

  • Ok. It's like I said. When I turn off logging in my app, I can see logs from the bootloader, but they only show when I start app. Then I try to "start the DFU" it goes "initializing" and restarts... but I'm no loonger sure it does, because the log is silent from the moment the app started the first time.

    The log from the first boot below:

    00> <info> app: Inside main
    00> 
    00> <debug> app: In nrf_bootloader_init
    00> 
    00> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    00> 
    00> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    00> 
    00> <debug> nrf_dfu_settings: Using settings page.
    00> 
    00> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    00> 
    00> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    00> 
    00> <info> nrf_dfu_settings: Backing up settings page to address 0xFE000.
    00> 
    00> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    00> 
    00> <debug> app: Enter nrf_bootloader_fw_activate
    00> 
    00> <info> app: No firmware to activate.
    00> 
    00> <debug> nrf_dfu_validation: CRC check of app failed. Return 1
    00> 
    00> <debug> app: App is valid
    00> 
    00> <info> nrf_dfu_settings: Backing up settings page to address 0xFE000.
    00> 
    00> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    00> 
    00> <debug> app: Running nrf_bootloader_app_start with address: 0x00001000
    00> 
    00> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    00> 

  • Hi,

    Good, then the bootloader is there and RTT logging is present in the bootloader and you should see it again after reset.

    Probably that does not occur, then. With that, I suggest going back to debugging you reapplication (enable RTT in the app for this to make it easier, and disable RTT logging in the bootloader). Is an error handler reached? Or what else happens when it is supposed to enter DFU mode? You should be able to see this from debugging, hopefully you should get much just from observing the log with a debug build.

Related