Skip to content
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

Support for Bare metal/single task/thread #950

Open
amitv87 opened this issue Mar 25, 2021 · 1 comment
Open

Support for Bare metal/single task/thread #950

amitv87 opened this issue Mar 25, 2021 · 1 comment

Comments

@amitv87
Copy link

amitv87 commented Mar 25, 2021

Multi task environment for simple applications like beacon/eddystone is kind of overkill and increases ROM/RAM requirements.
Also porting the lib to some new OS becomes challenging when time is scarce.

I would love to have an option to run the entire host stack in single task/thread (similar to LWIP in NO_SYS mode).
Here is the pseudo code that I am after.

int main(){
  AppInit();                                  // initialize system
  NimbleHostInit(conf, transport, callbacks); // initialize nimble host

  while (true) {
    AppTask();    // handle all system operations here
    NimbleTask(); // handle all nimble host operations here like read from/write to transport
  }
  return 0;
}
@sjanc
Copy link
Contributor

sjanc commented Apr 13, 2022

Currently we don't have any plans for bare metal support in NimBLE host, but I don't see a reason to block this if anyone is willing to work on that.

BTW upcoming Nimble 1.5 release have much improved ram/rom usage when unused BLE roles are disabled.
Eg this is for advertiser sample app (beacon):

FLASH RAM
9990 1518 @apache-mynewt-nimble_nimble_controller.a
3372 710 @apache-mynewt-nimble_nimble_drivers_nrf51.a
8522 1153 @apache-mynewt-nimble_nimble_host.a
80 32 @apache-mynewt-nimble_nimble_host_services_gap.a
599 5596 @apache-mynewt-nimble_nimble_transport.a

And you should be able to tune it further down as this is using stack's defaults for transport buffers...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants