-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SRAM not sufficient when building BT Mesh developer guide build on BBC Micro-bit #21833
Comments
CC @jhedberg |
I think you'll need to look at the app's build configuration (prj.conf probably) to see what you can fine-tune. Perhaps some thread stack size can be reduced, buffer sizes shrunk or number of buffers reduced. Yet another option is to use the same Zephyr version that the developer guide was originally created for, which I believe is 1.14. @bluetooth-mdw do you think you'd be able to help out here? |
Hi, the current release of the SIG's Bluetooth Mesh Developer Study Guide is based on V1.12 of the Zephyr SDK. If you take a look at page 6 of the Coding Exercises Introduction document, you'll see that it says this. Try checking out V1.12 and you should be OK. FYI I have created version 2.0 of this educational resource and it is based on v1.14 of Zephyr which contains a Bluetooth qualified implementation of Zephyr. This release is currently in review and so will hopefully be released quite soon. Micro:bit is no longer used however, due to its very limited amount of memory. I'll announce the availability of the new version via my Twitter account (@bluetooth-mdw). Hope this helps. |
@bluetooth-mdw Thanks for the help. |
OK, that's good to hear :-) |
@bluetooth-mdw But when I place the biinary of Light along with the compiled code of Switch it is working fine but when I compile Light and flash then the switch+Light combo is not working... I mean Did I miss anything over here? |
You'll need those debug options enabled to find out what the problem is. Could be SEQ value reuse, for example. Change the source address of your switch node to check for this. But really, you need to see what the stack is doing and I'm afraid the only way to do that is to switch on appropriate debug options. |
p.s. you can replace the micro:bit DAPLink firmware with JLink using the instructions at https://www.segger.com/products/debug-probes/j-link/models/other-j-links/bbc-microbit-j-link-upgrade/. You can then use Nordic command line tool nrfjprog -e to completely erase the device and start again. You'll need to reinstall the microbit firmware (see https://microbit.org/guide/firmware/) to have it mount as a USB mass storage device again. |
@bluetooth-mdw Meanwhile I tried to upgrade the firmware as mentioned above but this doesnt help as the compiled code is crossing 16KB of SRAM. Can I move any of the code to some other memory to fit SRAM? |
Hi, I just tested and had no SRAM problems. Are you sure you are using the 1.12 version of the Zephyr SDK? And the solution projects as packaged include the following debug options already:
Here's what I did. First I had to regress my Zephyr source to 1.12. So from within my zephyr source directory, I ran:
There have been some environment variable changes since 1.12 so you have to make a couple of manual environment variable changes so that your environment is in line with the requirements of this version of Zephyr:
Then, to build and install:
And with a micro:bit plugged into a USB port, I used Windows Device Manager to find out what port it had been assigned, connected to it using Putty and as expected, saw this:
So if you have your 1.12 environment set up correctly, you should be able to build and install with some debug options set and then watch what happens when you send a message. I've just chased my reviewer on the ETA for the new release of our mesh developer study guide. That release will get it onto an LTS version of Zephyr. Hope this helps. |
@bluetooth-mdw |
OK, well I'm afraid there's not much I can do to help you as things stand then. I haven't attempted to upgrade to Zephyr 2.0 yet so I don't know what the issues are. 1.14 is my preferred release because it has LTS status and a qualified Bluetooth stack. |
Ok, I will give a try with zephyr 1.12 or 1.14, Once it works I can think about what is causing issue with zephyr 2.0 :) Thanks for the support. |
Sounds like a good plan :-) |
@bluetooth-mdw I could able to successfully run the mesh switch using 1.12v of zephyr, But the latest looks like has some issue configuring MESH |
Configuration is performed from within code. This is explained in the documentation. FYI V2.0 of the Bluetooth Mesh Developer Study Guide should be available for download some time this week. It does not use micro:bit anymore, however. |
The Mesh study guide is not part of Zephyr, but we will investigate the recent bloat of the BLE functionality to get things running on the micro;bit again. |
The Bluetooth SIG mesh developer study guide V2.0 has since been released and now uses Nordic Thingy devices with Zephyr 1.14. But it would be nice to make sure micro:bit continues to be an option, albeit without the ability to support proper provisioning and configuration, which afaik has never been possible with so little memory. |
When trying to compile sample Mesh code downloaded from BT website(BT Mesh developer guide), I am getting following compilation error...
zephyr version I am using is "Zephyr version: 2.0.99"
Memory region Used Size Region Size %age Used
FLASH: 96550 B 256 KB 36.83%
SRAM: 17528 B 16 KB 106.98%
IDT_LIST: 152 B 2 KB 7.42/home/user/zephyr-sdk-0.10.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/8.3.0/../../../../arm-zephyr-eabi/bin/ld: zephyr/zephyr_prebuilt.elf section
datas' will not fit in region
SRAM'The text was updated successfully, but these errors were encountered: