Re: [EXT] [Zephyr-users] Writing to Flash for Settings


Nick Glencross
 

Hello Maureen,

Thank you! That did the trick. I don't think I'd ever have worked that out without your help,

Nick


On Mon, 29 Apr 2019 at 18:37, Maureen Helm <maureen.helm@...> wrote:

Hi Nick,

You need to set:

CONFIG_MPU_ALLOW_FLASH_WRITE=y

 

Maureen

 

From: users@... <users@...> On Behalf Of Nick Glencross via Lists.Zephyrproject.Org
Sent: Monday, April 29, 2019 2:37 AM
To: users@...
Cc: users@...
Subject: [EXT] [Zephyr-users] Writing to Flash for Settings

 

Caution: EXT Email

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.