Skip to content

HCISharedMemTransportClass never available #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Henrydw opened this issue Jul 31, 2024 · 5 comments
Closed

HCISharedMemTransportClass never available #71

Henrydw opened this issue Jul 31, 2024 · 5 comments

Comments

@Henrydw
Copy link

Henrydw commented Jul 31, 2024

Background

OS: Mac OS Sonoma 14.5
IDE: Arduino IDE
BOARD SETTING: Discovery
VARIANT SETTING: STM32WB5MM-DK
OPTIMISATION: None
C RUNTIME LIBRARY: Newlib Nano (default)
UPLOAD METHOD: SWD

HARDWARE: STM32WB5MM-DK Discovery board
WIRELESS STACK: stm32wb5x_BLE_HCILayer_fw.bin
VERSION: 1.20.0
EXTRA HARDWARE: uBlox ZED F9P (I2C connection)

PACKAGES:

  • STM32duinoBLE (1.2.8)
  • Wire @ 2.50700.210515 (5.7.0)
  • SparkFun_u-blox_GNSS_Arduino_Library (2.2.27)
  • ArduinoJson (7.1.0)

Issue Description

A function is sending data over BLE.
This data is received from an I2C connected peripheral (in this case the uBlox GNSS chip).
I only mention this because I see an Open issue to do the clock and I2C & BLE usage.

The ISSUE:

On some occasions (not clear when) the BLE HCI gets stuck in an infinite loop.
The BLE device is still visible and can be connected to however the F4 core is stuck running BLE Poll.

The call stack looks like so:

→ sendPVTData (my function to send data received from I2C peripheral over BLE)

→Some BLE characteristic stuff……

→ HCIClass::sendAclPkt

→ While ( _pendingPkt >= _maxPkt )

This while loop is never exited

→ HCIClass::poll

→ HCISharedMemTransportClass::available()

**→ always returns false (_read_index = _write_index)

Issue Reproduction

  • Set Optimize to Debug (-Og)

This should cause a similar issue immediately.
The F4 core appears to execute the BLE commands sluggishly eg Poll appear to takes ~100 times longer
The slow reaction of the F4 seems to cause the core to get stuck in the cycle above?

  • Set Optimize to Fastest (-O3) with LTO

This issue is almost gone, it appears twice in ~60 hours of testing
It only appeared in a cluttered BLE environment with multiple connection requests.

Expected Behaviour

_pendingPkt should decrease to less than _maxPkt ?

This is a guess, I will expand as I dig deeper.

@Henrydw Henrydw added the bug label Jul 31, 2024
@fpistm
Copy link
Member

fpistm commented Aug 19, 2024

Hi @Henrydw
Thanks for the detailed description. Feel free to submit a PR if you find a proper fix.

@fpistm fpistm added bug 🐛 Something isn't working and removed bug labels Mar 5, 2025
@fpistm
Copy link
Member

fpistm commented Mar 28, 2025

Hi @Henrydw
probably duplicate of #58.
Could you test with new STM32duinoBLE version, please?

@federica-ven
Copy link

federica-ven commented Apr 6, 2025

Same thing seems to be happening to me.

Trying to use the new version of STM32duinoBLE 1.3.7 with a Generic STM32WB55VGYx board.

Seems like the HCISharedMemTransportClass is never available?

~/Documents/Arduino/libraries/STM32duinoBLE/src/utility/HCISharedMemTransport.cpp:781:39: error: 'HCISharedMemTransport' was not declared in this scope; did you mean 'HCISharedMemTransportClass'?
  781 | HCITransportInterface& HCITransport = HCISharedMemTransport;
      |                                       ^~~~~~~~~~~~~~~~~~~~~
      |                                       HCISharedMemTransportClass

it works if I revert back to an older version (ie. 1.2.9)

@Henrydw
Copy link
Author

Henrydw commented Apr 7, 2025

We have overcome this but it was some time ago.

I can say for certain that I have not modified STM32duinoBLE to over come this, we currently use version 1.2.8.

CAUSE: voltage ripple on the supply leading to stability issues on the STM32 WB BLE coprocessor.

The coprocessor would crash irreparably (requiring a reset) at irregular intervals (sometimes hours, sometimes minutes).

NB: The tolerated voltage ripple on the STM32 WB is ~10mV.

SOLUTION:

The voltage ripple was caused by a uBlox GNSS receiver which was much noisier than we anticipated.

We solved this with a capacitance multiplier and separate LDOs but it is not a situation we are happy about.

@fpistm
Copy link
Member

fpistm commented Apr 7, 2025

Hi @Henrydw
Thanks for the feedback, so I close this issue.

@fpistm fpistm closed this as completed Apr 7, 2025
@fpistm fpistm removed the bug 🐛 Something isn't working label Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants