Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

how and when to configure PA LNA enables in the stock BLE DFU firmware in nRF5 SDK 17.1.0

We are using SDK 17.1.0 with SoC nRF52832 and Soft Device S132.

We want to configure the soft device to enable the TX and RX GPIOs to talk to off-chip power amplifier.
Looks like this can only be done after the Soft Device has been enabled but before a client establishes a connection.

In a previous generation of this product we modified the stock SDK file "libraries\bootloader\ble_dfu\nrf_dfu_ble.c" to make this happen before calling the function "advertising_start()".

However we want to have a cleaner mechanism where we do not modify files in the SDK (or maintain a modified copy elsewhere).

I tried doing so in the DFU observer call back but if I do so in either of the events 'NRF_DFU_EVT_DFU_INITIALIZED' or 'NRF_DFU_EVT_TRANSPORT_ACTIVATED' I get the error 'INVALID_STATE'.

Is there a way to register a callback that will be executed after the Soft Device is enabled and just prior to the first advertisement, but before any DFU clients connect to the device?

Cheers

RMV

Related