From f08c2f242027fd34dfa2d7b950547d5c8fe1347d Mon Sep 17 00:00:00 2001 From: Jason Cai Date: Fri, 21 Jun 2024 11:37:25 -0500 Subject: [PATCH 01/20] configure adv name and security through project.mk, improve the connection logic to match full adv name in project.mk --- .../MAX32690/Bluetooth/BLE5_ctr/project.mk | 1 + .../MAX32690/Bluetooth/BLE_datc/datc_main.c | 11 +++++--- .../MAX32690/Bluetooth/BLE_datc/project.mk | 22 +++++++++++++++ .../MAX32690/Bluetooth/BLE_dats/dats_main.c | 27 ++++++++++--------- .../MAX32690/Bluetooth/BLE_dats/project.mk | 24 +++++++++++++++++ .../MAX32690/Bluetooth/BLE_otac/datc_main.c | 13 ++++++--- .../MAX32690/Bluetooth/BLE_otac/project.mk | 24 +++++++++++++++++ .../MAX32690/Bluetooth/BLE_otas/dats_main.c | 18 +++++-------- .../MAX32690/Bluetooth/BLE_otas/project.mk | 22 +++++++++++++++ 9 files changed, 130 insertions(+), 32 deletions(-) diff --git a/Examples/MAX32690/Bluetooth/BLE5_ctr/project.mk b/Examples/MAX32690/Bluetooth/BLE5_ctr/project.mk index 6dde0241e19..aead6a261be 100644 --- a/Examples/MAX32690/Bluetooth/BLE5_ctr/project.mk +++ b/Examples/MAX32690/Bluetooth/BLE5_ctr/project.mk @@ -14,6 +14,7 @@ SBT=0 # Enable Cordio library LIB_CORDIO = 1 +#CHIP_REVISION = a # Cordio library options BLE_HOST = 0 diff --git a/Examples/MAX32690/Bluetooth/BLE_datc/datc_main.c b/Examples/MAX32690/Bluetooth/BLE_datc/datc_main.c index 47934a08841..0590f1e4879 100644 --- a/Examples/MAX32690/Bluetooth/BLE_datc/datc_main.c +++ b/Examples/MAX32690/Bluetooth/BLE_datc/datc_main.c @@ -148,7 +148,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 */ @@ -570,11 +570,14 @@ 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') && + char advName[] = ADV_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')) { + (pData[DM_AD_DATA_IDX + 3] == 'S')) */ + if (pData[DM_AD_LEN_IDX] == sizeof(advName) + && !strncmp(advName, (char*)&(pData[DM_AD_DATA_IDX]), sizeof(advName))){ connect = TRUE; - } + } } if (connect) { diff --git a/Examples/MAX32690/Bluetooth/BLE_datc/project.mk b/Examples/MAX32690/Bluetooth/BLE_datc/project.mk index f22549e03a8..4d1ee16508f 100644 --- a/Examples/MAX32690/Bluetooth/BLE_datc/project.mk +++ b/Examples/MAX32690/Bluetooth/BLE_datc/project.mk @@ -24,3 +24,25 @@ 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 +PROJ_CFLAGS += -DADV_NAME=\"DATS\" + +### CONFIGURE security +# /*! Authentication and bonding flags */ +#PROJ_CFLAGS += -DAUTH_BOND='DM_AUTH_BOND_FLAG | DM_AUTH_SC_FLAG | DM_AUTH_MITM_FLAG' + +# /*! Initiator key distribution flags */ +#PROJ_CFLAGS += -DINIT_KEY_DIST='DM_KEY_DIST_IRK' + +# /*! Responder key distribution flags */ +#PROJ_CFLAGS += -DRESP_KEY_DIST='DM_KEY_DIST_LTK | DM_KEY_DIST_IRK' + +# /*! TRUE if Out-of band pairing data is present */ +#PROJ_CFLAGS += -DOUT_OF_BAND=FALSE + +# /*! TRUE to initiate security upon connection*/ +PROJ_CFLAGS += -DINIT_SECURITY=TRUE + + + diff --git a/Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c b/Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c index cbb22c89a85..25f9ec077b0 100644 --- a/Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c +++ b/Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c @@ -54,6 +54,8 @@ #include "tmr.h" #include "svc_sds.h" + + /************************************************************************************************** Macros **************************************************************************************************/ @@ -116,14 +118,18 @@ static const appSlaveCfg_t datsSlaveCfg = { * -DM_KEY_DIST_IRK : Distribute IRK used for privacy * -DM_KEY_DIST_CSRK : Distribute CSRK used for signed data */ + + static const appSecCfg_t datsSecCfg = { - DM_AUTH_BOND_FLAG | DM_AUTH_SC_FLAG | DM_AUTH_MITM_FLAG, /*! Authentication and bonding flags */ + DM_AUTH_BOND_FLAG | DM_AUTH_SC_FLAG | DM_AUTH_MITM_FLAG, /*! Authentication and bonding flags */ 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 */ #define OOB_BAUD 115200 #define OOB_FLOW FALSE @@ -214,15 +220,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 @@ -538,7 +537,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), @@ -760,7 +761,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; diff --git a/Examples/MAX32690/Bluetooth/BLE_dats/project.mk b/Examples/MAX32690/Bluetooth/BLE_dats/project.mk index fbf455e2956..e72a769ad78 100644 --- a/Examples/MAX32690/Bluetooth/BLE_dats/project.mk +++ b/Examples/MAX32690/Bluetooth/BLE_dats/project.mk @@ -29,3 +29,27 @@ TRACE = 1 # Add services directory to build IPATH += services VPATH += services + +# SET advertising name +PROJ_CFLAGS += -DADV_NAME=\"This\ is\ the\ real\ world\" + + +### CONFIGURE security +# /*! Authentication and bonding flags */ +#PROJ_CFLAGS += -DAUTH_BOND='DM_AUTH_BOND_FLAG | DM_AUTH_SC_FLAG | DM_AUTH_MITM_FLAG' + +# /*! Initiator key distribution flags */ +#PROJ_CFLAGS += -DINIT_KEY_DIST='DM_KEY_DIST_IRK' + +# /*! Responder key distribution flags */ +#PROJ_CFLAGS += -DRESP_KEY_DIST='DM_KEY_DIST_LTK | DM_KEY_DIST_IRK' + +# /*! TRUE if Out-of band pairing data is present */ +#PROJ_CFLAGS += -DOUT_OF_BAND=FALSE + +# /*! TRUE to initiate security upon connection*/ +PROJ_CFLAGS += -DINIT_SECURITY=TRUE + + + + diff --git a/Examples/MAX32690/Bluetooth/BLE_otac/datc_main.c b/Examples/MAX32690/Bluetooth/BLE_otac/datc_main.c index 488d6b7ee05..2fa03ec4827 100644 --- a/Examples/MAX32690/Bluetooth/BLE_otac/datc_main.c +++ b/Examples/MAX32690/Bluetooth/BLE_otac/datc_main.c @@ -56,6 +56,7 @@ #include "pal_btn.h" #include "tmr.h" + /************************************************************************************************** Macros **************************************************************************************************/ @@ -154,7 +155,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 */ @@ -494,11 +495,15 @@ 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') && + char advName[] = ADV_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')) { + (pData[DM_AD_DATA_IDX + 3] == 'S')) */ + + if (pData[DM_AD_LEN_IDX] == sizeof(advName) + && !strncmp(advName, (char*)&(pData[DM_AD_DATA_IDX]), sizeof(advName))){ connect = TRUE; - } + } } if (connect) { diff --git a/Examples/MAX32690/Bluetooth/BLE_otac/project.mk b/Examples/MAX32690/Bluetooth/BLE_otac/project.mk index e382b57fcca..2463af66aa2 100644 --- a/Examples/MAX32690/Bluetooth/BLE_otac/project.mk +++ b/Examples/MAX32690/Bluetooth/BLE_otac/project.mk @@ -63,3 +63,27 @@ ${FW_UPDATE_OBJ}: fw_update.S ${FW_UPDATE_BIN} ifeq ($(BOARD),FTHR) $(error ERR_NOTSUPPORTED: This project is not supported for the FTHR board) endif + + +# set ADVTISEMENT name you want to connect +PROJ_CFLAGS += -DADV_NAME=\"DATS\" + + + +### CONFIGURE security +# /*! Authentication and bonding flags */ +#PROJ_CFLAGS += -DAUTH_BOND='DM_AUTH_BOND_FLAG | DM_AUTH_SC_FLAG | DM_AUTH_MITM_FLAG' + +# /*! Initiator key distribution flags */ +#PROJ_CFLAGS += -DINIT_KEY_DIST='DM_KEY_DIST_IRK' + +# /*! Responder key distribution flags */ +#PROJ_CFLAGS += -DRESP_KEY_DIST='DM_KEY_DIST_LTK | DM_KEY_DIST_IRK' + +# /*! TRUE if Out-of band pairing data is present */ +#PROJ_CFLAGS += -DOUT_OF_BAND=FALSE + +# /*! TRUE to initiate security upon connection*/ +PROJ_CFLAGS += -DINIT_SECURITY=TRUE + + diff --git a/Examples/MAX32690/Bluetooth/BLE_otas/dats_main.c b/Examples/MAX32690/Bluetooth/BLE_otas/dats_main.c index aea4d4ff213..9f75e1db608 100644 --- a/Examples/MAX32690/Bluetooth/BLE_otas/dats_main.c +++ b/Examples/MAX32690/Bluetooth/BLE_otas/dats_main.c @@ -119,7 +119,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 */ @@ -195,15 +195,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 @@ -457,6 +450,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); @@ -678,7 +674,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; diff --git a/Examples/MAX32690/Bluetooth/BLE_otas/project.mk b/Examples/MAX32690/Bluetooth/BLE_otas/project.mk index f17c6967a21..244fe004d2d 100644 --- a/Examples/MAX32690/Bluetooth/BLE_otas/project.mk +++ b/Examples/MAX32690/Bluetooth/BLE_otas/project.mk @@ -59,3 +59,25 @@ endif ifeq ($(BOARD),FTHR) $(error ERR_NOTSUPPORTED: This project is not supported for the FTHR board) endif + + + +# SET advertising name +PROJ_CFLAGS += -DADV_NAME=\"This\ is\ the\ real\ world\" + + +### CONFIGURE security +# /*! Authentication and bonding flags */ +#PROJ_CFLAGS += -DAUTH_BOND='DM_AUTH_BOND_FLAG | DM_AUTH_SC_FLAG | DM_AUTH_MITM_FLAG' + +# /*! Initiator key distribution flags */ +#PROJ_CFLAGS += -DINIT_KEY_DIST='DM_KEY_DIST_IRK' + +# /*! Responder key distribution flags */ +#PROJ_CFLAGS += -DRESP_KEY_DIST='DM_KEY_DIST_LTK | DM_KEY_DIST_IRK' + +# /*! TRUE if Out-of band pairing data is present */ +#PROJ_CFLAGS += -DOUT_OF_BAND=FALSE + +# /*! TRUE to initiate security upon connection*/ +PROJ_CFLAGS += -DINIT_SECURITY=TRUE From ed988c769e20bf511bcebee3b88adf0fd3d6c519 Mon Sep 17 00:00:00 2001 From: Jason Cai Date: Fri, 21 Jun 2024 14:14:45 -0500 Subject: [PATCH 02/20] configure adv name and security through project.mk, improve the connection logic to match full adv name in project.mk --- .../MAX32665/Bluetooth/BLE_datc/datc_main.c | 13 ++++++----- .../MAX32665/Bluetooth/BLE_datc/project.mk | 19 ++++++++++++++++ .../MAX32665/Bluetooth/BLE_dats/dats_main.c | 19 ++++++---------- .../MAX32665/Bluetooth/BLE_dats/project.mk | 22 +++++++++++++++++++ .../MAX32690/Bluetooth/BLE_dats/project.mk | 3 ++- .../MAX32690/Bluetooth/BLE_otas/project.mk | 3 ++- 6 files changed, 60 insertions(+), 19 deletions(-) diff --git a/Examples/MAX32665/Bluetooth/BLE_datc/datc_main.c b/Examples/MAX32665/Bluetooth/BLE_datc/datc_main.c index 7d40b53b3ef..f2aa0450297 100644 --- a/Examples/MAX32665/Bluetooth/BLE_datc/datc_main.c +++ b/Examples/MAX32665/Bluetooth/BLE_datc/datc_main.c @@ -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 */ @@ -568,12 +568,15 @@ static void datcScanReport(dmEvt_t *pMsg) /* find device name */ 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') && + /* check length and device name */ + char advName[] = ADV_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')) { + (pData[DM_AD_DATA_IDX + 3] == 'S')) */ + if (pData[DM_AD_LEN_IDX] == sizeof(advName) + && !strncmp(advName, (char*)&(pData[DM_AD_DATA_IDX]), sizeof(advName))){ connect = TRUE; - } + } } if (connect) { diff --git a/Examples/MAX32665/Bluetooth/BLE_datc/project.mk b/Examples/MAX32665/Bluetooth/BLE_datc/project.mk index 08dab61991b..99ff79df004 100644 --- a/Examples/MAX32665/Bluetooth/BLE_datc/project.mk +++ b/Examples/MAX32665/Bluetooth/BLE_datc/project.mk @@ -24,3 +24,22 @@ 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 +PROJ_CFLAGS += -DADV_NAME=\"DATS\" + +### CONFIGURE security +# /*! Authentication and bonding flags */ +#PROJ_CFLAGS += -DAUTH_BOND='DM_AUTH_BOND_FLAG | DM_AUTH_SC_FLAG | DM_AUTH_MITM_FLAG' + +# /*! Initiator key distribution flags */ +#PROJ_CFLAGS += -DINIT_KEY_DIST='DM_KEY_DIST_IRK' + +# /*! Responder key distribution flags */ +#PROJ_CFLAGS += -DRESP_KEY_DIST='DM_KEY_DIST_LTK | DM_KEY_DIST_IRK' + +# /*! TRUE if Out-of band pairing data is present */ +#PROJ_CFLAGS += -DOUT_OF_BAND=FALSE + +# /*! TRUE to initiate security upon connection*/ +PROJ_CFLAGS += -DINIT_SECURITY=TRUE \ No newline at end of file diff --git a/Examples/MAX32665/Bluetooth/BLE_dats/dats_main.c b/Examples/MAX32665/Bluetooth/BLE_dats/dats_main.c index 65fb72c0e98..0c2dc762eba 100644 --- a/Examples/MAX32665/Bluetooth/BLE_dats/dats_main.c +++ b/Examples/MAX32665/Bluetooth/BLE_dats/dats_main.c @@ -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 */ - FALSE /*! TRUE to initiate security upon connection */ + INIT_SECURITY /*! TRUE to initiate security upon connection */ }; /* OOB UART parameters */ @@ -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 @@ -537,7 +530,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), @@ -759,7 +754,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; diff --git a/Examples/MAX32665/Bluetooth/BLE_dats/project.mk b/Examples/MAX32665/Bluetooth/BLE_dats/project.mk index ad2f370e321..a8d6efdc11b 100644 --- a/Examples/MAX32665/Bluetooth/BLE_dats/project.mk +++ b/Examples/MAX32665/Bluetooth/BLE_dats/project.mk @@ -28,3 +28,25 @@ TRACE = 1 # Add services directory to build IPATH += services VPATH += services + + +# SET advertising name +#PROJ_CFLAGS += -DADV_NAME=\"This\ is\ the\ real\ world\" +PROJ_CFLAGS += -DADV_NAME=\"DATS\" + + +### CONFIGURE security +# /*! Authentication and bonding flags */ +#PROJ_CFLAGS += -DAUTH_BOND='DM_AUTH_BOND_FLAG | DM_AUTH_SC_FLAG | DM_AUTH_MITM_FLAG' + +# /*! Initiator key distribution flags */ +#PROJ_CFLAGS += -DINIT_KEY_DIST='DM_KEY_DIST_IRK' + +# /*! Responder key distribution flags */ +#PROJ_CFLAGS += -DRESP_KEY_DIST='DM_KEY_DIST_LTK | DM_KEY_DIST_IRK' + +# /*! TRUE if Out-of band pairing data is present */ +#PROJ_CFLAGS += -DOUT_OF_BAND=FALSE + +# /*! TRUE to initiate security upon connection*/ +PROJ_CFLAGS += -DINIT_SECURITY=FALSE diff --git a/Examples/MAX32690/Bluetooth/BLE_dats/project.mk b/Examples/MAX32690/Bluetooth/BLE_dats/project.mk index e72a769ad78..97d7efe716d 100644 --- a/Examples/MAX32690/Bluetooth/BLE_dats/project.mk +++ b/Examples/MAX32690/Bluetooth/BLE_dats/project.mk @@ -31,7 +31,8 @@ IPATH += services VPATH += services # SET advertising name -PROJ_CFLAGS += -DADV_NAME=\"This\ is\ the\ real\ world\" +#PROJ_CFLAGS += -DADV_NAME=\"This\ is\ the\ real\ world\" +PROJ_CFLAGS += -DADV_NAME=\"DATS\" ### CONFIGURE security diff --git a/Examples/MAX32690/Bluetooth/BLE_otas/project.mk b/Examples/MAX32690/Bluetooth/BLE_otas/project.mk index 244fe004d2d..4deb895214e 100644 --- a/Examples/MAX32690/Bluetooth/BLE_otas/project.mk +++ b/Examples/MAX32690/Bluetooth/BLE_otas/project.mk @@ -63,7 +63,8 @@ endif # SET advertising name -PROJ_CFLAGS += -DADV_NAME=\"This\ is\ the\ real\ world\" +#PROJ_CFLAGS += -DADV_NAME=\"This\ is\ the\ real\ world\" +PROJ_CFLAGS += -DADV_NAME=\"DATS\" ### CONFIGURE security From e5669ed948f33ca624df958c9c56d125b09442c5 Mon Sep 17 00:00:00 2001 From: Jason Cai Date: Fri, 21 Jun 2024 14:15:05 -0500 Subject: [PATCH 03/20] select revision and PHY properly from project.mk --- Libraries/PeriphDrivers/max32655_files.mk | 1 - Libraries/PeriphDrivers/max32690_files.mk | 3 +++ Libraries/libs.mk | 27 +++++++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/Libraries/PeriphDrivers/max32655_files.mk b/Libraries/PeriphDrivers/max32655_files.mk index 5a19badb54f..fdf45ea2461 100644 --- a/Libraries/PeriphDrivers/max32655_files.mk +++ b/Libraries/PeriphDrivers/max32655_files.mk @@ -145,4 +145,3 @@ PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/WUT PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/WUT/wut_me17.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/WUT/wut_reva.c - diff --git a/Libraries/PeriphDrivers/max32690_files.mk b/Libraries/PeriphDrivers/max32690_files.mk index 1e3908079d9..67a944c4e09 100644 --- a/Libraries/PeriphDrivers/max32690_files.mk +++ b/Libraries/PeriphDrivers/max32690_files.mk @@ -53,6 +53,7 @@ PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/nvic_table.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/pins_me18.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/SYS/sys_me18.c + PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/ADC PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/ADC/adc_me18.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/ADC/adc_revb.c @@ -66,6 +67,8 @@ PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/CTB/ctb_me18.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/CTB/ctb_reva.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/CTB/ctb_common.c + + PERIPH_DRIVER_INCLUDE_DIR += $(SOURCE_DIR)/DMA PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/DMA/dma_me18.c PERIPH_DRIVER_C_FILES += $(SOURCE_DIR)/DMA/dma_reva.c diff --git a/Libraries/libs.mk b/Libraries/libs.mk index bb2b0d70dbf..4aec7e059b8 100644 --- a/Libraries/libs.mk +++ b/Libraries/libs.mk @@ -64,16 +64,43 @@ ifeq ($(LIB_CORDIO), 1) CORDIO_DIR ?= $(LIBS_DIR)/Cordio include $(CORDIO_DIR)/platform/targets/maxim/build/cordio_lib.mk +CHIP_REVISION ?= b +export CHIP_REVISION + +# for CHIP_REVISION a *********************************************** +ifeq ($(CHIP_REVISION),a) ifeq ($(RISCV_CORE),) + ifeq ($(MFLOAT_ABI),hard) LIBS += $(LIBS_DIR)/BlePhy/$(CHIP_UC)/libphy_hard.a else LIBS += $(LIBS_DIR)/BlePhy/$(CHIP_UC)/libphy.a endif + else LIBS += $(LIBS_DIR)/BlePhy/$(CHIP_UC)/libphy_riscv.a endif +#********************************************************************* + +# for CHIP_REVISION b *************************************************** +else ifeq ($(CHIP_REVISION),b) + +ifeq ($(RISCV_CORE),) + +ifeq ($(MFLOAT_ABI),hard) +LIBS += $(LIBS_DIR)/BlePhy/$(CHIP_UC)/libphy_hard.a +else +LIBS += $(LIBS_DIR)/BlePhy/$(CHIP_UC)/libphy.a +endif + +else +LIBS += $(LIBS_DIR)/BlePhy/$(CHIP_UC)/libphy_riscv.a +endif +#************************************************************************** +endif + + ifeq ($(CODED_PHY_DEMO),1) PROJ_CFLAGS += -DAPP_CODED_PHY_DEMO=1 else From 7570b6c8ecf9ae018020520f35586fd4d546dc80 Mon Sep 17 00:00:00 2001 From: Jason Cai Date: Thu, 27 Jun 2024 13:18:34 -0500 Subject: [PATCH 04/20] add autotest to test all examples --- .github/workflows/scripts/example_tester.sh | 490 ++++++++++++++++++++ Examples/MAX32690/ADC/main.c | 4 +- Examples/MAX32690/ADC/project.mk | 3 + Examples/MAX32690/SPI/main.c | 20 +- Examples/MAX32690/SPI/project.mk | 4 + Examples/MAX32690/SPI_v2/main.c | 17 +- Examples/MAX32690/SPI_v2/project.mk | 4 + Examples/MAX32690/UART/main.c | 3 +- Examples/MAX32690/UART/project.mk | 4 + 9 files changed, 522 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/scripts/example_tester.sh diff --git a/.github/workflows/scripts/example_tester.sh b/.github/workflows/scripts/example_tester.sh new file mode 100644 index 00000000000..27b0d3db15f --- /dev/null +++ b/.github/workflows/scripts/example_tester.sh @@ -0,0 +1,490 @@ +#! /usr/bin/bash + +<<"CONFIGURATION" +The following is the configuration for hardware (max32690): +remove JP7(RX_EN) and install JP8(TX_EN) headers +Install headers JP9 and JP10 to SDA and SCL respectively. +You must connect P1.8->P2.8 (SCL) and P1.7->P2.7 (SCL). +Connect pins P2.12->P1.9 for UART test +connect MISO (P2.27) and MOSI (P2.28) pins +Apply an input voltage between 0 and 1.25V to pin labeled 0 of the JH6 (Analog) header. for ADC +CONFIGURATION + + +# variable for configuration +baudRate=115200 +timeLimit=5 +timeLimitICC=30 #ICC needs around 20s to finish the test +boardVersion=max32690 +#boardName=max32690-1 +boardName=$1 +uartPort=$(resource_manager -g $boardName.console_port) +target_uc=$(resource_manager -g $boardName.target) +MAXIM_PATH=/home/jcai/Workspace/msdk +Path=$MAXIM_PATH/Examples/$target_uc + +# variable for testing purpose +tempFile=.temp.txt +result_UART_INTERRUPT='not tested' +result_UART_DMA='not tested' +result_HelloWorld='not tested' +result_HelloWorld_Cpp='not tested' +result_TRNG='not tested' +result_I2C='not tested' +result_SPI_POLLING='not tested' +result_SPI_INTERRUPT='not tested' +result_SPI_DMA='not tested' +result_SPI_V2_POLLING='not tested' #this is only for max32690 +result_SPI_V2_INTERRUPT='not tested' #this is only for max32690 +result_SPI_V2_DMA='not tested' #this is only for max32690 +result_ICC='not tested' +result_Hash='not tested' +result_DMA='not tested' +result_CRC='not tested' +result_ADC_POLLING='not tested' +result_ADC_INTERRUPT='not tested' +result_ADC_DMA='not tested' +result_Lib_Gen='not tested' +result_Lib_Use='not tested' + +function init() { + # print the testcase + echo "-------------------------------------------------------------------" + echo "Start testing $1 Example:" + # clean the temp file + rm -rf $tempFile + sleep 2 + + # do initialization, compiler and flash the code + testName=$1 + if [[ $testName != Library_Use ]] + then + make -C $Path/$testName distclean + + if [[ $1 = "SPI" || $1 = "SPI_v2" || $1 = "ADC" || $1 = "UART" ]]; + then + make -C $Path/$testName METHOD=$2 + else + make -C $Path/$testName + fi + fi + + if [[ $testName != Library_Generate && $testName != Library_Use ]] + then + stty -F $uartPort $baudRate + ocdflash $boardName $Path/$testName/build/$boardVersion.elf + if [[ $testName = ICC ]] + then + timeout $timeLimitICC cat $uartPort > $tempFile + else + timeout $timeLimit cat $uartPort > $tempFile + fi + fi +} + +function test_Hello_World() { + init Hello_World + + # start testing the output + grep "Hello World!" $tempFile + if [[ $? -eq 0 ]]; + then + result_HelloWorld='pass' + else + result_HelloWorld='fail' + fi + + printf "Test result for Hello_World: $result_HelloWorld\n" + +} + +function test_Hello_World_Cpp() { + init Hello_World_Cpp + + # start testing the output + grep "C++ Hello World Example" $tempFile + if [[ $? -eq 0 ]]; + then + result_HelloWorld_Cpp='pass' + else + result_HelloWorld_Cpp='fail' + fi + + printf "Test result for Hello_World_Cpp: $result_HelloWorld_Cpp\n" + +} + +function test_UART() { + init UART INTERRUPT + + # start testing the output + grep "Example Succeeded" $tempFile + if [[ $? -eq 0 ]]; + then + result_UART_INTERRUPT='pass' + else + result_UART_INTERRUPT='fail' + fi + + printf "Test result for UART_INTERRUPT: $result_UART_INTERRUPT\n" + + init UART DMA + + # start testing the output + grep "Example Succeeded" $tempFile + if [[ $? -eq 0 ]]; + then + result_UART_DMA='pass' + else + result_UART_DMA='fail' + fi + + printf "Test result for UART_DMA: $result_UART_DMA\n" + +} + +function test_TRNG() { + init TRNG + + # start testing the output + grep "Test Complete" $tempFile + if [[ $? -eq 0 ]]; + then + result_TRNG='pass' + else + result_TRNG='fail' + fi + + printf "Test result for TRNG: $result_TRNG\n" + +} + + +function test_I2C() { + init I2C + + # start testing the output + grep "I2C Transaction Successful" $tempFile + if [[ $? -eq 0 ]]; + then + result_I2C='pass' + else + result_I2C='fail' + fi + + printf "Test result for I2C: $result_I2C\n" + +} + +function test_SPI() { + init SPI MASTERSYNC + + # start testing the output + grep "16 Bits Transaction Successful" $tempFile + if [[ $? -eq 0 ]]; + then + result_SPI_POLLING='pass' + else + result_SPI_POLLING='fail' + fi + + printf "Test result for SPI_POLLING: $result_SPI_POLLING\n" + + init SPI MASTERASYNC + + # start testing the output + grep "16 Bits Transaction Successful" $tempFile + if [[ $? -eq 0 ]]; + then + result_SPI_INTERRUPT='pass' + else + result_SPI_INTERRUPT='fail' + fi + + printf "Test result for SPI_INTERRUPT: $result_SPI_INTERRUPT\n" + + init SPI MASTERDMA + + # start testing the output + grep "16 Bits Transaction Successful" $tempFile + if [[ $? -eq 0 ]]; + then + result_SPI_DMA='pass' + else + result_SPI_DMA='fail' + fi + + printf "Test result for SPI_DMA: $result_SPI_DMA\n" + +} + +function test_SPI_V2() { + init SPI_v2 CONTROLLER_SYNC + + # start testing the output + grep "16 Bits Transaction Successful" $tempFile + if [[ $? -eq 0 ]]; + then + result_SPI_V2_POLLING='pass' + else + result_SPI_V2_POLLING='fail' + fi + + printf "Test result for SPI_v2_POLLING: $result_SPI_V2_POLLING\n" + + init SPI_v2 CONTROLLER_ASYNC + + # start testing the output + grep "16 Bits Transaction Successful" $tempFile + if [[ $? -eq 0 ]]; + then + result_SPI_V2_INTERRUPT='pass' + else + result_SPI_V2_INTERRUPT='fail' + fi + + printf "Test result for SPI_v2_INTERRUPT: $result_SPI_V2_INTERRUPT\n" + + init SPI_v2 CONTROLLER_DMA + + # start testing the output + grep "16 Bits Transaction Successful" $tempFile + if [[ $? -eq 0 ]]; + then + result_SPI_V2_DMA='pass' + else + result_SPI_V2_DMA='fail' + fi + + printf "Test result for SPI_v2_DMA: $result_SPI_V2_DMA\n" + +} +function test_ICC() { + init ICC + + # start testing the output + grep "Example Succeeded" $tempFile + if [[ $? -eq 0 ]]; + then + result_ICC='pass' + else + result_ICC='fail' + fi + + printf "Test result for ICC: $result_ICC\n" + +} + +function test_Hash() { + init Hash + + # start testing the output + grep "Example Succeeded" $tempFile + if [[ $? -eq 0 ]]; + then + result_Hash='pass' + else + result_Hash='fail' + fi + + printf "Test result for Hash: $result_Hash\n" + +} + +function test_DMA() { + init DMA + + # start testing the output + grep "Example Succeeded" $tempFile + if [[ $? -eq 0 ]]; + then + result_DMA='pass' + else + result_DMA='fail' + fi + + printf "Test result for DMA: $result_DMA\n" + +} + +function test_CRC() { + init CRC + + # start testing the output + grep "Example Succeeded" $tempFile + if [[ $? -eq 0 ]]; + then + result_CRC='pass' + else + result_CRC='fail' + fi + + printf "Test result for CRC: $result_CRC\n" + +} + + +function test_ADC() { + + init ADC POLLING + + # start testing the output + result_ADC_POLLING='pass' + grep "Running Single Channel Example" $tempFile + if [[ $? -ne 0 ]]; + then + result_ADC_POLLING='fail' + fi + + grep "Running Temperature Sensor Example" $tempFile + if [[ $? -ne 0 ]]; + then + result_ADC_POLLING='fail' + fi + + grep "Running Multi Channel Example" $tempFile + if [[ $? -ne 0 ]]; + then + result_ADC_POLLING='fail' + fi + printf "Test result for ADC_POLLING: $result_ADC_POLLING\n" + + init ADC INTERRUPT + + # start testing the output + result_ADC_INTERRUPT='pass' + grep "Running Single Channel Example" $tempFile + if [[ $? -ne 0 ]]; + then + result_ADC_INTERRUPT='fail' + fi + + grep "Running Temperature Sensor Example" $tempFile + if [[ $? -ne 0 ]]; + then + result_ADC_INTERRUPT='fail' + fi + + grep "Running Multi Channel Example" $tempFile + if [[ $? -ne 0 ]]; + then + result_ADC_INTERRUPT='fail' + fi + printf "Test result for ADC_INTERRUPT: $result_ADC_INTERRUPT\n" + + init ADC DMA + + # start testing the output + result_ADC_DMA='pass' + grep "Running Single Channel Example" $tempFile + if [[ $? -ne 0 ]]; + then + result_ADC_DMA='fail' + fi + + grep "Running Temperature Sensor Example" $tempFile + if [[ $? -ne 0 ]]; + then + result_ADC_DMA='fail' + fi + + grep "Running Multi Channel Example" $tempFile + if [[ $? -ne 0 ]]; + then + result_ADC_DMA='fail' + fi + printf "Test result for ADC_DMA: $result_ADC_DMA\n" +} + +function test_Lib_Gen() { + init Library_Generate + + # start testing the output + find $Path/$testName/build/$boardVersion.a + if [[ $? -eq 0 ]]; + then + result_Lib_Gen='pass' + else + result_Lib_Gen='fail' + fi + + printf "Test result for Library_Generate: $result_Lib_Gen\n" + +} + +function test_Lib_Use() { + init Library_Use + + # start testing the output + make -C $Path/$testName distclean + make -C $Path/$testName + if [[ $? -eq 0 ]]; + then + result_Lib_Use='pass' + else + result_Lib_Use='fail' + fi + + printf "Test result for Library_Use: $result_Lib_Use\n" + +} + +function summary() { + printf "*************************Result Summary****************************\n" + printf "Test result for Hello_World: $result_HelloWorld\n" + printf "Test result for Hello_World_Cpp: $result_HelloWorld_Cpp\n" + printf "Test result for UART_INTERRUPT: $result_UART_INTERRUPT\n" + printf "Test result for UART_DMA: $result_UART_DMA\n" + printf "Test result for TRNG: $result_TRNG\n" + printf "Test result for I2C: $result_I2C\n" + printf "Test result for SPI_POLLING: $result_SPI_POLLING\n" + printf "Test result for SPI_INTERRUPT: $result_SPI_INTERRUPT\n" + printf "Test result for SPI_DMA: $result_SPI_DMA\n" + if [[ $boardVersion = max32690 ]] + then + printf "Test result for SPI_v2_POLLING: $result_SPI_V2_POLLING\n" + printf "Test result for SPI_v2_INTERRUPT: $result_SPI_V2_INTERRUPT\n" + printf "Test result for SPI_v2_DMA: $result_SPI_V2_DMA\n" + fi + printf "Test result for ICC: $result_ICC\n" + printf "Test result for Hash: $result_Hash\n" + printf "Test result for DMA: $result_DMA\n" + printf "Test result for CRC: $result_CRC\n" + printf "Test result for ADC_POLLING: $result_ADC_POLLING\n" + printf "Test result for ADC_INTERRUPT: $result_ADC_INTERRUPT\n" + printf "Test result for ADC_DMA: $result_ADC_DMA\n" + printf "Test result for Library_Generate: $result_Lib_Gen\n" + printf "Test result for Library_Use: $result_Lib_Use\n" + +} + +function main() { + test_UART + if [[ $result_UART_INTERRUPT = 'fail' ]] + then + printf "Since UART INTERRUPT test fails, example test stops. " + return + fi + test_Hello_World + test_Hello_World_Cpp + test_TRNG + test_I2C + test_SPI + if [[ $boardVersion = max32690 ]] + then + test_SPI_V2 + fi + test_Hash + test_DMA + test_CRC + test_ADC + test_ICC + test_Lib_Gen + test_Lib_Use + + summary + # clean the temp file + rm -rf $tempFile +} + +main diff --git a/Examples/MAX32690/ADC/main.c b/Examples/MAX32690/ADC/main.c index d25f5be923b..47a0a4ad966 100644 --- a/Examples/MAX32690/ADC/main.c +++ b/Examples/MAX32690/ADC/main.c @@ -35,10 +35,10 @@ #include "fcr_regs.h" #include "led.h" #include "tmr.h" - +#include "nvic_table.h" /***** Definitions *****/ -#define POLLING // Uncomment to perform ADC conversions using blocking/polling method +//#define POLLING // Uncomment to perform ADC conversions using blocking/polling method // #define INTERRUPT // Uncomment to perform ADC conversions using interrupt driven method // #define DMA // Uncomment to perform ADC conversions using DMA driven method. diff --git a/Examples/MAX32690/ADC/project.mk b/Examples/MAX32690/ADC/project.mk index 96eb02eae1d..4cc4eee9c3c 100644 --- a/Examples/MAX32690/ADC/project.mk +++ b/Examples/MAX32690/ADC/project.mk @@ -13,3 +13,6 @@ # For more information on how sing process works, see # https://www.analog.com/en/education/education-library/videos/6313214207112.html SBT=0 + +METHOD ?= POLLING +PROJ_CFLAGS += -D$(METHOD) \ No newline at end of file diff --git a/Examples/MAX32690/SPI/main.c b/Examples/MAX32690/SPI/main.c index 31d31ebe228..0d249567748 100644 --- a/Examples/MAX32690/SPI/main.c +++ b/Examples/MAX32690/SPI/main.c @@ -41,16 +41,12 @@ #include "led.h" /***** Preprocessors *****/ -#define MASTERSYNC 1 -#define MASTERASYNC 0 -#define MASTERDMA 0 +//#define MASTERSYNC 1 +//#define MASTERASYNC 0 +//#define MASTERDMA 0 +// define three METHOD above in project.mk +// MASTERSYNC is default -#if (!(MASTERSYNC || MASTERASYNC || MASTERDMA)) -#error "You must set either MASTERSYNC or MASTERASYNC or MASTERDMA to 1." -#endif -#if ((MASTERSYNC && MASTERASYNC) || (MASTERASYNC && MASTERDMA) || (MASTERDMA && MASTERSYNC)) -#error "You must select either MASTERSYNC or MASTERASYNC or MASTERDMA, not all 3." -#endif /***** Definitions *****/ #define DATA_LEN 100 // Words #define DATA_VALUE 0xA5A5 // This is for master mode only... @@ -153,11 +149,11 @@ int main(void) return retVal; } -#if MASTERSYNC +#ifdef MASTERSYNC MXC_SPI_MasterTransaction(&req); #endif -#if MASTERASYNC +#ifdef MASTERASYNC MXC_NVIC_SetVector(SPI_IRQ, SPI_IRQHandler); NVIC_EnableIRQ(SPI_IRQ); MXC_SPI_MasterTransactionAsync(&req); @@ -166,7 +162,7 @@ int main(void) #endif -#if MASTERDMA +#ifdef MASTERDMA MXC_DMA_ReleaseChannel(0); MXC_DMA_ReleaseChannel(1); diff --git a/Examples/MAX32690/SPI/project.mk b/Examples/MAX32690/SPI/project.mk index 96eb02eae1d..f5d5f71759c 100644 --- a/Examples/MAX32690/SPI/project.mk +++ b/Examples/MAX32690/SPI/project.mk @@ -13,3 +13,7 @@ # For more information on how sing process works, see # https://www.analog.com/en/education/education-library/videos/6313214207112.html SBT=0 + + +METHOD ?= MASTERSYNC +PROJ_CFLAGS += -D$(METHOD) \ No newline at end of file diff --git a/Examples/MAX32690/SPI_v2/main.c b/Examples/MAX32690/SPI_v2/main.c index 282032c1bb1..2f7c674e46d 100644 --- a/Examples/MAX32690/SPI_v2/main.c +++ b/Examples/MAX32690/SPI_v2/main.c @@ -37,18 +37,11 @@ #include "led.h" /***** Preprocessors *****/ -#define CONTROLLER_SYNC 1 -#define CONTROLLER_ASYNC 0 -#define CONTROLLER_DMA 0 - -// Preprocessor Error Checking -#if (!(CONTROLLER_SYNC || CONTROLLER_ASYNC || CONTROLLER_DMA)) -#error "You must set either CONTROLLER_SYNC or CONTROLLER_ASYNC or CONTROLLER_DMA to 1." -#endif -#if ((CONTROLLER_SYNC && CONTROLLER_ASYNC) || (CONTROLLER_ASYNC && CONTROLLER_DMA) || \ - (CONTROLLER_DMA && CONTROLLER_SYNC)) -#error "You must select either CONTROLLER_SYNC or CONTROLLER_ASYNC or CONTROLLER_DMA, not all 3." -#endif +//#define CONTROLLER_SYNC +//#define CONTROLLER_ASYNC +//#define CONTROLLER_DMA +// define three METHOD above in project.mk +// CONTROLLER_SYNC is default /***** Definitions *****/ #define DATA_LEN 100 // Words diff --git a/Examples/MAX32690/SPI_v2/project.mk b/Examples/MAX32690/SPI_v2/project.mk index a607748507b..2a6864ac9fd 100644 --- a/Examples/MAX32690/SPI_v2/project.mk +++ b/Examples/MAX32690/SPI_v2/project.mk @@ -11,3 +11,7 @@ # Build SPI v2 library for example. MXC_SPI_VERSION = v2 + + +METHOD ?= CONTROLLER_SYNC +PROJ_CFLAGS += -D$(METHOD) \ No newline at end of file diff --git a/Examples/MAX32690/UART/main.c b/Examples/MAX32690/UART/main.c index 8823637331b..c3617152853 100644 --- a/Examples/MAX32690/UART/main.c +++ b/Examples/MAX32690/UART/main.c @@ -37,7 +37,8 @@ #include "nvic_table.h" /***** Definitions *****/ -// #define DMA +// to enable DMA, define in project.mk +// INTERRUPT is default in project.mk #define UART_BAUD 115200 #define BUFF_SIZE 1024 diff --git a/Examples/MAX32690/UART/project.mk b/Examples/MAX32690/UART/project.mk index 42b5536113b..fa98fb50d77 100644 --- a/Examples/MAX32690/UART/project.mk +++ b/Examples/MAX32690/UART/project.mk @@ -17,3 +17,7 @@ SBT=0 ifeq ($(BOARD),FTHR) $(error ERR_NOTSUPPORTED: This project is not supported for the FTHR board) endif + + +METHOD ?= INTERRUPT +PROJ_CFLAGS += -D$(METHOD) From 5bbe5ffbabeb4d584de4c194d17ce0d6b43a30b6 Mon Sep 17 00:00:00 2001 From: JC-282-AD Date: Thu, 27 Jun 2024 19:26:39 +0000 Subject: [PATCH 05/20] clang-format bot reformatting. --- Examples/MAX32665/Bluetooth/BLE_datc/datc_main.c | 4 +--- Examples/MAX32690/Bluetooth/BLE_datc/datc_main.c | 2 +- Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c | 7 +------ Examples/MAX32690/Bluetooth/BLE_otac/datc_main.c | 3 +-- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/Examples/MAX32665/Bluetooth/BLE_datc/datc_main.c b/Examples/MAX32665/Bluetooth/BLE_datc/datc_main.c index 8fd80a9e0ca..c5443651ef1 100644 --- a/Examples/MAX32665/Bluetooth/BLE_datc/datc_main.c +++ b/Examples/MAX32665/Bluetooth/BLE_datc/datc_main.c @@ -568,14 +568,12 @@ static void datcScanReport(dmEvt_t *pMsg) /* find device name */ if (!connect && ((pData = DmFindAdType(DM_ADV_TYPE_LOCAL_NAME, pMsg->scanReport.len, pMsg->scanReport.pData)) != NULL)) { - /* check length and device name */ char advName[] = ADV_NAME; if (pData[DM_AD_LEN_IDX] == sizeof(advName) && !strncmp(advName, (char *)&(pData[DM_AD_DATA_IDX]), sizeof(advName))) { - connect = TRUE; - } + } } if (connect) { diff --git a/Examples/MAX32690/Bluetooth/BLE_datc/datc_main.c b/Examples/MAX32690/Bluetooth/BLE_datc/datc_main.c index ea6a66427bc..9702c94baeb 100644 --- a/Examples/MAX32690/Bluetooth/BLE_datc/datc_main.c +++ b/Examples/MAX32690/Bluetooth/BLE_datc/datc_main.c @@ -574,7 +574,7 @@ static void datcScanReport(dmEvt_t *pMsg) if (pData[DM_AD_LEN_IDX] == sizeof(advName) && !strncmp(advName, (char *)&(pData[DM_AD_DATA_IDX]), sizeof(advName))) { connect = TRUE; - } + } } if (connect) { diff --git a/Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c b/Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c index ad9e3b464cf..385b79dc7ae 100644 --- a/Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c +++ b/Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c @@ -54,8 +54,6 @@ #include "tmr.h" #include "svc_sds.h" - - /************************************************************************************************** Macros **************************************************************************************************/ @@ -119,17 +117,14 @@ static const appSlaveCfg_t datsSlaveCfg = { * -DM_KEY_DIST_CSRK : Distribute CSRK used for signed data */ - static const appSecCfg_t datsSecCfg = { - DM_AUTH_BOND_FLAG | DM_AUTH_SC_FLAG | DM_AUTH_MITM_FLAG, /*! Authentication and bonding flags */ + DM_AUTH_BOND_FLAG | DM_AUTH_SC_FLAG | DM_AUTH_MITM_FLAG, /*! Authentication and bonding flags */ 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 */ INIT_SECURITY /*! TRUE to initiate security upon connection */ }; - - /* OOB UART parameters */ #define OOB_BAUD 115200 #define OOB_FLOW FALSE diff --git a/Examples/MAX32690/Bluetooth/BLE_otac/datc_main.c b/Examples/MAX32690/Bluetooth/BLE_otac/datc_main.c index ec78dcb8eb5..990b90693d9 100644 --- a/Examples/MAX32690/Bluetooth/BLE_otac/datc_main.c +++ b/Examples/MAX32690/Bluetooth/BLE_otac/datc_main.c @@ -56,7 +56,6 @@ #include "pal_btn.h" #include "tmr.h" - /************************************************************************************************** Macros **************************************************************************************************/ @@ -499,7 +498,7 @@ static void datcScanReport(dmEvt_t *pMsg) if (pData[DM_AD_LEN_IDX] == sizeof(advName) && !strncmp(advName, (char *)&(pData[DM_AD_DATA_IDX]), sizeof(advName))) { connect = TRUE; - } + } } if (connect) { From d94edd48140da1130925d4ca230a90681a0c253e Mon Sep 17 00:00:00 2001 From: Jason Cai Date: Thu, 27 Jun 2024 14:42:52 -0500 Subject: [PATCH 06/20] removed duplicated code --- Libraries/libs.mk | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/Libraries/libs.mk b/Libraries/libs.mk index d0e3ddfe651..884925a849f 100644 --- a/Libraries/libs.mk +++ b/Libraries/libs.mk @@ -104,23 +104,6 @@ endif #********************************************************************* -# for CHIP_REVISION b *************************************************** -else ifeq ($(CHIP_REVISION),b) - -ifeq ($(RISCV_CORE),) - -ifeq ($(MFLOAT_ABI),hard) -LIBS += $(LIBS_DIR)/BlePhy/$(CHIP_UC)/libphy_hard.a -else -LIBS += $(LIBS_DIR)/BlePhy/$(CHIP_UC)/libphy.a -endif - -else -LIBS += $(LIBS_DIR)/BlePhy/$(CHIP_UC)/libphy_riscv.a -endif -#************************************************************************** -endif - ifeq ($(CODED_PHY_DEMO),1) PROJ_CFLAGS += -DAPP_CODED_PHY_DEMO=1 From 1a0097c26929f748b67ab8776e0e21021c1af08c Mon Sep 17 00:00:00 2001 From: Jason Cai Date: Fri, 28 Jun 2024 09:36:26 -0500 Subject: [PATCH 07/20] first version example_test.yml file --- .github/workflows/example_tester.yml | 82 ++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/example_tester.yml diff --git a/.github/workflows/example_tester.yml b/.github/workflows/example_tester.yml new file mode 100644 index 00000000000..db9ad27ae3a --- /dev/null +++ b/.github/workflows/example_tester.yml @@ -0,0 +1,82 @@ +############################################################################### +# +# Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by +# Analog Devices, Inc.), +# Copyright (C) 2023-2024 Analog Devices, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +############################################################################## + +name: Basic Examples Test + +# Cancels workflows in progress that are in the same PR +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "main" branch + pull_request: + branches: + - main + paths-ignore: + # Any files in a docs directory anywhere in the repository. + - "**/docs/**" + - "**/Documentation/**" + # Any README.md file anywhere in the repository. + - "**/README.md" + # Any .pdf file anywhere in the repository. + - "**/*.pdf" + # Any .yml file anywhere in the repository. + # can comment this out when testing changes to THIS yml file + - "**/*.yml" + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + + + + +jobs: + Example_Tests: + # The type of runner that the job will run on + runs-on: [self-hosted] + if: github.event.pull_request.draft == false + + + steps: + - uses: actions/checkout@v4 + with: + submodules: false + repository: analogdevicesinc/msdk + fetch-depth: 0 + + + + - name: run_example_test + run: | + bash .github/workflows/scripts/example_tester.sh max32690-1 + + + + + + + + + + + + From 173a893054fae4def3abc0400d4f0e4bb1506920 Mon Sep 17 00:00:00 2001 From: Jason Cai Date: Fri, 28 Jun 2024 09:46:37 -0500 Subject: [PATCH 08/20] change the run on --- .github/workflows/example_tester.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/example_tester.yml b/.github/workflows/example_tester.yml index db9ad27ae3a..4e85b5f6df4 100644 --- a/.github/workflows/example_tester.yml +++ b/.github/workflows/example_tester.yml @@ -52,7 +52,7 @@ on: jobs: Example_Tests: # The type of runner that the job will run on - runs-on: [self-hosted] + runs-on: ubuntu-18.04 if: github.event.pull_request.draft == false From 22e49a0d0d9db1d4f329032a68f0d8d715dfde58 Mon Sep 17 00:00:00 2001 From: Jason Cai Date: Fri, 28 Jun 2024 10:05:20 -0500 Subject: [PATCH 09/20] change run on --- .github/workflows/example_tester.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/example_tester.yml b/.github/workflows/example_tester.yml index 4e85b5f6df4..03ed9b5858a 100644 --- a/.github/workflows/example_tester.yml +++ b/.github/workflows/example_tester.yml @@ -52,7 +52,7 @@ on: jobs: Example_Tests: # The type of runner that the job will run on - runs-on: ubuntu-18.04 + runs-on: [self-hosted] if: github.event.pull_request.draft == false @@ -67,7 +67,7 @@ jobs: - name: run_example_test run: | - bash .github/workflows/scripts/example_tester.sh max32690-1 + bash .github/workflows/scripts/example_tester.sh max32690_board_ex From 26e1a5fcb08b5de6c1fbf5d8b8c7cd19fddaf00a Mon Sep 17 00:00:00 2001 From: Jason Cai Date: Fri, 28 Jun 2024 10:17:41 -0500 Subject: [PATCH 10/20] set the max path --- .github/workflows/example_tester.yml | 4 +++- .github/workflows/scripts/example_tester.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/example_tester.yml b/.github/workflows/example_tester.yml index 03ed9b5858a..334f87344eb 100644 --- a/.github/workflows/example_tester.yml +++ b/.github/workflows/example_tester.yml @@ -47,7 +47,8 @@ on: workflow_dispatch: - +env: + MAXIM_PATH: . jobs: Example_Tests: @@ -67,6 +68,7 @@ jobs: - name: run_example_test run: | + pwd bash .github/workflows/scripts/example_tester.sh max32690_board_ex diff --git a/.github/workflows/scripts/example_tester.sh b/.github/workflows/scripts/example_tester.sh index 27b0d3db15f..019be1446da 100644 --- a/.github/workflows/scripts/example_tester.sh +++ b/.github/workflows/scripts/example_tester.sh @@ -20,7 +20,7 @@ boardVersion=max32690 boardName=$1 uartPort=$(resource_manager -g $boardName.console_port) target_uc=$(resource_manager -g $boardName.target) -MAXIM_PATH=/home/jcai/Workspace/msdk +#MAXIM_PATH=/home/jcai/Workspace/msdk Path=$MAXIM_PATH/Examples/$target_uc # variable for testing purpose From fbb24e4064bf1344551fec6d99a4e972cdc33af3 Mon Sep 17 00:00:00 2001 From: Jason Cai Date: Fri, 28 Jun 2024 10:21:46 -0500 Subject: [PATCH 11/20] test code --- .github/workflows/example_tester.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/example_tester.yml b/.github/workflows/example_tester.yml index 334f87344eb..dd0cbfe32ee 100644 --- a/.github/workflows/example_tester.yml +++ b/.github/workflows/example_tester.yml @@ -69,6 +69,7 @@ jobs: - name: run_example_test run: | pwd + ls bash .github/workflows/scripts/example_tester.sh max32690_board_ex From 9004d2a5907c741ba2d9e0ad5bc3aaf57a0ac37f Mon Sep 17 00:00:00 2001 From: Jason Cai Date: Fri, 28 Jun 2024 10:30:38 -0500 Subject: [PATCH 12/20] set PATH --- .github/workflows/example_tester.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/example_tester.yml b/.github/workflows/example_tester.yml index dd0cbfe32ee..3c2d26840d3 100644 --- a/.github/workflows/example_tester.yml +++ b/.github/workflows/example_tester.yml @@ -48,7 +48,7 @@ on: env: - MAXIM_PATH: . + MAXIM_PATH: '' jobs: Example_Tests: @@ -58,13 +58,15 @@ jobs: steps: + - uses: actions/checkout@v4 with: submodules: false repository: analogdevicesinc/msdk fetch-depth: 0 - + - name: Set MAXIM_PATH + run: echo "MAXIM_PATH=$(pwd)" >> $GITHUB_ENV - name: run_example_test run: | From 3ddcc762fffa052a730c56496bffb540ca2d7500 Mon Sep 17 00:00:00 2001 From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com> Date: Fri, 28 Jun 2024 10:39:05 -0500 Subject: [PATCH 13/20] Update example_tester.yml --- .github/workflows/example_tester.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/example_tester.yml b/.github/workflows/example_tester.yml index 3c2d26840d3..27710820a7a 100644 --- a/.github/workflows/example_tester.yml +++ b/.github/workflows/example_tester.yml @@ -66,7 +66,9 @@ jobs: fetch-depth: 0 - name: Set MAXIM_PATH - run: echo "MAXIM_PATH=$(pwd)" >> $GITHUB_ENV + run: | + echo "MAXIM_PATH=$(pwd)" >> $GITHUB_ENV + printenv - name: run_example_test run: | From 1b7ad73555883bd5fee7b2221b2b856ae2bf0d40 Mon Sep 17 00:00:00 2001 From: Jason Cai Date: Fri, 28 Jun 2024 11:48:25 -0500 Subject: [PATCH 14/20] add exit error code --- .github/workflows/example_tester.yml | 2 -- .github/workflows/scripts/example_tester.sh | 33 +++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/example_tester.yml b/.github/workflows/example_tester.yml index 3c2d26840d3..2505c2c762c 100644 --- a/.github/workflows/example_tester.yml +++ b/.github/workflows/example_tester.yml @@ -70,8 +70,6 @@ jobs: - name: run_example_test run: | - pwd - ls bash .github/workflows/scripts/example_tester.sh max32690_board_ex diff --git a/.github/workflows/scripts/example_tester.sh b/.github/workflows/scripts/example_tester.sh index 019be1446da..e22ed409e2d 100644 --- a/.github/workflows/scripts/example_tester.sh +++ b/.github/workflows/scripts/example_tester.sh @@ -488,3 +488,36 @@ function main() { } main +if [[ $result_UART_INTERRUPT = "fail" || $result_UART_DMA = "fail" || $result_HelloWorld = "fail" ]]; + then + make -C $Path/$testName METHOD=$2 + else + make -C $Path/$testName + fi + + +if [[ $result_UART_INTERRUPT = "fail" || + $result_UART_DMA = "fail" || + $result_HelloWorld = "fail" || + $result_HelloWorld_Cpp = "fail" || + $result_TRNG = "fail" || + $result_I2C = "fail" || + $result_SPI_POLLING = "fail" || + $result_SPI_INTERRUPT = "fail" || + $result_SPI_DMA = "fail" || + $result_SPI_V2_POLLING = "fail" || # Only for max32690 + $result_SPI_V2_INTERRUPT = "fail" || # Only for max32690 + $result_SPI_V2_DMA = "fail" || # Only for max32690 + $result_ICC = "fail" || + $result_Hash = "fail" || + $result_DMA = "fail" || + $result_CRC = "fail" || + $result_ADC_POLLING = "fail" || + $result_ADC_INTERRUPT = "fail" || + $result_ADC_DMA = "fail" || + $result_Lib_Gen = "fail" || + $result_Lib_Use = "fail" ]]; then + exit 2 + else + exit 0 +fi From 24ab7ced4cc0a4f36172bf9b226e002ce98ddbad Mon Sep 17 00:00:00 2001 From: Jason Cai Date: Fri, 28 Jun 2024 11:57:35 -0500 Subject: [PATCH 15/20] remove duplicate if --- .github/workflows/scripts/example_tester.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/scripts/example_tester.sh b/.github/workflows/scripts/example_tester.sh index e22ed409e2d..036cd75334b 100644 --- a/.github/workflows/scripts/example_tester.sh +++ b/.github/workflows/scripts/example_tester.sh @@ -488,14 +488,6 @@ function main() { } main -if [[ $result_UART_INTERRUPT = "fail" || $result_UART_DMA = "fail" || $result_HelloWorld = "fail" ]]; - then - make -C $Path/$testName METHOD=$2 - else - make -C $Path/$testName - fi - - if [[ $result_UART_INTERRUPT = "fail" || $result_UART_DMA = "fail" || $result_HelloWorld = "fail" || From 365ac2c8ea259c9e546db5141faadf65c552e623 Mon Sep 17 00:00:00 2001 From: JC-282-AD Date: Fri, 28 Jun 2024 17:09:09 +0000 Subject: [PATCH 16/20] clang-format bot reformatting. --- Examples/MAX32690/Bluetooth/BLE_otas/dats_main.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Examples/MAX32690/Bluetooth/BLE_otas/dats_main.c b/Examples/MAX32690/Bluetooth/BLE_otas/dats_main.c index 08b0045f222..6c8ebd4e8b3 100644 --- a/Examples/MAX32690/Bluetooth/BLE_otas/dats_main.c +++ b/Examples/MAX32690/Bluetooth/BLE_otas/dats_main.c @@ -450,12 +450,11 @@ static void datsSetup(dmEvt_t *pMsg) { /* Initialize control information */ datsCb.restoringResList = FALSE; -<<<<<<<<< Temporary merge branch 1 - memcpy(&datsScanDataDisc[2], deviceName,sizeof(deviceName)); - datsScanDataDisc[0] = sizeof(deviceName); - datsScanDataDisc[1] = DM_ADV_TYPE_LOCAL_NAME; -========= - memcpy(&datsScanDataDisc[2], deviceName, sizeof(deviceName)); + < < < < < < < < < + Temporary merge branch 1 memcpy(&datsScanDataDisc[2], deviceName, sizeof(deviceName)); + datsScanDataDisc[0] = sizeof(deviceName); + datsScanDataDisc[1] = DM_ADV_TYPE_LOCAL_NAME; + == == == == = memcpy(&datsScanDataDisc[2], deviceName, sizeof(deviceName)); datsScanDataDisc[0] = sizeof(deviceName); datsScanDataDisc[1] = DM_ADV_TYPE_LOCAL_NAME; From 3af2634bbb2d8e0483b72a89fe692e9b1a003274 Mon Sep 17 00:00:00 2001 From: JC-282-AD Date: Fri, 28 Jun 2024 16:02:04 -0500 Subject: [PATCH 17/20] Update example_tester.sh to disable I2C and UART_DMA --- .github/workflows/scripts/example_tester.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/scripts/example_tester.sh b/.github/workflows/scripts/example_tester.sh index 036cd75334b..cd36bd9847a 100644 --- a/.github/workflows/scripts/example_tester.sh +++ b/.github/workflows/scripts/example_tester.sh @@ -127,7 +127,7 @@ function test_UART() { fi printf "Test result for UART_INTERRUPT: $result_UART_INTERRUPT\n" - + <<"TEMPDISABLE" init UART DMA # start testing the output @@ -140,7 +140,7 @@ function test_UART() { fi printf "Test result for UART_DMA: $result_UART_DMA\n" - + TEMPDISABLE } function test_TRNG() { @@ -468,7 +468,7 @@ function main() { test_Hello_World test_Hello_World_Cpp test_TRNG - test_I2C + #test_I2C test_SPI if [[ $boardVersion = max32690 ]] then From 3f53407c3d7fccca9c9a2fc18c999cc111ab0e9a Mon Sep 17 00:00:00 2001 From: Jason Cai Date: Fri, 28 Jun 2024 16:04:27 -0500 Subject: [PATCH 18/20] lock board to prevent concurrent pull request --- .github/workflows/example_tester.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/example_tester.yml b/.github/workflows/example_tester.yml index 2c1e277f4e4..854c1c83f45 100644 --- a/.github/workflows/example_tester.yml +++ b/.github/workflows/example_tester.yml @@ -70,11 +70,24 @@ jobs: echo "MAXIM_PATH=$(pwd)" >> $GITHUB_ENV printenv + - name: Lock Boards + uses: Analog-Devices-MSDK/btm-ci-scripts/actions/lock-board@v1.1 + with: + boards: | + max32690_board_ex + lock: true + timeout: 900 # Attempt to lock for an hour + - name: run_example_test run: | bash .github/workflows/scripts/example_tester.sh max32690_board_ex - + - name: Unlock Boards + if: always() + uses: Analog-Devices-MSDK/btm-ci-scripts/actions/lock-board@v1.1 + with: + lock: false + all_owned: true From 826849d6032c57fe5a59d446951f0307bfb4de75 Mon Sep 17 00:00:00 2001 From: Jason Cai Date: Fri, 28 Jun 2024 16:06:44 -0500 Subject: [PATCH 19/20] fix tempdisable --- .github/workflows/scripts/example_tester.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/example_tester.sh b/.github/workflows/scripts/example_tester.sh index cd36bd9847a..a2f2b563009 100644 --- a/.github/workflows/scripts/example_tester.sh +++ b/.github/workflows/scripts/example_tester.sh @@ -127,7 +127,7 @@ function test_UART() { fi printf "Test result for UART_INTERRUPT: $result_UART_INTERRUPT\n" - <<"TEMPDISABLE" +<<"TEMPDISABLE" init UART DMA # start testing the output @@ -140,7 +140,7 @@ function test_UART() { fi printf "Test result for UART_DMA: $result_UART_DMA\n" - TEMPDISABLE +TEMPDISABLE } function test_TRNG() { From a06921e7d018f8ebd415e3b39695ab02a737484b Mon Sep 17 00:00:00 2001 From: JC-282-AD Date: Fri, 28 Jun 2024 16:16:31 -0500 Subject: [PATCH 20/20] Update example_tester.sh for multiline comment --- .github/workflows/scripts/example_tester.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/example_tester.sh b/.github/workflows/scripts/example_tester.sh index a2f2b563009..2d3211d263a 100644 --- a/.github/workflows/scripts/example_tester.sh +++ b/.github/workflows/scripts/example_tester.sh @@ -127,7 +127,7 @@ function test_UART() { fi printf "Test result for UART_INTERRUPT: $result_UART_INTERRUPT\n" -<<"TEMPDISABLE" +: ' init UART DMA # start testing the output @@ -140,7 +140,7 @@ function test_UART() { fi printf "Test result for UART_DMA: $result_UART_DMA\n" -TEMPDISABLE +' } function test_TRNG() {