Skip to content

ble_hci: use the LE packet boundary flag for outgoing ACL data - #11146

Closed
annejan wants to merge 1 commit into
adafruit:mainfrom
annejan:fix/le-acl-pb-flag
Closed

ble_hci: use the LE packet boundary flag for outgoing ACL data#11146
annejan wants to merge 1 commit into
adafruit:mainfrom
annejan:fix/le-acl-pb-flag

Conversation

@annejan

@annejan annejan commented Jul 29, 2026

Copy link
Copy Markdown

hci_send_acl_pkt() marks the first fragment of every outgoing L2CAP PDU as ACL_DATA_PB_FIRST_FLUSH:

acl_pkt->pb = ACL_DATA_PB_FIRST_FLUSH;

That is the BR/EDR value, "first automatically flushable" (0b10). On an LE-U link the first fragment of a higher layer message is non-automatically-flushable, ACL_DATA_PB_FIRST_NON_FLUSH (0b00). See Core Specification Vol 4, Part E, 5.4.2.

Symptom

Nordic's SoftDevice Controller accepts a packet marked 0b10, returning success from sdc_hci_data_put(), and then never transmits it. Measured on an nRF52840 over SWD:

  • No Number Of Completed Packets event ever arrived, for any packet.
  • The peer waited for a reply that never came and disconnected with reason 0x13, remote user terminated — not 0x08, which a supervision timeout would give.
  • A client hung indefinitely on "discovering services" and eventually timed out.

With the LE value, the same connection completes service discovery and stays up.

Scope, and what I could not test

This is the packet boundary flag for LE links, so it applies to every board using the HCI _bleio host, not only the one I was working on.

I could only test against one controller: Nordic's SoftDevice Controller driven on-chip. I have no AirLift hardware, so I have not verified the ESP32 co-processor boards that are the usual users of this backend. Their controllers evidently tolerate 0b10 today, since those boards work. The change makes the value spec-correct rather than relying on that tolerance, but it would be worth a second pair of eyes from someone with an AirLift board before merging.

hci_send_acl_pkt() marked the first fragment of every outgoing L2CAP PDU as
ACL_DATA_PB_FIRST_FLUSH. That is the BR/EDR value, "first automatically
flushable". On an LE-U link the first fragment is non-automatically-flushable,
ACL_DATA_PB_FIRST_NON_FLUSH.

Nordic's SoftDevice Controller accepts a packet marked that way, returning
success, and then never transmits it. Measured on an nRF52840: no Number Of
Completed Packets event ever arrived for any packet, and the peer eventually
gave up and disconnected with reason 0x13, remote user terminated, rather than
a supervision timeout. A client hung indefinitely discovering services.

With the LE value the same connection completes discovery and stays up.
dhalbert
dhalbert previously approved these changes Jul 29, 2026

@dhalbert dhalbert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see next post

@dhalbert

Copy link
Copy Markdown
Collaborator

I am confused now. ble_hci is not used by the nordic port. Are you talking to a Nordic chip running the SoftDevice Controller over serial or SPI? It sounds like not, that you are talking to it from software on the same chip. But if so, why did you choose that rather than the native _bleio?

@annejan

annejan commented Jul 29, 2026

Copy link
Copy Markdown
Author

Yeah . . it was my confused setup . .

PR closed . . sorry for wasting your time!

@annejan annejan closed this Jul 29, 2026
@dhalbert

Copy link
Copy Markdown
Collaborator

Is it still the case that there actually is a bug? I could believe it.

@annejan

annejan commented Jul 29, 2026

Copy link
Copy Markdown
Author

It is a bug in my very non-standard system . .
Working around a specific bootloader that can not be easilly replaced at scale.
So can't use the default binary blob S140 SoftDevice

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

Successfully merging this pull request may close these issues.

2 participants