Functions |
|
| ret_code_t | nrf_bootloader_flash_protect (uint32_t address, uint32_t size, bool read_protect) |
|
Function for using hardware to protect flash from writing and reading.
More...
|
|
| void | nrf_bootloader_app_start (void) |
|
Function for starting another application (and aborting the current one).
More...
|
|
Detailed Description
Function Documentation
| void nrf_bootloader_app_start | ( | void | ) |
Function for starting another application (and aborting the current one).
This function uses the provided address to swap the stack pointer and then load the address of the reset handler to be executed. It checks the current system mode (thread/handler). If in thread mode, it resets into the other application. If in handler mode, isr_abort is executed to ensure that handler mode is left correctly. It then jumps into the reset handler of the other application.
- Note
- This function assumes the SoftDevice has not previously been initialized.
- This function will never return, but issues a reset into the provided application.
| ret_code_t nrf_bootloader_flash_protect | ( | uint32_t | address , |
| uint32_t | size , | ||
| bool | read_protect | ||
| ) |
Function for using hardware to protect flash from writing and reading.
This function will apply write/erase protection to a specific area. Read protection is optional, decided by
read_protect
. This function uses the BPROT or ACL peripheral, depending on which is available.
- Parameters
-
[in] address The start address of the area to protect. Must be a flash page boundary. [in] size The size of the area to protect, in bytes. Must be a multiple of flash page size. [in] read_protect Whether to protect the area from reading/executing as well. This is not available on chips with the BPROT peripheral (e.g. nrf52832, nrf52810).
- Return values
-
NRF_SUCCESS Flash protection applied successfully. NRF_ERROR_NO_MEM No more ACL instances to use for flash protection. NRF_ERROR_INVALID_PARAM Address was out of range or size was not a multiple of flash page size.