Hi, I'm having a bit of an issue with the proxy_enable() & proxy_start() functions when they are used in tandem with the flash manager module.
Some info on my setup:
- Softdevice S140 v6.1.0
- nRF52840
- Mesh SDK v3.1.0
- SDK v15.2.0
Description of the issue:
So I have been using a method of enabling/disabling the mesh for lower power consumption as outlined here:
The method is as follows (as suggested by Nordic):
//Disabling the mesh: uint32_t err_code = NRF_SUCCESS; err_code = proxy_stop(); if(err_code != NRF_SUCCESS) { __LOG(LOG_SRC_APP, LOG_LEVEL_INFO,"proxy_stop() ERROR: %d\r\n",err_code); APP_ERROR_CHECK(err_code); } err_code = nrf_mesh_disable(); if(err_code != NRF_SUCCESS) { __LOG(LOG_SRC_APP, LOG_LEVEL_INFO,"nrf_mesh_disable() ERROR: %d\r\n",err_code); APP_ERROR_CHECK(err_code); } //Enabling the mesh uint32_t err_code = NRF_SUCCESS; err_code = proxy_enable(); if(err_code != NRF_SUCCESS) { __LOG(LOG_SRC_APP, LOG_LEVEL_INFO,"proxy_enable() ERROR: %d\r\n",err_code); APP_ERROR_CHECK(err_code); } err_code = proxy_start(); if(err_code != NRF_SUCCESS) { __LOG(LOG_SRC_APP, LOG_LEVEL_INFO,"proxy_start() ERROR: %d\r\n",err_code); APP_ERROR_CHECK(err_code); } err_code = nrf_mesh_enable(); if(err_code != NRF_SUCCESS) { __LOG(LOG_SRC_APP, LOG_LEVEL_INFO,"nrf_mesh_enable() ERROR: %d\r\n",err_code); APP_ERROR_CHECK(err_code); }
Calling proxy_stop(); in this manner seems to be fine - the proxy is stopped and then the mesh is disabled. The device is then in its lowest power state.
When I try and re-enable the mesh one of the functions, either proxy_enable() or proxy_start() (not quite sure which as the call stack isn't clear) triggers an assert "Mesh assert at 0x00032DE8". From the call stack:
It seems there is some interference from the flash manager causing this behavior.
After a bit of digging around the forums, I find that this post mentions that the proxy stores some state info in flash:
https://devzone.nordicsemi.com/f/nordic-q-a/38915/mesh-2-2-0-clear-stack-config-data/150424#150424
(see Hung's post below).
I was wondering then what is the correct way to enable/disable the mesh and start/stop the proxy?
Any help or tips would be greatly appreciated.