nRF5 SDK v15.2.0
Modules | Data Structures | Macros | Functions | Variables
Flash logger backend

Flash logger backend. More...


 Log flash backend configuration

Data Structures

struct  nrf_log_backend_flashlog_t
 Flashlog logger backend structure. More...
struct  nrf_log_backend_crashlog_t
 Crashlog logger backend structure. More...


#define NRF_LOG_BACKEND_FLASHLOG_DEF(_name)   NRF_LOG_BACKEND_DEF(_name, nrf_log_backend_flashlog_api, NULL)
 Macro for creating an instance of the flashlog logger backend.
#define NRF_LOG_BACKEND_CRASHLOG_DEF(_name)   NRF_LOG_BACKEND_DEF(_name, nrf_log_backend_crashlog_api, NULL)
 Macro for creating an instance of the crashlog logger backend.


ret_code_t nrf_log_backend_flash_init (nrf_fstorage_api_t const *p_fs_api)
 Function for initializing the flash logger backend. More...
ret_code_t nrf_log_backend_flash_next_entry_get (uint32_t *p_token, nrf_log_header_t **pp_header, uint8_t **pp_data)
 Function for getting a log entry stored in flash. More...
ret_code_t nrf_log_backend_flash_erase (void)
 Function for erasing flash area dedicated for the flash logger backend.


const nrf_log_backend_api_t nrf_log_backend_flashlog_api
 Flashlog logger backend API.
const nrf_log_backend_api_t nrf_log_backend_crashlog_api
 Crashlog logger backend API.

Detailed Description

Flash logger backend.

Function Documentation

ret_code_t nrf_log_backend_flash_init ( nrf_fstorage_api_t const *  p_fs_api)

Function for initializing the flash logger backend.

Flash logger backend consists of two logical backends: flashlog and crashlog. Since both backends write to the same flash area, the initialization is common.

p_fs_apifstorage API to be used.
NRF_SUCCESS or error code returned by nrf_fstorage_init.
ret_code_t nrf_log_backend_flash_next_entry_get ( uint32_t *  p_token,
nrf_log_header_t **  pp_header,
uint8_t **  pp_data 

Function for getting a log entry stored in flash.

Log messages stored in flash can be read one by one starting from the oldest one.

[in,out]p_tokenToken reused between consecutive readings of log entries. Token must be set to 0 to read the first entry.
[out]pp_headerPointer to the entry header.
[out]pp_dataPointer to the data part of the entry (arguments or data in case of hexdump).
Return values
NRF_SUCCESSEntry was successfully read.
NRF_ERROR_NOT_SUPPORTEDfstorage API does not support direct reading.
NRF_ERROR_NOT_FOUNDEntry not found. Last entry was already reached or area is empty.

Documentation feedback | Developer Zone | Subscribe | Updated