Skip to content

Conversation

@NikhitaR-IFX
Copy link
Member

Summary

  • Enabled BLE.irq() and BLE.config()
  • Added test for possible validation.
  • Points to consider for review:
  1. Certain configuration fields in config() is either to be supported as part of L2CAP enablement or too complex to enable. These are documented for now but is bound to change as and when we take respective modules.
  2. irq() right now is only registering handle. The events are already configured in extmod/modbluetooth and the registered handler will be invoked for every possible event. These are gatt events and can be tested in GATT module.

Signed-off-by: NikhitaR-IFX <nikhita.rajasekhar@infineon.com>
Signed-off-by: NikhitaR-IFX <nikhita.rajasekhar@infineon.com>
Signed-off-by: NikhitaR-IFX <nikhita.rajasekhar@infineon.com>
Signed-off-by: NikhitaR-IFX <nikhita.rajasekhar@infineon.com>
Copy link
Member

@jaenrig-ifx jaenrig-ifx left a comment

Choose a reason for hiding this comment

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

BLE details I can not really judge 👍 Good progress. Step by step 🪜

.. method:: BLE.config('param', /)
BLE.config(*, param=value, ...)

Among the suggested parameters of the general network WLAN API, for this port, only these are available:
Copy link
Member

Choose a reason for hiding this comment

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

network WLAN API?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

addr[5] = (addr[5] & 0x3F) | 0xC0; // MSB[0:1] - 11 - Static Random Address
break;
}
// ToDo: This is in a way supported from MTB BLE stack side but is complicated to map to MPY side. Requires NVRAM to store the keys. Considering this is not an absolutely necessary feature, let's postpone for extension after MVP?
Copy link
Member

Choose a reason for hiding this comment

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

From all these key storage requirements, is there an example of how is this done in other cores?

Copy link
Member Author

Choose a reason for hiding this comment

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

We have only 3 references. All the ports that have BLE support depend on nimble or btstack and in each following is the implementation:

  1. extmod/nimble/modbluetooth_nimble.c : IRK is stored in NVM. This might give some explanation
  2. extmod/btstack/modbluetooth_stack.c : Not supported (https://github.com/Infineon/micropython/blob/ports-psoc6-main/extmod/btstack/modbluetooth_btstack.c#L777)
  3. ports/zephyr/modbluetooth_zephyr.c : Not supported

We have API's in MTB BLE stack to do this, but just that it is not evaluated yet how to especially with the NVM enablement part.

raise SystemExit


def irq_handle(event, data):
Copy link
Member

Choose a reason for hiding this comment

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

Can we already add this tests to the HIL? Or to early!?

Copy link
Member Author

Choose a reason for hiding this comment

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

The events possible in this handler are the only ones listed here: https://ifx-micropython.readthedocs.io/en/latest/library/bluetooth.html#bluetooth.BLE.irq
This is right now solved in extmod/modbluetooth.c already. We need to at least enable the roles test this irq functionality wise. These are the next tickets I am working on. So I would say, little more time that we get the test in required shape.

Signed-off-by: NikhitaR-IFX <nikhita.rajasekhar@infineon.com>
@NikhitaR-IFX
Copy link
Member Author

BLE details I can not really judge 👍 Good progress. Step by step 🪜

I understand. I am also trying to add some "design considerations" section for retro and maybe it is easier then to comment :)

@NikhitaR-IFX
Copy link
Member Author

I will merge this and in case of any more questions let me know :)

@NikhitaR-IFX NikhitaR-IFX merged commit 5e34d26 into en-ble Sep 12, 2025
25 of 30 checks passed
@NikhitaR-IFX NikhitaR-IFX deleted the en-config-and-irq branch September 12, 2025 11:51
@jaenrig-ifx
Copy link
Member

BLE details I can not really judge 👍 Good progress. Step by step 🪜

I understand. I am also trying to add some "design considerations" section for retro and maybe it is easier then to comment :)

All good! You are now the BLE expert 👯‍♀️

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.

3 participants