Hi JF, I need to admit that I totally missed the part that you are on FreeRTOS but I see DEBUG lines that work for you. On the first picture you see radio activity every advertising interval and on the second one you see a single advertising event - all looks good.
Anyway, the question now is why BLE_GAP_EVENT_ADV_COMPLETE is sent with a timeout. Did you try to debug it by setting breakpoint at ble_gap_adv_finished? Also could you share btsnoop logs? Bes Łukasz On Tue, 3 Aug 2021 at 20:37, <j...@codingfield.com> wrote: > > If you have nrf52 you could trace radio activity with some debug pins > > BLE_PHY_DBG_TIME_ADDRESS_END_PIN > > BLE_PHY_DBG_TIME_WFR_PIN > > BLE_PHY_DBG_TIME_TXRXEN_READY_PIN > > > > Here you can find a description of those. > > > https://github.com/apache/mynewt-nimble/blob/master/nimble/drivers/nrf52/syscfg.yml#L35 > > Thanks Łukasz! I've connected my logic analyzer (saleae logic 8) on 3 > pins, and I've also enabled the logging feature of nimble. > When BLE is working fine and start advertising, I can see this in the > logs : > > <info> app: GAP procedure initiated: advertise; > <info> app: disc_mode=2 > <info> app: adv_channel_map=0 own_addr_type=0 adv_filter_policy=0 > adv_itvl_min=0 adv_itvl_max=0 > <info> app: > > And when it stops, after 3 minutes: > > <info> app: Advertising event : BLE_GAP_EVENT_ADV_COMPLETE > <info> app: advertise complete; reason=13n status=13 > > See ble-adv1.png and ble-adv2.png for screenshots of the capture of the > 3 pins. > > I left the device running during the whole day and in the evening, I > tried to restart the advertising (with a push button) and... the logs > are exactly the same (as if it was advertising correctly for 3 minutes > and then complete) but... nothing on the 3 debug pins, they were just > flat on low level. Obviously, the device was not found by my ble > scanner. > > Sooo... any ideas :p ? > > Thanks! > > JF