Skip to main content
MHell.1
Associate II
May 6, 2020
Solved

looking for example using BLE and I2C sensor

  • May 6, 2020
  • 3 replies
  • 1688 views

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?

This topic has been closed for replies.
Best answer by Remi QUINTIN

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.

3 replies

Remi QUINTIN
Technical Moderator
May 6, 2020

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
Technical Moderator
May 6, 2020

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.

MHell.1
MHell.1Author
Associate II
May 6, 2020

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
MHell.1Author
Associate II
May 7, 2020

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

Thanks