Re: Questions on the BLE mesh example

Johan Hedberg

Hi Jehudi,

On Tue, Jul 25, 2017, Laczen JMS wrote:
I am working on a smartlight based upon zephyr and would like to add the
mesh functionality. I have some questions regarding the mesh_demo example:

1. Is the mesh_demo example able to work over power cycling ? I cannot find
any reference to storing the IV index in flash so I guess if the power
stays off long enough the device can no longer be part of the mesh.
Currently the persistent flash storage is something that's left as the
responsibility of the application. Eventually, there will be proper
integrated support for this, but I'd wait for some better file system
support first (something better than FAT12, e.g. NFFS that's being
worked on).

2. In the mesh_demo example the microbit.c file contains two routines:
board_seq_update(u32_t seq) and get_seq(void). I can't figure out what
these routines are for and why SEQ_PER_BIT, SEQ_PAGE and SEQ_MAX are
This was implemented before there was proper co-existence with flash
access and the Bluetooth radio (these need to be coordinated on nRF5x
due to flash halting the CPU for a substantial period of time). What the
code essentially does is it avoids doing a flash erase as long as
possible by clearing one bit at a time to indicate the progression of
the sequence number.o

Now that flash access is properly coordinated with radio access (at
least I think those patches were merged) this kind of "hack" shouldn't
be necessary anymore.


Join { to automatically receive all group messages.