cancel
Showing results for 
Search instead for 
Did you mean: 

looking for example using BLE and I2C sensor

MHell.1
Associate II

Hi, I have been following the STM32WB workshop, however the material seems to not fit to the current FW anymore.

I need to read a sensor that is connected via I2C and send the results via BLE.

I can get the sensor readings and output them via UART but as soon as APPE_Init() is called, the output to UART does not work anymore. I assume it is a problem due to scheduling, however the schedule.h file referenced in the workshop videos seem to not exist anymore, so I am stuck here.

Does anyone have a working current example of reading sensor values in parallel to running BLE services, or an updated info on how to use scheduling?

1 ACCEPTED SOLUTION

Accepted Solutions
Remi QUINTIN
ST Employee

Then you could use the STM32Cube_FW_WB_V1.6.0\Projects\P-NUCLEO-WB55.Nucleo\Applications\BLE\BLE_HealthThermometer project that contains an example of the reading of a temperature sensor , which is then sent to the central base via BLE communication.

View solution in original post

4 REPLIES 4
Remi QUINTIN
ST Employee

Did you compile in debug mode?

Then you may have a conflict with the call to APPD_Init() function, which is implemented in the app_debug.c file.

This function reset some UART pins that may conflict with the ones you are using. I would recommend you to check this before going any further.

Remi QUINTIN
ST Employee

Then you could use the STM32Cube_FW_WB_V1.6.0\Projects\P-NUCLEO-WB55.Nucleo\Applications\BLE\BLE_HealthThermometer project that contains an example of the reading of a temperature sensor , which is then sent to the central base via BLE communication.

Thank you Remi,

I had a look at the Project, however I could not find how the I2C connection is initialized for the sensor in hts_app.c, or how to initialize the sensor in main.c but use it in the hts_app.c part... I am a bit lost here.

MHell.1
Associate II

OK, I tried it initializing the sensor in main.c and reading the sensor values in hts.c and it works.

Thanks