Zephyr API 3.6.99
|
Abstraction layer to write firmware images to flash. More...
Data Structures | |
struct | flash_img_context |
struct | flash_img_check |
Structure for verify flash region integrity. More... | |
Functions | |
int | flash_img_init_id (struct flash_img_context *ctx, uint8_t area_id) |
Initialize context needed for writing the image to the flash. | |
int | flash_img_init (struct flash_img_context *ctx) |
Initialize context needed for writing the image to the flash. | |
size_t | flash_img_bytes_written (struct flash_img_context *ctx) |
Read number of bytes of the image written to the flash. | |
int | flash_img_buffered_write (struct flash_img_context *ctx, const uint8_t *data, size_t len, bool flush) |
Process input buffers to be written to the image slot 1. | |
int | flash_img_check (struct flash_img_context *ctx, const struct flash_img_check *fic, uint8_t area_id) |
Verify flash memory length bytes integrity from a flash area. | |
Abstraction layer to write firmware images to flash.
int flash_img_buffered_write | ( | struct flash_img_context * | ctx, |
const uint8_t * | data, | ||
size_t | len, | ||
bool | flush ) |
#include <zephyr/dfu/flash_img.h>
Process input buffers to be written to the image slot 1.
flash memory in single blocks. Will store remainder between calls.
A final call to this function with flush set to true will write out the remaining block buffer to flash. Since flash is written to in blocks, the contents of flash from the last byte written up to the next multiple of CONFIG_IMG_BLOCK_BUF_SIZE is padded with 0xff.
ctx | context |
data | data to write |
len | Number of bytes to write |
flush | when true this forces any buffered data to be written to flash |
size_t flash_img_bytes_written | ( | struct flash_img_context * | ctx | ) |
#include <zephyr/dfu/flash_img.h>
Read number of bytes of the image written to the flash.
ctx | context |
int flash_img_check | ( | struct flash_img_context * | ctx, |
const struct flash_img_check * | fic, | ||
uint8_t | area_id ) |
#include <zephyr/dfu/flash_img.h>
Verify flash memory length bytes integrity from a flash area.
The start point is indicated by an offset value.
The function is enabled via CONFIG_IMG_ENABLE_IMAGE_CHECK Kconfig options.
[in] | ctx | context. |
[in] | fic | flash img check data. |
[in] | area_id | flash area id of partition where the image should be verified. |
int flash_img_init | ( | struct flash_img_context * | ctx | ) |
#include <zephyr/dfu/flash_img.h>
Initialize context needed for writing the image to the flash.
ctx | context to be initialized |
int flash_img_init_id | ( | struct flash_img_context * | ctx, |
uint8_t | area_id ) |
#include <zephyr/dfu/flash_img.h>
Initialize context needed for writing the image to the flash.
ctx | context to be initialized |
area_id | flash area id of partition where the image should be written |