Skip to content

Commit

Permalink
fix(CMSIS): Declare libc function stubs as weak (#1029)
Browse files Browse the repository at this point in the history
Signed-off-by: Maureen Helm <[email protected]>
  • Loading branch information
JC-282-AD authored and EricB-ADI committed Aug 21, 2024
1 parent 4530971 commit cd1a989
Show file tree
Hide file tree
Showing 33 changed files with 325 additions and 158 deletions.
141 changes: 77 additions & 64 deletions .github/workflows/BLE_Examples_Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -616,48 +616,17 @@ jobs:
if: env.LOCK_MAX32655_B1 == 'true' || env.LOCK_MAX32655_B2 == 'true' || env.LOCK_MAX32665_B1 == 'true' || env.LOCK_MAX32690_B1 == 'true'
id: lock_boards
run: |
python3 /home/$USER/Workspace/Resource_Share/Resource_Share_multiboard.py -l -t 3600 -b max32655_board1 -b max32655_board2 -b max32665_board1 -b max32690_board_w1
#----------------------------------------------------------------------------------------------
#------------------------------| Erase all required boards at once |-----------------------------
#----------------------------------------------------------------------------------------------
- name: Erase Boards
if: steps.lock_boards.outcome == 'success'
id: erase_boards
run: |
# start with boards in known state
cd .github/workflows/scripts
echo "Erasing Main MAX32655 B1"
./mass_erase_board.sh max32655 max32655_board1
echo "Erasing Main MAX32655 B2"
./mass_erase_board.sh max32655 max32655_board2
echo "Erasing Main MAX32665 B1"
./mass_erase_board.sh max32665 max32665_board1
echo "Erasing Main MAX32690"
./mass_erase_board.sh max32690 max32690_board_w1
#----------------------------------------------------------------------------------------------

#----------------------------------------------------------------------------------------------
#----------------------------------------------------------------------------------------------
#------------------------------| Test all required boards at once |-----------------------------
#----------------------------------------------------------------------------------------------

- name: Test MAX32655 #name used for display purposes on github webpage
if: steps.lock_boards.outcome == 'success' && env.LOCK_MAX32655_B2 == 'true'
id: Test_MAX32655 #id used to reference this step in other parts of the yml
run: |
FILE=/home/$USER/Workspace/Resource_Share/boards_config.json
dut_uart=$(/usr/bin/python3 -c "import sys, json; print(json.load(open('$FILE'))['max32655_board2']['uart0'])")
dut_serial=$(/usr/bin/python3 -c "import sys, json; print(json.load(open('$FILE'))['max32655_board2']['daplink'])")
examples_to_test=(${MAX32655_EXAMPLES_TO_TEST[@]})
echo
echo
echo "Examples to be tested : ${examples_to_test[@]}"
echo "MAX32655_RUN_ALL_TEST : $MAX32655_RUN_ALL_TEST"
echo "MAX32655_DATS_CONNECTED_TEST : $MAX32655_DATS_CONNECTED_TEST "
echo "MAX32655_OTAS_CONNECTED_TEST : $MAX32655_OTAS_CONNECTED_TEST"
echo "MAX32655_BLE_FILES_CHANGED : $MAX32655_BLE_FILES_CHANGED "
echo "LOCK_MAX32655_B2 : $LOCK_MAX32655_B2 "
#set advertising names
# sed -i "s/'S'/'?'/g" Examples/MAX32655/Bluetooth/BLE_dats/dats_main.c
# sed -i "s/'S'/'?'/g" Examples/MAX32655/Bluetooth/BLE_datc/datc_main.c
# sed -i "s/'S'/'!'/g" Examples/MAX32665/Bluetooth/BLE_dats/dats_main.c
# sed -i "s/'S'/'!'/g" Examples/MAX32690/Bluetooth/BLE_datc/datc_main.c
# sed -i "s/'S'/'?'/g" Examples/MAX32655/Bluetooth/BLE_otas/dats_main.c
# sed -i "s/'S'/'?'/g" Examples/MAX32655/Bluetooth/BLE_otac/datc_main.c
# sed -i "s/'S'/'!'/g" Examples/MAX32665/Bluetooth/BLE_otas/dats_main.c
# sed -i "s/'S'/'!'/g" Examples/MAX32690/Bluetooth/BLE_otac/datc_main.c
cd .github/workflows/scripts
Expand Down Expand Up @@ -688,19 +657,26 @@ jobs:
set -e
done
#------connected tests---------
if [[ $MAX32655_DATS_CONNECTED_TEST == 'true' ]]; then
#conencted test launcher
echo "Testing MAX32655_DATS_CONNECTED_TEST"
set +e
./test_launcher.sh max32655 $dut_uart $dut_serial "dats"
let "testResult=$?"
if [ "$testResult" -ne "0" ]; then
# update failed_test count
let "numOfFailedTests+=$testResult"
failedTestList+="| MAX32655 Dats/c"
fi
set -e
- name: Flash DATS 655
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true'}}
uses: Analog-Devices-MSDK/btm-ci-scripts/actions/[email protected]
with:
board: |
max32655_board1
max32655_board2
project: |
BLE_dats
BLE_datc
suppress_output: true
build_flags: |
ADV_NAME=DAT?
ADV_NAME=DAT?
build: true
distclean: true

fi
#------connected tests---------
Expand All @@ -725,15 +701,52 @@ jobs:
echo "=============================================================================="
echo "=============================================================================="

if [[ $numOfFailedTests -ne 0 ]]; then
printf "Test completed with $numOfFailedTests failed tests located in: \r\n $failedTestList"
else
echo "Relax! ALL TESTS PASSED"
fi
echo
echo "=============================================================================="
echo "=============================================================================="
echo

- name: Erase Boards OTAS
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true' || env.MAX32665_DATS_CONNECTED_TEST == 'true' || env.MAX32690_DATS_CONNECTED_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'}}
uses: Analog-Devices-MSDK/btm-ci-scripts/actions/[email protected]
with:
board: |
max32655_board1
max32655_board2
max32665_board1
build_flags: |
ADV_NAME=OTA?
ADV_NAME=OTA?
ADV_NAME=OTA!
ADV_NAME=OTA!
project: |
BLE_otas
BLE_otac
BLE_otac
suppress_output: true

build: true
distclean: true

- name: OTAS
if: ${{env.MAX32655_DATS_CONNECTED_TEST == 'true' || env.MAX32665_DATS_CONNECTED_TEST == 'true' || env.MAX32690_DATS_CONNECTED_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
if [[ $MAX32655_OTAS_CONNECTED_TEST == 'true' ]]; then
(cd $OTAS_TEST_DIR && python3 otas_connected.py $OTAS_BOARD_655 $OTAC_BOARD_655)
fi
exit $numOfFailedTests
Expand Down
8 changes: 4 additions & 4 deletions Examples/MAX32655/Bluetooth/BLE_datc/datc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static const appSecCfg_t datcSecCfg = {
DM_KEY_DIST_IRK, /*! Initiator key distribution flags */
DM_KEY_DIST_LTK | DM_KEY_DIST_IRK, /*! Responder key distribution flags */
FALSE, /*! TRUE if Out-of-band pairing data is present */
TRUE /*! TRUE to initiate security upon connection */
INIT_SECURITY /*! TRUE to initiate security upon connection */
};

/* OOB UART parameters */
Expand Down Expand Up @@ -569,9 +569,9 @@ static void datcScanReport(dmEvt_t *pMsg)
if (!connect && ((pData = DmFindAdType(DM_ADV_TYPE_LOCAL_NAME, pMsg->scanReport.len,
pMsg->scanReport.pData)) != NULL)) {
/* check length and device name */
if (pData[DM_AD_LEN_IDX] >= 4 && (pData[DM_AD_DATA_IDX] == '6') &&
(pData[DM_AD_DATA_IDX + 1] == '9') && (pData[DM_AD_DATA_IDX + 2] == '0') &&
(pData[DM_AD_DATA_IDX + 3] == 'S')) {
char advName[] = ADV_NAME;
if (pData[DM_AD_LEN_IDX] == sizeof(advName) &&
!strncmp(advName, (char *)&(pData[DM_AD_DATA_IDX]), sizeof(advName))) {
connect = TRUE;
}
}
Expand Down
8 changes: 8 additions & 0 deletions Examples/MAX32655/Bluetooth/BLE_datc/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,11 @@ INIT_CENTRAL = 1
# Set to 1 to enable serial port trace messages
# Set to 2 to enable verbose messages
TRACE = 1

# set ADVTISEMENT name you want to connect
ADV_NAME?=DATS
PROJ_CFLAGS += -DADV_NAME=\"$(ADV_NAME)\"

### CONFIGURE security
# /*! TRUE to initiate security upon connection*/
PROJ_CFLAGS += -DINIT_SECURITY=TRUE
19 changes: 7 additions & 12 deletions Examples/MAX32655/Bluetooth/BLE_dats/dats_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static const appSecCfg_t datsSecCfg = {
DM_KEY_DIST_IRK, /*! Initiator key distribution flags */
DM_KEY_DIST_LTK | DM_KEY_DIST_IRK, /*! Responder key distribution flags */
FALSE, /*! TRUE if Out-of-band pairing data is present */
TRUE /*! TRUE to initiate security upon connection */
INIT_SECURITY /*! TRUE to initiate security upon connection */
};

/* OOB UART parameters */
Expand Down Expand Up @@ -214,15 +214,8 @@ static const uint8_t datsAdvDataDisc[] = {
};

/*! scan data, discoverable mode */
static const uint8_t datsScanDataDisc[] = {
/*! device name */
5, /*! length */
DM_ADV_TYPE_LOCAL_NAME, /*! AD type */
'D',
'A',
'T',
'S'
};
static const uint8_t deviceName[] = ADV_NAME;
static uint8_t datsScanDataDisc[sizeof(deviceName) + 2];

/**************************************************************************************************
Client Characteristic Configuration Descriptors
Expand Down Expand Up @@ -538,7 +531,9 @@ static void datsSetup(dmEvt_t *pMsg)
{
/* Initialize control information */
datsCb.restoringResList = FALSE;

memcpy(&datsScanDataDisc[2], deviceName, sizeof(deviceName));
datsScanDataDisc[0] = sizeof(deviceName);
datsScanDataDisc[1] = DM_ADV_TYPE_LOCAL_NAME;
/* set advertising and scan response data for discoverable mode */
AppAdvSetData(APP_ADV_DATA_DISCOVERABLE, sizeof(datsAdvDataDisc), (uint8_t *)datsAdvDataDisc);
AppAdvSetData(APP_SCAN_DATA_DISCOVERABLE, sizeof(datsScanDataDisc),
Expand Down Expand Up @@ -760,7 +755,7 @@ void DatsHandlerInit(wsfHandlerId_t handlerId)
AppGetBdAddr(addr);
APP_TRACE_INFO6("MAC Addr: %02x:%02x:%02x:%02x:%02x:%02x", addr[5], addr[4], addr[3], addr[2],
addr[1], addr[0]);
APP_TRACE_INFO1("Adv local name: %s", &datsScanDataDisc[2]);
APP_TRACE_INFO1("Adv local name: %s", deviceName);

/* store handler ID */
datsCb.handlerId = handlerId;
Expand Down
9 changes: 9 additions & 0 deletions Examples/MAX32655/Bluetooth/BLE_dats/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,12 @@ TRACE = 1
# Add services directory to build
IPATH += services
VPATH += services

# SET advertising name
ADV_NAME?=DATS
PROJ_CFLAGS += -DADV_NAME=\"$(ADV_NAME)\"


### CONFIGURE security
# /*! TRUE to initiate security upon connection*/
PROJ_CFLAGS += -DINIT_SECURITY=FALSE
8 changes: 4 additions & 4 deletions Examples/MAX32655/Bluetooth/BLE_otac/datc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ static const appSecCfg_t datcSecCfg = {
DM_KEY_DIST_IRK, /*! Initiator key distribution flags */
DM_KEY_DIST_LTK | DM_KEY_DIST_IRK, /*! Responder key distribution flags */
FALSE, /*! TRUE if Out-of-band pairing data is present */
TRUE /*! TRUE to initiate security upon connection */
INIT_SECURITY /*! TRUE to initiate security upon connection */
};

/*! TRUE if Out-of-band pairing data is to be sent */
Expand Down Expand Up @@ -494,9 +494,9 @@ static void datcScanReport(dmEvt_t *pMsg)
if (!connect && ((pData = DmFindAdType(DM_ADV_TYPE_LOCAL_NAME, pMsg->scanReport.len,
pMsg->scanReport.pData)) != NULL)) {
/* check length and device name */
if (pData[DM_AD_LEN_IDX] >= 4 && (pData[DM_AD_DATA_IDX] == 'O') &&
(pData[DM_AD_DATA_IDX + 1] == 'T') && (pData[DM_AD_DATA_IDX + 2] == 'A') &&
(pData[DM_AD_DATA_IDX + 3] == 'S')) {
char advName[] = ADV_NAME;
if (pData[DM_AD_LEN_IDX] == sizeof(advName) &&
!strncmp(advName, (char *)&(pData[DM_AD_DATA_IDX]), sizeof(advName))) {
connect = TRUE;
}
}
Expand Down
10 changes: 10 additions & 0 deletions Examples/MAX32655/Bluetooth/BLE_otac/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,13 @@ fw_obj: $(FW_UPDATE_OBJ)

${FW_UPDATE_OBJ}: fw_update.S ${FW_UPDATE_BIN}
${CC} ${AFLAGS} -o ${@} -c fw_update.S

# set ADVTISEMENT name you want to connect
ADV_NAME?=DATS
PROJ_CFLAGS += -DADV_NAME=\"$(ADV_NAME)\"



### CONFIGURE security
# /*! TRUE to initiate security upon connection*/
PROJ_CFLAGS += -DINIT_SECURITY=TRUE
18 changes: 7 additions & 11 deletions Examples/MAX32655/Bluetooth/BLE_otas/dats_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static const appSecCfg_t datsSecCfg = {
DM_KEY_DIST_IRK, /*! Initiator key distribution flags */
DM_KEY_DIST_LTK | DM_KEY_DIST_IRK, /*! Responder key distribution flags */
FALSE, /*! TRUE if Out-of-band pairing data is present */
TRUE /*! TRUE to initiate security upon connection */
INIT_SECURITY /*! TRUE to initiate security upon connection */
};

/*! TRUE if Out-of-band pairing data is to be sent */
Expand Down Expand Up @@ -200,15 +200,8 @@ static const uint8_t datsAdvDataDisc[] = {
};

/*! scan data, discoverable mode */
static const uint8_t datsScanDataDisc[] = {
/*! device name */
5, /*! length */
DM_ADV_TYPE_LOCAL_NAME, /*! AD type */
'O',
'T',
'A',
'S'
};
static const uint8_t deviceName[] = ADV_NAME;
static uint8_t datsScanDataDisc[sizeof(deviceName) + 2];

/**************************************************************************************************
Client Characteristic Configuration Descriptors
Expand Down Expand Up @@ -462,6 +455,9 @@ static void datsSetup(dmEvt_t *pMsg)
{
/* Initialize control information */
datsCb.restoringResList = FALSE;
memcpy(&datsScanDataDisc[2], deviceName, sizeof(deviceName));
datsScanDataDisc[0] = sizeof(deviceName);
datsScanDataDisc[1] = DM_ADV_TYPE_LOCAL_NAME;

/* set advertising and scan response data for discoverable mode */
AppAdvSetData(APP_ADV_DATA_DISCOVERABLE, sizeof(datsAdvDataDisc), (uint8_t *)datsAdvDataDisc);
Expand Down Expand Up @@ -683,7 +679,7 @@ void DatsHandlerInit(wsfHandlerId_t handlerId)
AppGetBdAddr(addr);
APP_TRACE_INFO6("MAC Addr: %02x:%02x:%02x:%02x:%02x:%02x", addr[5], addr[4], addr[3], addr[2],
addr[1], addr[0]);
APP_TRACE_INFO1("Adv local name: %s", &datsScanDataDisc[2]);
APP_TRACE_INFO1("Adv local name: %s", deviceName);

/* store handler ID */
datsCb.handlerId = handlerId;
Expand Down
9 changes: 9 additions & 0 deletions Examples/MAX32655/Bluetooth/BLE_otas/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,12 @@ bl_obj: $(BOOTLOADER_OBJ)
${BOOTLOADER_OBJ}: bl_build.S ${BOOTLOADER_BIN}
${CC} ${AFLAGS} -o ${@} -c bl_build.S
endif

# SET advertising name
ADV_NAME?=DATS
PROJ_CFLAGS += -DADV_NAME=\"$(ADV_NAME)\"


### CONFIGURE security
# /*! TRUE to initiate security upon connection*/
PROJ_CFLAGS += -DINIT_SECURITY=TRUE
8 changes: 4 additions & 4 deletions Examples/MAX32665/Bluetooth/BLE_datc/datc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static const appSecCfg_t datcSecCfg = {
DM_KEY_DIST_IRK, /*! Initiator key distribution flags */
DM_KEY_DIST_LTK | DM_KEY_DIST_IRK, /*! Responder key distribution flags */
FALSE, /*! TRUE if Out-of-band pairing data is present */
TRUE /*! TRUE to initiate security upon connection */
INIT_SECURITY /*! TRUE to initiate security upon connection */
};

/* OOB UART parameters */
Expand Down Expand Up @@ -569,9 +569,9 @@ static void datcScanReport(dmEvt_t *pMsg)
if (!connect && ((pData = DmFindAdType(DM_ADV_TYPE_LOCAL_NAME, pMsg->scanReport.len,
pMsg->scanReport.pData)) != NULL)) {
/* check length and device name */
if (pData[DM_AD_LEN_IDX] >= 4 && (pData[DM_AD_DATA_IDX] == 'D') &&
(pData[DM_AD_DATA_IDX + 1] == 'A') && (pData[DM_AD_DATA_IDX + 2] == 'T') &&
(pData[DM_AD_DATA_IDX + 3] == 'S')) {
char advName[] = ADV_NAME;
if (pData[DM_AD_LEN_IDX] == sizeof(advName) &&
!strncmp(advName, (char *)&(pData[DM_AD_DATA_IDX]), sizeof(advName))) {
connect = TRUE;
}
}
Expand Down
8 changes: 8 additions & 0 deletions Examples/MAX32665/Bluetooth/BLE_datc/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,11 @@ INIT_CENTRAL = 1
# Set to 1 to enable serial port trace messages
# Set to 2 to enable verbose messages
TRACE = 1

# set ADVTISEMENT name you want to connect
ADV_NAME?=DATS
PROJ_CFLAGS += -DADV_NAME=\"$(ADV_NAME)\"

### CONFIGURE security
# /*! TRUE to initiate security upon connection*/
PROJ_CFLAGS += -DINIT_SECURITY=TRUE
Loading

0 comments on commit cd1a989

Please sign in to comment.