Dear all,
I took the FreeRTOS Wireless UART BLE example from the SDK as the base for a project. First, instead of starting the system with the "startup_task", I start the system with a task that serves as a command-line interface (CLI) to query the board via UART on PC.
After that, I turn on the BLE with a command by the CLI (this command starts the "startup_task" in the same way as it is in the raw example but with some things commented, like the SerialManager init because it is already initialized, etc.).
Next, I switch BLE off with another command (destroying all tasks, queues, events, etc. and de-initializing the things I see I can do so). The problem comes when I turn BLE on again; the problem is located in the AppMain.c file in the if condition:
/* BLE Host Stack Init */
if (Ble_Initialize(App_GenericCallback) != gBleSuccess_c)
{
panic(0,0,0,0);
return;
}
Instead "gBleSuccess_c" I got "gBleAlreadyInitialized_c" from Ble_Initialize as it is normal because it has been already initialized before. Looking inside Ble_Initialize, the one who returns "gBleAlreadyInitialized_c" is the Ble_HostInitialize function, found in the static library "lib_ble_4-2_host_cm0p.a"
Then I think about De-Initialize the Ble but I do not find the other function of Ble_HostInitialize() to undo its initialization.
As I have been working a lot of time on this project, I hope someone could help me to correctly switch BLE off, and then back on.
Does anyone know how could I De-Initialize the Ble with an opposite command to Ble_Initialize() or a workaround?
Thanks in advance,
David.