2019-11-08 06:50 AM
Looking for the either code examples (possibly simplified for understanding), or a guide for Bluetooth server implementation on a Nucleo STM32WB55 board for data reception and transmission.
The sample demo for purchased P-Nucleo STM32WB55 pack (board and dongle) with switching LED was tested and works fine. However, it's code does not seem to make it clear at all.
2019-11-08 07:13 AM
Basically you need to call aci_gatt_add_char() with Char_Properties = CHAR_PROP_NOTIFY, to create characteristic , then aci_gatt_update_char_value() to transmit data from server.
To receive data you need to call aci_gatt_add_char() with Char_Properties = CHAR_PROP_READ, then register handler SVCCTL_RegisterSvcHandler(service_event_handler) (you better look for implementation of the handler in the sample demo). And finally in the service_event_handler you wait for EVT_BLUE_GATT_ATTRIBUTE_MODIFIED event with Attr_Handle == your_characteristic_handle + 1
These are basics. AN5270 can help. As well as Bluetooth Core Specification
2019-11-08 07:33 AM
I ment CHAR_PROP_WRITE, not CHAR_PROP_READ is needed to recieve data
2019-11-08 07:42 AM
You could also make use of AN5289. It is roughly a description/guide of sample demo
2019-11-09 06:16 AM
Thank you for the response. But how do I initiate the Bluetooth on the WB55 board in the first place ? If using the STM32cubeMX / IDE, i assume the corresponding code should be automatically generated by enabling the Connectivity->RF option (as for UART for exmaple). RF activation, however, returns "Warning: stm32cubemx does not support the configuration of this mode of this ip. However, this IP can be configured manually.", generates empty MX_RF_Init() function in the main code and ends there.
2019-11-09 06:45 AM
Yes, that's confusing. You need to activate Connectivity->RF so that RF pin is configured properly. To generate BLE code you need to activate Middlewares->STMWPAN. And I recommend you to activate P2P_server in STMWPAN settings. At least until you figure out how to make everything work.
2019-11-11 03:38 AM
Okey, so BT is being activated in STMWPAN mode. Apparently it is using several side source files called in APPE_Init(); function. (BT requires functions of the Sequencer and LPM, which by default are not being recognized (app_ble and app_entry are missing the corresponding SEQ and LPM functions - solved by moving sequencer and lpm source and header files from Utility folder to Core->Src and Inc accordingly).
Wierd happens when the code is being build, debugged and uploaded without any errors, but apparently crashes somewhere inside the APPE_Init() function after running on a board - process is either not returning from the APPE_Init function, or stops right after. Board itself doesn't show up for another BT devices either. What may be an issue in this case ?
2019-11-11 03:52 AM
Moving files is not a wise desision. If you are using TrueStudio or CubeIDE the best way is:
That will create a link to the library folder and your project will be more flexible in case of library update
You also need to add an include path Project->Properties->C/C++ general->Includes->Add
2019-11-11 03:56 AM
Read this article to enable sending debug info from board to PC