Topics

nrf51822 mesh example RAM constraints.

Antonio <anvivaldi27@...>
 

Hi All,

I was able finally to run basic mesh example on NRF51 device.
But I have an issue with RAM limits.
To be able to work with meshctl (Bluez) provisioning 
GATT_PROXY and PB_GATT should be enabled.
(It was not clear at first)
This leads to 128 bytes RAM overflow.
(NRF51822 has 256k Flash and 16k RAM)
I was able to temporary fix the issue reducing ISR stack from 640 to 512 bytes.
Bu as soon as my node receiving message (OnOff in my case) I have a HARD FAULT.

***** BOOTING ZEPHYR OS v1.11.99 - BUILD: Apr  9 2018 18:58:45 *****
Ver 1.06 ... Initializing...
 PB_GATT enabled
Bluetooth initialized
Mesh initialized
 * Prov complete.
***** HARD FAULT *****
  Executing thread ID (thread): 0x20001660
  Faulting instruction address:  0x20002880
Fatal fault in ISR! Spinning…



So the main question is:
Is it possible to tune some other parameters on CONFIG or remove some features to fit basic MESH example to NRF51 device?
Or should I forget about BLE Mesh on NRF51822 ?
Another idea is to hardcode provisioning information and forget about provisioning procedure at all,
But it is not the best way for real production setup.

Thank you.


Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...>
 

Hi Antonio,

Please take a look at this mail chain: https://lists.zephyrproject.org/g/devel/topic/16760883#1960

a BBC micro:bit with nRF51822 256KB flash and 16 KB RAM can support BLE mesh. Yes, it is stretch on a 16 KB RAM variant, but you can take a look at the output of “make rom_report” to fine tune/reduce RAM usages in your application.

Regards,
Vinayak

On 9 Apr 2018, at 21:27, Antonio <anvivaldi27@...> wrote:

Hi All,

I was able finally to run basic mesh example on NRF51 device.
But I have an issue with RAM limits.
To be able to work with meshctl (Bluez) provisioning 
GATT_PROXY and PB_GATT should be enabled.
(It was not clear at first)
This leads to 128 bytes RAM overflow.
(NRF51822 has 256k Flash and 16k RAM)
I was able to temporary fix the issue reducing ISR stack from 640 to 512 bytes.
Bu as soon as my node receiving message (OnOff in my case) I have a HARD FAULT.

***** BOOTING ZEPHYR OS v1.11.99 - BUILD: Apr  9 2018 18:58:45 *****
Ver 1.06 ... Initializing...
 PB_GATT enabled
Bluetooth initialized
Mesh initialized
 * Prov complete.
***** HARD FAULT *****
  Executing thread ID (thread): 0x20001660
  Faulting instruction address:  0x20002880
Fatal fault in ISR! Spinning…



So the main question is:
Is it possible to tune some other parameters on CONFIG or remove some features to fit basic MESH example to NRF51 device?
Or should I forget about BLE Mesh on NRF51822 ?
Another idea is to hardcode provisioning information and forget about provisioning procedure at all,
But it is not the best way for real production setup.

Thank you.



Antonio <anvivaldi27@...>
 


On Apr 9, 2018, at 23:08, Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...> wrote:

Hi Antonio,

Please take a look at this mail chain: https://lists.zephyrproject.org/g/devel/topic/16760883#1960

a BBC micro:bit with nRF51822 256KB flash and 16 KB RAM can support BLE mesh. Yes, it is stretch on a 16 KB RAM variant, but you can take a look at the output of “make rom_report” to fine tune/reduce RAM usages in your application.

Regards,
Vinayak


Thank you Vinayak,
Got it working after deleting health and level server.

Memory region         Used Size  Region Size  %age Used
           FLASH:      100376 B       256 KB     38.29%
            SRAM:       16264 B        16 KB     99.27%
        IDT_LIST:         132 B         2 KB      6.45%


But after adding support for LOW POWER feature got RAM overflow again…

Memory region         Used Size  Region Size  %age Used
           FLASH:      104320 B       256 KB     39.79%
            SRAM:       16424 B        16 KB    100.24%
        IDT_LIST:         132 B         2 KB      6.45

Since GATT (GATT_PROXY,PB_GATT,Peripherial) support is so memory hungry, can we use PB_ADV instead and do something like
remote provisioning ?


Is this feature supported ?
Trying to make something useful out of the NRF51, like a simple low power node mesh device.
But seems they are good only as a beacons for now ;(
Or perhaps someone can recommend the way to provision NRF51 node over the PB_ADV barrier ?

Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...>
 

But after adding support for LOW POWER feature got RAM overflow again…
Could you review the use of RADIO_LL_LENGTH_OCTETS_RX_MAX, just a suspicion that its incorrectly used on nRF51, if so, you could be saving few hundred bytes.

Do feel free to send a PR if you fix something.


-Vinayak



From: users@... [mailto:users@...] On Behalf Of Antonio
Sent: Tuesday, April 10, 2018 9:00 AM
To: users@...
Subject: Re: [Zephyr-users] nrf51822 mesh example RAM constraints.


On Apr 9, 2018, at 23:08, Chettimada, Vinayak Kariappa <mailto:vinayak.kariappa.chettimada@...> wrote:

Hi Antonio,

Please take a look at this mail chain: https://lists.zephyrproject.org/g/devel/topic/16760883#1960

a BBC micro:bit with nRF51822 256KB flash and 16 KB RAM can support BLE mesh. Yes, it is stretch on a 16 KB RAM variant, but you can take a look at the output of “make rom_report” to fine tune/reduce RAM usages in your application.

Regards,
Vinayak


Thank you Vinayak,
Got it working after deleting health and level server.

Memory region         Used Size  Region Size  %age Used
           FLASH:      100376 B       256 KB     38.29%
            SRAM:       16264 B        16 KB     99.27%
        IDT_LIST:         132 B         2 KB      6.45%


But after adding support for LOW POWER feature got RAM overflow again…

Memory region         Used Size  Region Size  %age Used
           FLASH:      104320 B       256 KB     39.79%
            SRAM:       16424 B        16 KB    100.24%
        IDT_LIST:         132 B         2 KB      6.45


Since GATT (GATT_PROXY,PB_GATT,Peripherial) support is so memory hungry, can we use PB_ADV instead and do something like
remote provisioning ?

https://infocenter.nordicsemi.com/index.jsp?topic=/com.nordic.infocenter.meshsdk.v0.9.1/group__PB__REMOTE.html
https://infocenter.nordicsemi.com/index.jsp?topic=/com.nordic.infocenter.meshsdk.v0.9.1/md_examples_pb_remote_client_README.html
https://infocenter.nordicsemi.com/index.jsp?topic=/com.nordic.infocenter.meshsdk.v0.9.1/md_examples_pb_remote_server_README.html

Is this feature supported ?
Trying to make something useful out of the NRF51, like a simple low power node mesh device.
But seems they are good only as a beacons for now ;(
Or perhaps someone can recommend the way to provision NRF51 node over the PB_ADV barrier ?