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

DFU sdk 12.2.0 (s130) nrf51822 QxxAA

can i use dfu secure bootloder for nrf51822 QxxAA ? if yes please help me how ?

  • yes you can. just change RAM settings to 16KB instead of the default 32KB.

  • Hi Mohsen, In order to compile the Secure bootloader for a nRF51 variant with 16kB RAM you need to adjust the size of the RAM section and lower the RAM start address.

    The SoftDevice returns the application ram base address in the app_ram_base parameter given to sd_ble_enable. Thus, if you debug the Secure Bootloader and set a breakpoint after sd_ble_enable and add a watch to app_ram_base, you will see that the application RAM start address can be set to 0x200025E0 and the size can be set to 0x1A20.

    If your using GCC, you need to modify the secure_dfu_gcc_nrf51.ld (linker script) and modify the RAM section to

    RAM (rwx) :  ORIGIN = 0x200025E0, LENGTH = 0x1A20
    

    If you're using Keil, then you need to edit the memory settings under "Options for target", see the screenshot below

    image description

    Best regards

    Bjørn

  • Unfortunatelly it doesn't solve my problem. Bootloader and my app works fine on NRF51-DK. Now I'm porting it to QFAA chip with 16KB of RAM. In my case was required to set IRAM1 0x200025F0 : 0x1A10. Bootloader works in QFAA chip, I am able to send new firmware over nrfConnect but new app doesn't start. After firmware upgrade it's again in bootloader. Bootloader logs attached. Another problem that I see logs only when #define NRF_LOG_DEFERRED 0. If I set #define NRF_LOG_DEFERRED 1 logs are silent boot_log.txt

  • Interesting.

    I am at about the same stage as you are.

    It took me a while to find the original post about changing the RAM size, and I posted asking that the SDK or docs be updated to show the correct amount of RAM so it worked on both QFAC and QFAA.

    But I have not had time to actually upload any code.

    One thing I read however, ( and I now cant find a link to it on this site), was that if I want to still upload via the debugger, is that some compile settings need to be changed. Possibly the flash start address

    And I dont know whether its also necessary to change those settings for the OTA upload

  • I think no need to change application start address. Because it's always located above softdevice. For bootloader (In my opinion) we can set start address as small as possible. When I start experiments I set bootloacer start addres 0x3ACO00 and size 0x5000. When I enable loggin this size was insuficcent and I change start address to 0x37C00 and size 0x8000

Related