Writing to Flash for Settings


Nick Glencross
 

Hello,

I'm having my first experiment with Settings backed by Flash, but not getting very far.

I have an nrf9160 Nordic board and my project file is the same as many of the examples:

CONFIG_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_FCB=y
CONFIG_SETTINGS_FCB=y

Unfortunately the initial call to settings_subsys_init() is dying.

***** MPU FAULT *****
  Data Access Violation
  MMFAR Address: 0xfa000
***** Hardware exception *****
Current thread ID = 0x20020140
Faulting instruction address = 0x41b62
Fatal fault in essential thread! Spinning...

I've traced the call through various functions, such as fcb_int, fcb_sector_hdr_init, fcb_flash_write, flash_area_write and finally flash_write.

The flash_write call is passed (0xfa000, 0x20020568, 8) which matches the address shown in the crash.

I've also experimented with settings_fcb_src, but still get the same exception.

Can anymore shed any light on why it is dying (I'm assuming that area isn't writable), and how I get a bit further?

Thanks,

Nick Glencross

Join users@lists.zephyrproject.org to automatically receive all group messages.