Hi guys,
I try to integrate the flash logger backend.
When I run the code I get the following error:
<error> nrf_fstorage: addr_is_within_bounds(p_fs, dest, len) check failed in nrf_fstorage_write() with value 0x10.
This is the sdk_config section
//========================================================== // <e> NRF_LOG_BACKEND_FLASH_ENABLED - nrf_log_backend_flash - Log flash backend //========================================================== #ifndef NRF_LOG_BACKEND_FLASH_ENABLED #define NRF_LOG_BACKEND_FLASH_ENABLED 1 #endif // <e> NRF_LOG_BACKEND_FLASHLOG_ENABLED - Enable flashlog backend. //========================================================== #ifndef NRF_LOG_BACKEND_FLASHLOG_ENABLED #define NRF_LOG_BACKEND_FLASHLOG_ENABLED 1 #endif // <o> NRF_LOG_BACKEND_FLASHLOG_QUEUE_SIZE - Logger messages queue size. // <i> Queue holds log messages pending to be written to flash. // <i> Note that the queue holds logger messages and thus the queue size determines // <i> increasing the pool of logger messages (see log message pool configuration). #ifndef NRF_LOG_BACKEND_FLASHLOG_QUEUE_SIZE #define NRF_LOG_BACKEND_FLASHLOG_QUEUE_SIZE 8 #endif // </e> // <e> NRF_LOG_BACKEND_CRASHLOG_ENABLED - Enable crashlog backend. //========================================================== #ifndef NRF_LOG_BACKEND_CRASHLOG_ENABLED #define NRF_LOG_BACKEND_CRASHLOG_ENABLED 1 #endif // <o> NRF_LOG_BACKEND_CRASHLOG_FIFO_SIZE - Number of log messages held to be flushed in panic. // <i> Crashlog FIFO always keeps a defined number of the most // <i> recent logs (severity level is set on runtime). // <i> Note that the FIFO holds logger messages and thus the FIFO size determines // <i> increasing the pool of logger messages (see log message pool configuration). #ifndef NRF_LOG_BACKEND_CRASHLOG_FIFO_SIZE #define NRF_LOG_BACKEND_CRASHLOG_FIFO_SIZE 8 #endif // </e> // <o> NRF_LOG_BACKEND_FLASH_SER_BUFFER_SIZE - Size of the buffer used for serialize log message. // <i> Message is trimmed if it is longer. It may happen in case of // <i> hexdump message. Buffer size must be multiple of 4. #ifndef NRF_LOG_BACKEND_FLASH_SER_BUFFER_SIZE #define NRF_LOG_BACKEND_FLASH_SER_BUFFER_SIZE 64 #endif // <h> Flash log location - Configuration of flash area used for storing the logs. //========================================================== // <o> NRF_LOG_BACKEND_FLASH_START_PAGE - Starting page. // <i> If 0, then pages directly after the application are used. #ifndef NRF_LOG_BACKEND_FLASH_START_PAGE #define NRF_LOG_BACKEND_FLASH_START_PAGE 0 #endif // <o> NRF_LOG_BACKEND_PAGES - Number of pages. #ifndef NRF_LOG_BACKEND_PAGES #define NRF_LOG_BACKEND_PAGES 1 #endif // </h> //========================================================== // </e>
This is my flashlog init function:
void flashlog_init(void) { ret_code_t ret; int32_t backend_id; ret = nrf_log_backend_flash_init(&nrf_fstorage_sd); APP_ERROR_CHECK(ret); backend_id = nrf_log_backend_add(&m_flash_log_backend, NRF_LOG_SEVERITY_WARNING); APP_ERROR_CHECK_BOOL(backend_id >= 0); backend_id = nrf_log_backend_add(&m_crash_log_backend, NRF_LOG_SEVERITY_INFO); APP_ERROR_CHECK_BOOL(backend_id >= 0); nrf_log_backend_enable(&m_flash_log_backend); nrf_log_backend_enable(&m_crash_log_backend); }
The error returns from nrf_fstorage_write() when calling the NRF_FSTORAGE_PARAM_CHECK(addr_is_within_bounds(p_fs, dest, len), NRF_ERROR_INVALID_ADDR)
What am I missing?