Mistake on this page?
Report an issue in GitHub or email us

ScopedRamExecutionLock

ScopedRamExecutionLock class hierarchy

The ScopedRamExecutionLock class provides an RAII object for enabling execution from RAM. In other words, creating a ScopedRamExecutionLock object calls its constructor, which increments the RAM execution lock. The ScopedRamExecutionLock object automatically releases the RAM execution lock in its destructor when the object goes out of scope. Another way to look at this is when the ScopedRamExecutionLock object exists, it allows execution from RAM.

ScopedRamExecutionLock class reference

Public Member Functions
 ScopedRamExecutionLock ()
 Allow execution from RAM. More...
 ~ScopedRamExecutionLock ()
 Restore previous execution from RAM settings. More...

Example

This example shows how you can enable execution from RAM from main:

/*
 * Copyright (c) 2006-2020 Arm Limited and affiliates.
 * SPDX-License-Identifier: Apache-2.0
 */
#include "mbed.h"

int main()
{
    // Enable execution from RAM while in main
    ScopedRamExecutionLock make_ram_executable;

    //some_function_in_ram();
}

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.