Hello everyone, I have a similar question.
@trantrieuphi: Have you found a solution?
As a workaround, I have added an abort service to the Matter BLE profile to abort the commissioning process. As soon as I receive the ChipDeviceEvent "kCHIPoBLEConnectionClosed", I initialize the nimble stack and start the BLE advertising. This initialization corresponds to the example from git repository
https://github.com/michael-angerer/esp3 ... e/main/esp. I have set the configuration CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING to “No” because initialization is no longer possible after a complete deinitialization (for whatever reason). Therefore, I implemented the "deinitialization light", which calls nimble_port_stop() and then esp_nimble_deinit(). After this "deinitialization light" I start the nimble stack with esp_nimble_init() instead of nimble_port_init(). Everything can be initialized in this way, but ble_gap_adv_start() returns error value 530 (0x212 = 0x200 | 0x012 = BLE_HS_EROLE). Can anyone help me?
Thank you and best regards.