Re: [Bluetooth mesh]CONFIG_BT_PERIPHERAL, what does it mean?
Yes, I had to increate both stacks’ size, current configuration is:
CONFIG_MAIN_STACK_SIZE=640 (from 512)
CONFIG_BT_RX_STACK_SIZE=1450 (from 1100)
From: Chettimada, Vinayak Kariappa [mailto:vinayak.kariappa.chettimada@...]
Thanks Kai. Glad to know you have PB-GATT sans micro:bit display, working.
Did you have to increase the STACK_SIZE(s)? if so, which ones?
I followed your instruction to disable some features above Bluetooth core spec v4.0, like 4.1, 4.2 and 5.0 as follow:
With this kind of configuration, there are 56 bytes saving, but it’s still not enough for me to squeeze the firmware into RAM. In order to make it happen, made some changes:
After above configuration, the RAM usage is 99.32% and I can:
Thank you for the help!
From: "Chettimada, Vinayak Kariappa" <vinayak.kariappa.chettimada@...>
As the faulting instruction address is in RAM, I suspect an overflow of some thread call stack. The PB-GATT may not have been tested on micro:bit due to restricted amount of RAM.
But, please review the Kconfig option for the controller (me being the maintainer of controller) in menuconfig and disable any options that will not be needed for your usecase, like disabling 4.1 and above features and reducing any buffer counts.
That said, please increase these:
… provided you can find some free RAM space!
Thank you for the proposal, I've tested it.
I copied microbit_gatt.conf and reduced CONFIG_BT_L2CAP_TX_BUF_COUNT to 2, RAM usage is 99.93%, which can make it fit micro:bit RAM size, but when I use BlueZ to provision it, after OOB output on micro:bit, it seems to be corrupted, a HARD FAULT as below.
OOB Number: 549
***** HARD FAULT *****
Executing thread ID (thread): 0x20001670
Faulting instruction address: 0x200014dc
Fatal fault in ISR! Spinning...
I guess that there may be two causes:
So, I have a question that can I enable optimization level for source code compiling? I had used Keil or IAR, their GUI support to configure optimization level, but how can I configure it on Zephyr? I hope it may save some valuable bytes in RAM of micro:bit.
On 22/03/2018, 11:39 PM, "Johan Hedberg" <johan.hedberg@...> wrote:
On Thu, Mar 22, 2018, Kai Ren wrote:
> I’m try to run ./sample/Bluetooth/mesh/ on micro:bit, I found that
> current source code for micro:bit just support PB-ADV, don’t support
> PB-GATT. So, I want to add PB-GATT on it, but I found that it’s really
> hard to pass the build process because it runs out of RAM if I
> modified prj_bbc_microbit.conf.
> Meanwhile, I also found that there is a configuration flag,
> CONFIG_BT_PERIPHERAL, it consumes about 2KB RAM when I enable it, so
> I’m just curious that what function does this flag provide? And is it
> necessary for PB-GATT on micro:bit? Thanks!
There's actually a samples/bluetooth/mesh/microbit_gatt.conf
configuration that's intended to be used for a GATT-based build of the
mesh sample. That said, I just tried it and it actually overflows the
RAM by 300 bytes. That's much less than 2k however, and hopefully easily
to fix. Looking into it now. It might e.g. be possible that the
CONFIG_BT_L2CAP_TX_BUF_COUNT=5 variable can be lowered since there was
recently an extra segmentation buffer introduced for outgoing ACL
Note: you can select microbit_gatt.conf e.g. by passing the following
to cmake: -DCONF_FILE=microbit_gatt.conf