Skip to content

Commit

Permalink
fix(BLE): Resolve double increment of memory management in LlInitSetR…
Browse files Browse the repository at this point in the history
…tCfg (#1237)
  • Loading branch information
crsz20 authored Oct 22, 2024
1 parent 6dd49f8 commit f557dbf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/BLE_Examples_Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,6 @@ jobs:
boards: |
max32655_board1
max32655_board2
max32665_board1
max32690_board_w1
lock: true
timeout: 3600 # Attempt to lock for an hour

Expand All @@ -615,23 +613,21 @@ jobs:
# sed -i "s/'S'/'!'/g" Examples/MAX32690/Bluetooth/BLE_otac/datc_main.c
- name: Erase Boards DATS
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true' || env.MAX32665_DATS_CONNECTED_TEST == 'true' || env.MAX32690_DATS_CONNECTED_TEST == 'true'}}
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true' || env.MAX32655_RUN_ALL_TEST == 'true'}}
uses: Analog-Devices-MSDK/btm-ci-scripts/actions/[email protected]
with:
board: |
max32655_board1
max32655_board2
max32665_board1
max32690_board_w1
has_two_flash_banks: |
true
true
true
true
# true
# true
- name: Flash DATS 655
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true'}}
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true' || env.MAX32655_RUN_ALL_TEST == 'true'}}
uses: Analog-Devices-MSDK/btm-ci-scripts/actions/[email protected]
with:
board: |
Expand All @@ -652,7 +648,7 @@ jobs:
distclean: true

- name: DATS 655
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true'}}
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true' || env.MAX32655_RUN_ALL_TEST == 'true'}}
run: |
DATS_TEST_DIR=$TEST_DIR/dats
DATS_BOARD_655=max32655_board1
Expand All @@ -662,17 +658,15 @@ jobs:
- name: Erase Boards OTAS
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true' || env.MAX32665_DATS_CONNECTED_TEST == 'true' || env.MAX32690_DATS_CONNECTED_TEST == 'true'}}
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true' || env.MAX32655_RUN_ALL_TEST == 'true'}}
uses: Analog-Devices-MSDK/btm-ci-scripts/actions/[email protected]
with:
board: |
max32655_board1
max32655_board2
max32665_board1
max32690_board_w1
- name: Flash OTAS
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true' || env.MAX32665_DATS_CONNECTED_TEST == 'true' || env.MAX32690_DATS_CONNECTED_TEST == 'true'}}
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true' || env.MAX32655_RUN_ALL_TEST == 'true'}}
uses: Analog-Devices-MSDK/btm-ci-scripts/actions/[email protected]
with:
board: |
Expand All @@ -695,13 +689,13 @@ jobs:
distclean: true

- name: OTAS
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true' || env.MAX32665_DATS_CONNECTED_TEST == 'true' || env.MAX32690_DATS_CONNECTED_TEST == 'true'}}
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true' || env.MAX32655_RUN_ALL_TEST == 'true'}}
run: |
OTAS_TEST_DIR=$TEST_DIR/otas
OTAS_BOARD_655=max32655_board1
OTAC_BOARD_655=max32655_board2
OTAC_BOARD_665=max32665_board1
OTAC_BOARD_690=max32690_board_w1
# OTAC_BOARD_665=max32665_board1
# OTAC_BOARD_690=max32690_board_w1
if [[ $MAX32655_OTAS_CONNECTED_TEST == 'true' ]]; then
Expand Down
12 changes: 9 additions & 3 deletions Libraries/Cordio/controller/sources/ble/init/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,16 +319,22 @@ uint32_t LlInitSetLlRtCfg(const LlRtCfg_t *pLlRtCfg, uint8_t *pFreeMem, uint32_t
/*************************************************************************************************/
uint32_t LlInitSetRtCfg(LlInitRtCfg_t *pCfg)
{
uint32_t memUsed = LlInitSetBbRtCfg(pCfg->pBbRtCfg, pCfg->wlSizeCfg, pCfg->rlSizeCfg, pCfg->plSizeCfg,
uint32_t totalMemUsed = 0;
uint32_t memUsed;

memUsed = LlInitSetBbRtCfg(pCfg->pBbRtCfg, pCfg->wlSizeCfg, pCfg->rlSizeCfg, pCfg->plSizeCfg,
pCfg->pFreeMem, pCfg->freeMemAvail);

pCfg->pFreeMem += memUsed;
pCfg->freeMemAvail -= memUsed;
totalMemUsed += memUsed;

memUsed += LlInitSetLlRtCfg(pCfg->pLlRtCfg, pCfg->pFreeMem, pCfg->freeMemAvail);
memUsed = LlInitSetLlRtCfg(pCfg->pLlRtCfg, pCfg->pFreeMem, pCfg->freeMemAvail);
pCfg->pFreeMem += memUsed;
pCfg->freeMemAvail -= memUsed;
totalMemUsed += memUsed;

return memUsed;
return totalMemUsed;
}

/*************************************************************************************************/
Expand Down

0 comments on commit f557dbf

Please sign in to comment.