Page 1 of 1

Running BLE in xTaskCreate is not working

Posted: Tue Aug 01, 2017 2:55 pm
by san27deep
I am able to run, BLE on main thread. It is working perfectly.
But when I am trying to run it by creating as a one separate task it is giving me errors.

I want to ask, whether it is possible to run on task other than main thread?
If yes then what precautions we need to take. ? what is minimum stack space that we need to allocate.? or any specific priority that we need to give?

Re: Running BLE in xTaskCreate is not working

Posted: Tue Aug 01, 2017 4:24 pm
by kolban
It isn't clear what you mean by run BLE on a separate thread. In the ESP32 the BLE support is a set of APIs that can be called. I know of no restrictions that would constrain invoking BLE APIs from multiple threads. This has worked just fine for me.

You said you ran it and got errors ... but didn't spend time describing the nature of those errors.

I usually give a new task 20K of stack space (as a default) and haven't had any issues. Obviously the minimum stack space you need will be a function of what your application does and how it uses stack storage. It is like asking "how much paint do I need to paint my house" without knowing anything about your house.

I have not seen anything related to FreeRTOS task priority being an issue.

Re: Running BLE in xTaskCreate is not working

Posted: Tue Aug 01, 2017 4:27 pm
by BuddyCasino
Depends on which core you run it on. You can't do interrupts on both imho.