Skip to content

Commit 688c8a7

Browse files
tomchyrlubos
authored andcommitted
ram_pwrdn: Add API for powering up RAM
Add API that powers up dack sections, disabled by the power_down_unused_ram() API call. Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
1 parent 1e947e2 commit 688c8a7

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

doc/nrf/libraries/others/ram_pwrdn.rst

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The RAM power-down library is a basic module for disabling unused sections of RA
1111

1212
To disable unused RAM sections, call :c:func:`power_down_unused_ram`.
1313
This function will automatically disable all memory regions that are not used by the application.
14+
To enable back unused RAM sections, call :c:func:`power_up_unused_ram`.
1415

1516
.. note::
1617
:c:func:`power_down_unused_ram` powers down memory regions that are outside of the ``_image_ram_end`` boundary.

doc/nrf/releases/release-notes-changelog.rst

+4
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,10 @@ Bluetooth libraries and services
431431
* Serialization of the write callback applied to the GATT attribute.
432432
* Serialization of the :c:func:`bt_gatt_service_unregister` function call.
433433

434+
* :ref:`lib_ram_pwrdn`
435+
436+
* Added the :c:func:`power_up_unused_ram` API.
437+
434438
Modem libraries
435439
---------------
436440

include/ram_pwrdn.h

+7
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ void power_up_ram(uintptr_t start_address, uintptr_t end_address);
4848
*/
4949
void power_down_unused_ram(void);
5050

51+
/**
52+
* @brief Request powering up unused RAM sections.
53+
*
54+
* Power up RAM sections which were disabled by @ref power_down_unused_ram function.
55+
*/
56+
void power_up_unused_ram(void);
57+
5158
#ifdef __cplusplus
5259
}
5360
#endif

lib/ram_pwrdn/ram_pwrdn.c

+5
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ void power_down_unused_ram(void)
197197
power_down_ram(RAM_IMAGE_END_ADDR, ram_end_addr());
198198
}
199199

200+
void power_up_unused_ram(void)
201+
{
202+
power_up_ram(RAM_IMAGE_END_ADDR, ram_end_addr());
203+
}
204+
200205
#if CONFIG_RAM_POWER_ADJUST_ON_HEAP_RESIZE
201206

202207
static void libc_heap_resize_cb(uintptr_t heap_id, void *old_heap_end, void *new_heap_end)

0 commit comments

Comments
 (0)