Flash logger backend. More...
Modules |
|
| 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...
|
|
Macros |
|
| #define | NRF_LOG_BACKEND_FLASHLOG_DEF (name) |
|
Macro for creating an instance of the flashlog logger backend.
More...
|
|
| #define | NRF_LOG_BACKEND_CRASHLOG_DEF (name) |
|
Macro for creating an instance of the crashlog logger backend.
More...
|
|
Functions |
|
| 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.
|
|
Variables |
|
| 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.
Macro Definition Documentation
| #define NRF_LOG_BACKEND_CRASHLOG_DEF | ( | name | ) |
Value:
static
nrf_log_backend_crashlog_t
name = { \
.backend = {.
p_api
= &
nrf_log_backend_crashlog_api
}, \
}
Macro for creating an instance of the crashlog logger backend.
| #define NRF_LOG_BACKEND_FLASHLOG_DEF | ( | name | ) |
Value:
static
nrf_log_backend_flashlog_t
name = { \
.backend = {.
p_api
= &
nrf_log_backend_flashlog_api
}, \
}
Macro for creating an instance of the flashlog 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.
- Parameters
-
p_fs_api fstorage API to be used.
- Returns
- 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.
- Parameters
-
[in,out] p_token Token reused between consecutive readings of log entries. Token must be set to 0 to read the first entry. [out] pp_header Pointer to the entry header. [out] pp_data Pointer to the data part of the entry (arguments or data in case of hexdump).
- Return values
-
NRF_SUCCESS Entry was successfully read. NRF_ERROR_NOT_SUPPORTED fstorage API does not support direct reading. NRF_ERROR_NOT_FOUND Entry not found. Last entry was already reached or area is empty.