This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

flashlog error: "nrf_fstorage addr_is_within_bounds(p_fs, dest, len) check failed in nrf_fstorage_write() with value 0x10"

I'm migrating a project from SDK 14.2.0 to SDK 15.3.0, using gcc. I only just got it to link and flash. I'm using the RTT logging and the flashlog. The RTT logging is working.

On the RTT terminal output, I'm seeing these errors as soon as I've init'ed the logging:

E nrf_fstorage addr_is_within_bounds(p_fs, dest, len) check failed in nrf_fstorage_write() with value 0x10.

E nrf_fstorage addr_is_within_bounds(p_fs, dest, len) check failed in nrf_fstorage_write() with value 0x10.

E nrf_fstorage addr_is_within_bounds(p_fs, dest, len) check failed in nrf_fstorage_write() with value 0x10.

E nrf_fstorage addr_is_within_bounds(p_fs, dest, len) check failed in nrf_fstorage_write() with value 0x10.

E nrf_fstorage addr_is_within_bounds(p_fs, dest, len) check failed in nrf_fstorage_write() with value 0x10.

E nrf_fstorage addr_is_within_bounds(p_fs, dest, len) check failed in nrf_fstorage_write() with value 0x10.

And I'm ending up in the hardfault handler:

Program received signal SIGTRAP, Trace/breakpoint trap.

0x0003d176 in nrf_log_backend_panic_set (p_backend=0xff) at /usr/local/nRF5_SDK_15.3.0_59ac345/components/libraries/log/nrf_log_backend_interface.h:230

230     p_backend->p_api->panic_set(p_backend);

(gdb) bt full

#0  0x0003d176 in nrf_log_backend_panic_set (p_backend=0xff) at /usr/local/nRF5_SDK_15.3.0_59ac345/components/libraries/log/nrf_log_backend_interface.h:230

No locals.

#1  0x0003dd30 in nrf_log_panic () at /usr/local/nRF5_SDK_15.3.0_59ac345/components/libraries/log/src/nrf_log_frontend.c:978

        p_backend = 0xff

#2  0x0004156c in HardFault_c_handler (p_stack_address=0x0) at /usr/local/nRF5_SDK_15.3.0_59ac345/components/libraries/hardfault/hardfault_implementation.c:65

        p_stack = 0x0

        cfsr_msgs = {0x4f254 "The processor has attempted to execute an undefined instruction", 0x4f294 "The processor attempted a load or store at a location that does not permit the operation",

          0x0, 0x4f2f0 "Unstack for an exception return has caused one or more access violations", 0x4f33c "Stacking for an exception entry has caused one or more access violations",

          0x4f388 "A MemManage fault occurred during floating-point lazy state preservation", 0x0, 0x0, 0x4f3d4 "Instruction bus error",

          0x4f3ec "Data bus error (PC value stacked for the exception return points to the instruction that caused the fault)",

          0x4f458 "Data bus error (return address in the stack frame is not related to the instruction that caused the error)",

          0x4f4c4 "Unstack for an exception return has caused one or more BusFaults", 0x4f508 "Stacking for an exception entry has caused one or more BusFaults",

          0x4f54c "A bus fault occurred during floating-point lazy state preservation", 0x0, 0x0, 0x4f254 "The processor has attempted to execute an undefined instruction",

          0x4f590 "The processor has attempted to execute an instruction that makes illegal use of the EPSR",

          0x4f5ec "The processor has attempted an illegal load of EXC_RETURN to the PC, as a result of an invalid context, or an invalid EXC_RETURN value",

          0x4f674 "The processor has attempted to access a coprocessor", 0x0, 0x0, 0x0, 0x0, 0x4f6a8 "The processor has made an unaligned memory access",

          0x4f6dc "The processor has executed an SDIV or UDIV instruction with a divisor of 0"}

        cfsr = 0

#3  <signal handler called>

No symbol table info available.

#4  0xc9d4f298 in ?? ()

No symbol table info available.

#5  0x5e55f7de in ?? ()

No symbol table info available.

Backtrace stopped: previous frame identical to this frame (corrupt stack?)

I have this in my app_config.h:

#define NRF_LOG_BACKEND_FLASH_START_PAGE 0

However, I also use the example bootloader (the secure one). And I noticed this in nrf_bootloader.c:

#if defined(NRF_LOG_BACKEND_FLASH_START_PAGE)
STATIC_ASSERT(NRF_LOG_BACKEND_FLASH_START_PAGE != 0,
"If nrf_log flash backend is used it cannot use space after code because it would collide with settings page.");
#endif

And yet I'm not hitting that static assert when building.

Does it sound wrong that I'm seeing 0x10 in the errors above?

Related