Skip to content

Help using STM32duinoBLE with sensortile box - default example LED controller/peripheral does not work #57

@gemelko

Description

@gemelko

Help, I'm completely stuck! I can't seem to get the STM32duinoBLE library to be useful on the sensortile box: it works but seems to only set up a basic BLE device with generic interface that can't be used to move data from or to the device, and adding services seems to be non-functional.

So to make things extremely simple, I reduced my testing to two sensortile.box devices and compiled the examples from the STM32duinoBLE library "LED" and "LedControl" - control on one device, peripheral on the other device, and monitored the serial ports on both devices. They both initialize the BLE and report that they are functioning, but they never connect to each other. Here are the results:

With the default firmware loaded onto the SPBTLE-1S module: While the BLE device does start on both, they never make a connection: the BLE.available() call always returns false, thus the scanner on the control side doesn't find the peripheral device. This is true whether I use the code as-is which calls BLE.scanForUuid("19B10000-E8F2-537E-4F6C-D104768A1214") or if I change the code to use BLE.scanForName("LED") - in both instances, BLE.available() within the loop never returns true, and the control device never attempts to connect to the peripheral.

With the DTM_LLOnly.bin firmware loaded onto the SPBTLE-1S module: The BLE.begin() call always fails, and thus nothing else works.

Some additional information: When I use the default firmware on the SPBTLE-1S module and run the LED example above, I only see two generic services:
00001801-0000-1000-8000-00805f9b34fb (Handle: 1): Generic Attribute Profile
00001800-0000-1000-8000-00805f9b34fb (Handle: 5): Generic Access Profile
...and even using an Android device to connect to them, I can't seem to attach to the services Uuid's for the LED using a BT tool such as LightBlue, ST BLE ToolBox-1.3.5, or BLE Tester. The LED service should be 19B10000-E8F2-537E-4F6C-D104768A1214 however I can't connect to its characteristic 19B10001-E8F2-537E-4F6C-D104768A1214 even though I can see this service with LightBlue (for example) as an "Advertised service UUID."

But back to basics, I would hope that the out-of-the-library examples for Control and Peripheral would work, but they do not.

I read a note about using DTM_LLOnly.bin however as I said, flashing that into the boards completely breaks things as far as I can tell.

Upon further investigation, I loaded the Keil ARM compiler and the BlueNRG-1_2_DK_3.2.3 from ST and found that the default pinout for the SPBTLE-1S module in the DTM project has the SPBTLE-1S Chip Select (CS) on GPIO11 and IRQ on GPIO7 however the sensortile box definitions have CS on GPIO1 and IRQ on GPIO14, so I changed those and re-built the module firmware DTM_SPI.bin and flashed that using the ST-LinkV2 into the SPTBLE-1S module (10-pin header soldered to the board). With that, the BLE.begin() function call executes successfully, however the device does not appear to initialize properly: I can see a MAC address for the device, but it doesn't get a name or any services and it is not connectable using LightBlue or ST BLE ToolBox... but I think I'm on the right track with this.

Help, anyone?!?! Am I going down the wrong path trying to flash the SPTBLE-1S module and thus should I put it back to default? I'm struggling here, and I've been pounding my head against this for several weeks now. Is it something obvious that I just missed, or is this really a problem with the sensortilebox using STM32duinoBLE?

Thank you in advance, anyone, for any assistance you can give me!!
Glenn

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions