Skip to content

Commit

Permalink
Merge branch 'main' into chore/reg-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sihyung-maxim committed Nov 13, 2024
2 parents d9c6ea0 + 9bb8b50 commit cf5ab90
Show file tree
Hide file tree
Showing 141 changed files with 13,873 additions and 1,525 deletions.
8 changes: 6 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
## Pull Request Template

### Description

Please include a summary of the changes and related issues. Please also include relevant motivation and context.
Expand All @@ -11,6 +9,12 @@ Please include a summary of the changes and related issues. Please also include
- [ ] (Optional) Link any related GitHub issues [using a keyword](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword)
- [ ] (Optional) Provide info on any relevant functional testing/validation. For API changes or significant features, this is not optional.

_______________________________________________________________________________

> [!WARNING]
> This is a template. Delete everything below the line when submitting a pull request.

### PR Title Guidelines

The MSDK repo follows a custom rule set based on the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard. The pull request titles will follow this format:
Expand Down
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
15 changes: 12 additions & 3 deletions .github/workflows/clang-format-run-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,22 @@ on:
issue_comment:
types: [created]

permissions:
actions: write
contents: write

env:
CLANG_VERSION: 14

jobs:

run-on-pr:
# Run on branchs, not forked PR branches
run-on-pr:
permissions:
contents: write
pull-requests: write
actions: write

# Run on branches, not forked PR branches
if: |
contains(github.event.comment.body, '/clang-format-run')
Expand All @@ -44,7 +53,7 @@ jobs:
run: |
sudo apt-get install clang-format-${CLANG_VERSION}
- uses: actions/github-script@v6
- uses: actions/github-script@v7
id: get-pr
with:
script: |
Expand Down
72 changes: 45 additions & 27 deletions Examples/MAX32655/Bluetooth/BLE4_ctr/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ static void mainLoadConfiguration(void)
/*************************************************************************************************/
static void mainWsfInit(void)
{
uint32_t llmemUsed, memUsed;

mainLoadConfiguration();

/* +12 for message headroom, +4 for header. */
const uint16_t aclBufSize = 12 + mainLlRtCfg.maxAclLen + 4 + BB_DATA_PDU_TAILROOM;

Expand All @@ -105,24 +109,61 @@ static void mainWsfInit(void)

const uint8_t numPools = sizeof(poolDesc) / sizeof(poolDesc[0]);

/* Calculate how much memory we will need for the LL initialization */
WsfCsEnter();

LlInitRtCfg_t llCfg = {
.pBbRtCfg = &mainBbRtCfg,
.wlSizeCfg = 4,
.rlSizeCfg = 4,
.plSizeCfg = 4,
.pLlRtCfg = &mainLlRtCfg,
/* Not significant yet, only being used for memory size requirement calculation. */
.pFreeMem = WsfHeapGetFreeStartAddress(),
/* Not significant yet, only being used for memory size requirement calculation. */
.freeMemAvail = WsfHeapCountAvailable()
};

llmemUsed = LlInitSetRtCfg(&llCfg);

WsfCsExit();

/* Initial buffer configuration. */
uint16_t memUsed;
WsfCsEnter();
memUsed = WsfBufInit(numPools, poolDesc);
memUsed = WsfBufCalcSize(numPools, poolDesc);
WsfHeapAlloc(memUsed);
WsfBufInit(numPools, poolDesc);
WsfCsExit();

WsfOsInit();
WsfTimerInit();

#if (WSF_TRACE_ENABLED == TRUE)
WsfCsEnter();
memUsed = WsfBufIoUartInit(WsfHeapGetFreeStartAddress(), PLATFORM_UART_TERMINAL_BUFFER_SIZE);
WsfHeapAlloc(memUsed);
WsfHeapAlloc(PLATFORM_UART_TERMINAL_BUFFER_SIZE);
WsfBufIoUartInit(WsfHeapGetFreeStartAddress(), PLATFORM_UART_TERMINAL_BUFFER_SIZE);
WsfCsExit();

WsfTraceRegisterHandler(WsfBufIoWrite);
WsfTraceEnable(TRUE);
#endif

/* Complete the LL initialization */
WsfCsEnter();

/* Allocate the memory */
WsfHeapAlloc(llmemUsed);

/* Set the free memory pointers */
llCfg.pFreeMem = WsfHeapGetFreeStartAddress();
llCfg.freeMemAvail = WsfHeapCountAvailable();

/* Run the initialization with properly set the free memory pointers */
if (llmemUsed != LlInitControllerInit(&llCfg)) {
WSF_ASSERT(0);
}

WsfCsExit();
}

/*************************************************************************************************/
Expand Down Expand Up @@ -164,31 +205,8 @@ static bool mainCheckServiceTokens(void)
/*************************************************************************************************/
int main(void)
{
uint32_t memUsed;

mainLoadConfiguration();
mainWsfInit();

#if (WSF_TRACE_ENABLED == TRUE)
WsfCsEnter();
memUsed = WsfBufIoUartInit(WsfHeapGetFreeStartAddress(), PLATFORM_UART_TERMINAL_BUFFER_SIZE);
WsfHeapAlloc(memUsed);
WsfCsExit();
#endif

WsfCsEnter();
LlInitRtCfg_t llCfg = { .pBbRtCfg = &mainBbRtCfg,
.wlSizeCfg = 4,
.rlSizeCfg = 4,
.plSizeCfg = 4,
.pLlRtCfg = &mainLlRtCfg,
.pFreeMem = WsfHeapGetFreeStartAddress(),
.freeMemAvail = WsfHeapCountAvailable() };

memUsed = LlInitControllerInit(&llCfg);
WsfHeapAlloc(memUsed);
WsfCsExit();

bdAddr_t bdAddr;
PalCfgLoadData(PAL_CFG_ID_BD_ADDR, bdAddr, sizeof(bdAddr_t));
/* Coverity[uninit_use_in_call] */
Expand Down
74 changes: 46 additions & 28 deletions Examples/MAX32655/Bluetooth/BLE5_ctr/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static void mainLoadConfiguration(void)
PalBbLoadCfg((PalBbCfg_t *)&mainBbRtCfg);
LlGetDefaultRunTimeCfg(&mainLlRtCfg);
PalCfgLoadData(PAL_CFG_ID_LL_PARAM, &mainLlRtCfg.maxAdvSets, sizeof(LlRtCfg_t) - 9);
PalCfgLoadData(PAL_CFG_ID_BLE_PHY, &mainLlRtCfg.phy2mSup, 4);
PalCfgLoadData(PAL_CFG_ID_BLE_PHY, (uint8_t *)&mainLlRtCfg.phy2mSup, 4);

/* Set 5.0 requirements. */
mainLlRtCfg.btVer = BT_VER;
Expand Down Expand Up @@ -111,6 +111,10 @@ static void mainLoadConfiguration(void)
/*************************************************************************************************/
static void mainWsfInit(void)
{
uint32_t llmemUsed, memUsed;

mainLoadConfiguration();

/* +12 for message headroom, + 2 event header, +255 maximum parameter length. */
const uint16_t maxRptBufSize = 12 + 2 + 255;

Expand All @@ -137,24 +141,61 @@ static void mainWsfInit(void)

const uint8_t numPools = sizeof(poolDesc) / sizeof(poolDesc[0]);

/* Calculate how much memory we will need for the LL initialization */
WsfCsEnter();

LlInitRtCfg_t llCfg = {
.pBbRtCfg = &mainBbRtCfg,
.wlSizeCfg = 4,
.rlSizeCfg = 4,
.plSizeCfg = 4,
.pLlRtCfg = &mainLlRtCfg,
/* Not significant yet, only being used for memory size requirement calculation. */
.pFreeMem = WsfHeapGetFreeStartAddress(),
/* Not significant yet, only being used for memory size requirement calculation. */
.freeMemAvail = WsfHeapCountAvailable()
};

llmemUsed = LlInitSetRtCfg(&llCfg);

WsfCsExit();

/* Initial buffer configuration. */
uint16_t memUsed;
WsfCsEnter();
memUsed = WsfBufInit(numPools, poolDesc);
memUsed = WsfBufCalcSize(numPools, poolDesc);
WsfHeapAlloc(memUsed);
WsfBufInit(numPools, poolDesc);
WsfCsExit();

WsfOsInit();
WsfTimerInit();

#if (WSF_TRACE_ENABLED == TRUE)
WsfCsEnter();
memUsed = WsfBufIoUartInit(WsfHeapGetFreeStartAddress(), PLATFORM_UART_TERMINAL_BUFFER_SIZE);
WsfHeapAlloc(memUsed);
WsfHeapAlloc(PLATFORM_UART_TERMINAL_BUFFER_SIZE);
WsfBufIoUartInit(WsfHeapGetFreeStartAddress(), PLATFORM_UART_TERMINAL_BUFFER_SIZE);
WsfCsExit();

WsfTraceRegisterHandler(WsfBufIoWrite);
WsfTraceEnable(TRUE);
#endif

/* Complete the LL initialization */
WsfCsEnter();

/* Allocate the memory */
WsfHeapAlloc(llmemUsed);

/* Set the free memory pointers */
llCfg.pFreeMem = WsfHeapGetFreeStartAddress();
llCfg.freeMemAvail = WsfHeapCountAvailable();

/* Run the initialization with properly set the free memory pointers */
if (llmemUsed != LlInitControllerInit(&llCfg)) {
WSF_ASSERT(0);
}

WsfCsExit();
}

/*************************************************************************************************/
Expand Down Expand Up @@ -249,31 +290,8 @@ void setInterruptPriority(void)
/*************************************************************************************************/
int main(void)
{
uint32_t memUsed;

mainLoadConfiguration();
mainWsfInit();

#if (WSF_TRACE_ENABLED == TRUE)
WsfCsEnter();
memUsed = WsfBufIoUartInit(WsfHeapGetFreeStartAddress(), PLATFORM_UART_TERMINAL_BUFFER_SIZE);
WsfHeapAlloc(memUsed);
WsfCsExit();
#endif

WsfCsEnter();
LlInitRtCfg_t llCfg = { .pBbRtCfg = &mainBbRtCfg,
.wlSizeCfg = 4,
.rlSizeCfg = 4,
.plSizeCfg = 4,
.pLlRtCfg = &mainLlRtCfg,
.pFreeMem = WsfHeapGetFreeStartAddress(),
.freeMemAvail = WsfHeapCountAvailable() };

memUsed = LlInitControllerInit(&llCfg);
WsfHeapAlloc(memUsed);
WsfCsExit();

bdAddr_t bdAddr;
PalCfgLoadData(PAL_CFG_ID_BD_ADDR, bdAddr, sizeof(bdAddr_t));
/* Coverity[uninit_use_in_call] */
Expand Down
Loading

0 comments on commit cf5ab90

Please sign in to comment.