cancel
Showing results for 
Search instead for 
Did you mean: 

Has anybody written code to work with the STM32MP157C-DK2 Bluetooth (BLE) module?

NChri.1
Associate II

I can access it with the given tools, like bluetoothctl, but I cannot build that same tool, so that I can write my own code. It seems some header files or libraries are missed. Am I missing something?

7 REPLIES 7
JSpra
Associate III

Check to see if your local.conf contains the following, don't think all of the bluetooth modules are included by default.

DISTRO_FEATURES_append += "bluetooth"

DISTRO_FEATURES_append += "bluez5"

NChri.1
Associate II

Thanks for the reply. The local.conf in the distribution package does not have the lines you mentioned, although the STM32... kit does use bluetooth. For example, when I use the bluetoothctl tool I can access and work with the bluetooth. However, I want to use some of the source code for the bluetoothctl but I cannot build. (Also, when I tried to build the kernel from the distribution package, the build was unsuccessful, although I followed all the prescribed steps.) If I want to access the bluetooth module directly, I know linux uses the UART2, but how to access it through linux? The /dev/xxxx does not show me anything relevant.

JSpra
Associate III

I ran into similar issues, I could run some pre-built demos, however, I could not build my own code against any libraries.

First check if you have the following in your sdk

YOURSDK/2.6-snapshot/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/include/bluetooth/... (Directory of bluetooth include files)

YOURSDK/2.6-snapshot/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi/usr/lib/libbluetooth.so (bluetooth library)

If these are missing, you'll need to rebuild the image and sdk with changes I mentioned.

NChri.1
Associate II

I have the libbluetooth.so but not in the place you suggested but under the /build-openstlinuxweston-stm32mp1/tmp-glibc/sysroots-components/cortexa7t2hf-neon-vfpv4/bluez5/usr/lib/. Same with the include/blue...., it is under the .../bluez5/usr/. I will try to rebuild it.

JSpra
Associate III

I'm sorry, I sent you the elgfs distribution, you're on weston

If you have these, you should be good to go.

YOURSDK/2.6-snapshot/sysroots/cortexa7t2hf-neon-vfpv4-openstlinux_weston-linux-gnueabi/usr/include/bluetooth/... (Directory of bluetooth include files)

YOURSDK/2.6-snapshot/sysroots/cortexa7t2hf-neon-vfpv4-openstlinux_weston-linux-gnueabi/usr/lib/libbluetooth.so (bluetooth library)

Only other suggestion is to make sure you are putting bluetooth/ prefix on your include files

#include <bluetooth/bluetooth.h>

#include <bluetooth/hci.h>

#include <bluetooth/hci_lib.h>

NChri.1
Associate II

Well, I tried to build some of the tools. I managed to do so for the hciconfig and hciattach, but not for the gatt-service. There seems to be some missing files, related to glib, dbus, etc.

NChri.1
Associate II

Well, after quite some exhausting search, I managed to build some other tools, like btgatt-client, btgatt-server and gatttool. Now I need to test them with two kits.