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

Moving advertisement and scan functions to RAM

Hi,

I am thinking of moving advertisement and scanning function execution to RAM to reduce the energy consumption since nRF device advertise in each 1 second interval(frequently executing). Is it possible to execute the advertisement and scan function in RAM instead of flash?

Below are my development environment.

SDK: 6.1 SD: S110 7.1.0 Nrf51822 : version 3.1 (RAM - ariant)

Regards, Anand

  • Hi Anand

    I want to clarify a few things. It is only selected application code that is possible to execute from RAM, i.e. that you specifically select. Softdevice operations must still execute from flash. When BLE advertising, you initialize the advertising parameters in the application by calling advertising_init() and then you start the advertising by calling ble_advertising_start() which calls the softdevice with sd_ble_gap_adv_start(). From there the softdevice will handle the advertsing and no application code is executed for that purpose. For example, if your advertising interval is 1 second, the softdevice will use the CPU once a second to transmit advertising packets over the air, but no application code is actually executed. So in the case of advertising, there is not much current consumption benefit of executing application code from RAM.

    This thread describes how to execute code from RAM when using Keil. I understand that you are using GCC. Did you get any progress on how to do this with GCC fromyour discussion with Håkon?

  • Hi Stefan,

    Thanks. As per your explanation I understood that ,advertisement and scan functions will always execute from flash only.

    Hakon helped me in executing code from RAM instead of flash. I should thank him also .

    Regards, Anand

Related