Skip to content

Commit 3ce1d91

Browse files
Donatien Garnierpan-
authored andcommitted
Amend Nordic HCI driver to support BLE5 features
1 parent 1b3efa4 commit 3ce1d91

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "wsf_buf.h"
3737
#include "wsf_timer.h"
3838
#include "wsf_trace.h"
39+
#include "dm_api.h"
3940

4041
// Nordic Includes
4142
#include "nrf.h"
@@ -55,7 +56,7 @@ using namespace ble::vendor::nordic;
5556
using namespace ble::vendor::cordio;
5657

5758
/*! \brief Memory that should be reserved for the stack. */
58-
#define CORDIO_LL_MEMORY_FOOTPRINT 3776UL
59+
#define CORDIO_LL_MEMORY_FOOTPRINT 31234UL
5960

6061
/*! \brief Typical implementation revision number (LlRtCfg_t::implRev). */
6162
#define LL_IMPL_REV 0x2303
@@ -94,11 +95,11 @@ const LlRtCfg_t NRFCordioHCIDriver::_ll_cfg = {
9495
/* Device */
9596
/*compId*/ LL_COMP_ID_ARM,
9697
/*implRev*/ LL_IMPL_REV,
97-
/*btVer*/ LL_VER_BT_CORE_SPEC_4_2,
98+
/*btVer*/ LL_VER_BT_CORE_SPEC_5_0,
9899
0, // padding
99100
/* Advertiser */
100-
/*maxAdvSets*/ 0, /* Disable extended advertising. */
101-
/*maxAdvReports*/ 4,
101+
/*maxAdvSets*/ 2, // 2 Extended Advertising Sets
102+
/*maxAdvReports*/ 8,
102103
/*maxExtAdvDataLen*/ advDataLen,
103104
/*defExtAdvDataFrag*/ 64,
104105
0, // Aux delay
@@ -263,7 +264,7 @@ void NRFCordioHCIDriver::do_initialize()
263264
// If a submodule does not have enough space to allocate its memory from buffer, it will still allocate its memory (and do a buffer overflow) and return 0 (as in 0 byte used)
264265
// however that method will still continue which will lead to undefined behaviour
265266
// So whenever a change of configuration is done, it's a good idea to set CORDIO_LL_MEMORY_FOOTPRINT to a high value and then reduce accordingly
266-
uint32_t mem_used = LlInitControllerInit(&ll_init_cfg);
267+
uint32_t mem_used = LlInitControllerExtInit(&ll_init_cfg);
267268
if( mem_used < CORDIO_LL_MEMORY_FOOTPRINT )
268269
{
269270
// Sub-optimal, give warning
@@ -288,6 +289,14 @@ void NRFCordioHCIDriver::do_terminate()
288289

289290
}
290291

292+
void NRFCordioHCIDriver::start_reset_sequence()
293+
{
294+
// Make sure extended adv is init
295+
DmExtAdvInit();
296+
297+
CordioHCIDriver::start_reset_sequence();
298+
}
299+
291300
ble::vendor::cordio::CordioHCIDriver& ble_cordio_get_hci_driver() {
292301
static NRFCordioHCITransportDriver transport_driver;
293302

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class NRFCordioHCIDriver : public cordio::CordioHCIDriver {
4848
/**
4949
* Start the reset sequence of the BLE module.
5050
*/
51-
//virtual void start_reset_sequence();
51+
virtual void start_reset_sequence();
5252

5353
/**
5454
* Handle HCI messages received during the reset sequence.

0 commit comments

Comments
 (0)