Embassy
nrf-softdevice-s132

Crates

git

Versions

default

Flavors

pub unsafe fn sd_flash_write(p_dst: *mut u32, p_src: *const u32, size: u32) -> u32
Expand description

@brief 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: - @ref NRF_EVT_FLASH_OPERATION_SUCCESS - The command was successfully completed. - @ref NRF_EVT_FLASH_OPERATION_ERROR - The command could not be started.

If the SoftDevice is not enabled no event will be generated, and this call will return @ref 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 @ref NRF_EVT_FLASH_OPERATION_SUCCESS or the @ref 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.

@param[in] p_dst Pointer to start of flash location to be written. @param[in] p_src Pointer to buffer with data to be written. @param[in] size Number of 32-bit words to write. Maximum size is the number of words in one flash page. See the device’s Product Specification for details.

@retval ::NRF_ERROR_INVALID_ADDR Tried to write to a non existing flash address, or p_dst or p_src was unaligned. @retval ::NRF_ERROR_BUSY The previous command has not yet completed. @retval ::NRF_ERROR_INVALID_LENGTH Size was 0, or higher than the maximum allowed size. @retval ::NRF_ERROR_FORBIDDEN Tried to write to an address outside the application flash area. @retval ::NRF_SUCCESS The command was accepted.