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

Flash usage

Hello,

I am currently evaluating the nrf52840 and nrf52832 for the purpose of bluetooth mesh. I found flash usage information in the mesh SDK documentation as follows: 

Build type: MinSizeRel (-Os), Logging: None

Flash usage (kB) RAM usage (kB) Example
79.296 8.672 Beaconing
79.608 8.964 DFU with serial interface
90.104 12.080 DFU without serial interface
90.820 11.504 EnOcean switch translator client
89.640 11.140 Light switch dimming client
93.860 11.200 Light switch dimming server
105.004 11.536 Low Power node
89.288 11.396 Light switch client
82.916 10.208 Light switch provisioner
89.208 10.940 Light switch server
79.644 9.352 PB-remote client
80.412 8.560 PB-remote server
76.928 11.016

Serial

Now, if I compile the Light switch server in Segger 4.12 I get the following flash and ram usage : 247.5KB / 24.7KB 


How were the numbers in the table achieved? 


Also, when doing a DFU over the air, how does it work? Let's say my binary running takes 200KB and I want to do a DFU over the air with another binary that takes 200KB. During the process does the full new image is stored in a different place of the flash and keep the present binary running until the new image is fully transfered?

Thank you in advance.

Parents
  • Hi Radu,

    What you see in the flash/ram usage when compiling is including the softdevice. If you compile using cmake you would see the actual size of the application. 

    In Project Common setting -> Linker-> Section Placement Macros you can find FLASH_START = 0x26000. This is the start address of the application. If you take the total size minus the start address of the application you will have the size of the application. Same applied for RAM. Please make sure you compile with Release version, not Debug one. 

    When doing DFU over the air, the bootloader will store the new image in the swap bank when keeping the application running. The full image will be store in the swap area. 

    It's possible to do single bank update with our bootloader. But then the application will be erased before the image being received, interrupting the normal operation of the network. 

Reply
  • Hi Radu,

    What you see in the flash/ram usage when compiling is including the softdevice. If you compile using cmake you would see the actual size of the application. 

    In Project Common setting -> Linker-> Section Placement Macros you can find FLASH_START = 0x26000. This is the start address of the application. If you take the total size minus the start address of the application you will have the size of the application. Same applied for RAM. Please make sure you compile with Release version, not Debug one. 

    When doing DFU over the air, the bootloader will store the new image in the swap bank when keeping the application running. The full image will be store in the swap area. 

    It's possible to do single bank update with our bootloader. But then the application will be erased before the image being received, interrupting the normal operation of the network. 

Children
  • Thank you for the reply. 

    I think I understand now. For this application to function proprely, it also needs to use the binary softdevice and the total combined is what I had in my first post. 

    Concerning DFU over the air, would I be able to update the application first in the swap bank, do the update and make sure it works, then update softdevices if there is ever a change to it also? I'm asking because this way it would require a smaller swap bank than updating everything at once (softdevice + app.)


    Thanks

  • Hi Radu,

    When you updating the softdevice and application, you need to update the softdevice first and then the application. What happens is that the new application may not work with the old softdevice so you can't verify that it works or not. The suggested process should be: softdevice -> bootloader -> application. 

Related