S145 SoftDevice for nRF54L15/nRF54L10/nRF54L05 API documentation 10.0.0
Loading...
Searching...
No Matches

◆ sd_flash_write()

uint32_t sd_flash_write ( uint32_t * p_dst,
uint32_t const * p_src,
uint32_t size )

#include <nrf_soc.h>

Flash Write.

Commands to write a buffer to flash

If the SoftDevice is enabled: This call initiates the flash access command, and its completion will be communicated to the application with exactly one of the following events:

If the SoftDevice is not enabled no event will be generated, and this call will return NRF_SUCCESS when the write has been completed

Note
  • This call takes control over the radio and the CPU during flash erase and write to make sure that they will not interfere with the flash access. This means that all interrupts will be blocked for a predictable time (depending on the NVMC specification in the device's Product Specification and the command parameters).
  • The data in the p_src buffer should not be modified before the NRF_EVT_FLASH_OPERATION_SUCCESS or the NRF_EVT_FLASH_OPERATION_ERROR have been received if the SoftDevice is enabled.
  • This call will make the SoftDevice trigger a hardfault when the page is written, if it is protected.
Parameters
[in]p_dstPointer to start of flash location to be written.
[in]p_srcPointer to buffer with data to be written.
[in]sizeNumber of 32-bit words to write.
Return values
NRF_ERROR_INVALID_STATEPower-fail comparator is enabled and a POFWARN event is pending.
NRF_ERROR_INVALID_ADDRTried to write to a non existing flash address, or p_dst or p_src was unaligned.
NRF_ERROR_BUSYThe previous command has not yet completed.
NRF_ERROR_INVALID_LENGTHSize was 0.
NRF_ERROR_FORBIDDENTried to write to an address outside the application flash area.
NRF_SUCCESSThe command was accepted.