diff --git a/.github/workflows/scripts/test_launcher.sh b/.github/workflows/scripts/test_launcher.sh index 225b22cf186..326b370780f 100755 --- a/.github/workflows/scripts/test_launcher.sh +++ b/.github/workflows/scripts/test_launcher.sh @@ -295,21 +295,21 @@ function change_advertising_names() { if [ $(hostname) == "wall-e" ]; then # change advertising name for projects under test to avoid # connections with office devices - printf "> changing advertising names : $MSDK_DIR/Examples/$DUT_NAME_UPPER\r\n\r\n" - cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_dats + printf "> changing advertising names : $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth\r\n\r\n" + cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_dats perl -i -pe "s/\'D\'/\'X\'/g" dats_main.c - cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_datc + cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_datc perl -i -pe "s/\'D\'/\'X\'/g" datc_main.c - cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_otac + cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_otac perl -i -pe "s/\'S\'/\'X\'/g" datc_main.c - cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_otas + cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_otas perl -i -pe "s/\'S\'/\'X\'/g" dats_main.c - cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_FreeRTOS + cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_FreeRTOS perl -i -pe "s/\'S\'/\'X\'/g" dats_main.c # change advertising name to scan for on the main device client apps - cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/BLE_datc + cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/Bluetooth/BLE_datc perl -i -pe "s/\'D\'/\'X\'/g" datc_main.c - cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/BLE_otac + cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/Bluetooth/BLE_otac perl -i -pe "s/\'S\'/\'X\'/g" datc_main.c # build BLE examples cd $MSDK_DIR/Examples/$DUT_NAME_UPPER @@ -317,20 +317,20 @@ function change_advertising_names() { # change advertising name for projects under test to avoid # connections with office devices printf "> changing advertising names : $MSDK_DIR/Examples/$DUT_NAME_UPPER\r\n\r\n" - cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_dats + cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_dats perl -i -pe "s/\'D\'/\'Z\'/g" dats_main.c - cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_datc + cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_datc perl -i -pe "s/\'D\'/\'Z\'/g" datc_main.c - cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_otac + cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_otac perl -i -pe "s/\'S\'/\'Z\'/g" datc_main.c - cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_otas + cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_otas perl -i -pe "s/\'S\'/\'Z\'/g" dats_main.c - cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_FreeRTOS + cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_FreeRTOS perl -i -pe "s/\'S\'/\'Z\'/g" dats_main.c # change advertising name to scan for on the main device client apps - cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/BLE_datc + cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/Bluetooth/BLE_datc perl -i -pe "s/\'D\'/\'Z\'/g" datc_main.c - cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/BLE_otac + cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/Bluetooth/BLE_otac perl -i -pe "s/\'S\'/\'Z\'/g" datc_main.c fi } @@ -419,23 +419,23 @@ function run_datcs_conencted_tests() { erase_all_devices # Flash MAIN_DEVICE with BLE_datc - cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/BLE_datc + cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/Bluetooth/BLE_datc make clean make libclean make -j # flash client first because it takes longer - cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/BLE_datc/build + cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/Bluetooth/BLE_datc/build printf "\r\n> Flashing BLE_datc on main device: $MAIN_DEVICE_NAME_UPPER\r\n" #flash_with_openocd_fast $MAIN_DEVICE_NAME_LOWER $MAIN_DEVICE_ID 1 flash_with_openocd $MAIN_DEVICE_NAME_LOWER $MAIN_DEVICE_ID 1 # flash DUT with BLE_dats - cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_dats + cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_dats make clean make libclean make -j - cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_dats/build + cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_dats/build printf "\r\n> Flashing BLE_dats on DUT $DUT_NAME_UPPER\r\n" #flash_with_openocd_fast $DUT_NAME_LOWER $DUT_ID 2 flash_with_openocd $DUT_NAME_LOWER $DUT_ID 2 @@ -462,7 +462,7 @@ function run_datcs_conencted_tests() { let "numOfFailedTests+=$testResult" failedTestList+="| BLE_dat_cs ($DUT_NAME_UPPER) " # test failed, save elfs datc/s - cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/BLE_datc/build + cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/Bluetooth/BLE_datc/build cp $MAIN_DEVICE_NAME_LOWER.elf $EXAMPLE_TEST_PATH/results/failed_elfs/$MAIN_DEVICE_NAME_LOWER"_BLE_datcs_client.elf" cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_dats/build cp $DUT_NAME_LOWER.elf $EXAMPLE_TEST_PATH/results/failed_elfs/$DUT_NAME_LOWER"_BLE_datcs_server.elf" @@ -497,7 +497,7 @@ function run_ota_test() { change_advertising_names # change the target the OTAC embedded firmware in the client is built for - cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/BLE_otac + cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/Bluetooth/BLE_otac #appends TARGET , TARGET_UC and TARGET_LC to the make commands and sets them to $DUT_NAME_UPPER and $DUT_NAME_LOWER sed -i 's/BUILD_DIR=\$(FW_BUILD_DIR) BUILD_BOOTLOADER=0 PROJECT=fw_update/BUILD_DIR=\$(FW_BUILD_DIR) BUILD_BOOTLOADER=0 PROJECT=fw_update TARGET='"$DUT_NAME_UPPER"' TARGET_UC='"$DUT_NAME_UPPER"' TARGET_LC='"$DUT_NAME_LOWER"'/g' project.mk sed -i 's/BUILD_DIR=\$(FW_BUILD_DIR) \$(FW_UPDATE_BIN)/BUILD_DIR=\$(FW_BUILD_DIR) \$(FW_UPDATE_BIN) TARGET='"$DUT_NAME_UPPER"' TARGET_UC='"$DUT_NAME_UPPER"' TARGET_LC='"$DUT_NAME_LOWER"'/g' project.mk @@ -526,18 +526,18 @@ function run_ota_test() { make BOARD=$DUT_BOARD_TYPE USE_INTERNAL_FLASH=$INTERNAL_FLASH_TEST BUILD_BOOTLOADER=0 -j echo "BOARD=$DUT_BOARD_TYPE USE_INTERNAL_FLASH=$INTERNAL_FLASH_TEST -j" # make OTAC - cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/BLE_otac + cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/Bluetooth/BLE_otac # flash MAIN_DEVICE with BLE_OTAC, it will use the OTAS bin with new firmware make clean make BOARD=$DUT_BOARD_TYPE FW_UPDATE_DIR=../../$DUT_NAME_UPPER/BLE_otas USE_INTERNAL_FLASH=$INTERNAL_FLASH_TEST BUILD_BOOTLOADER=0 -j - cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/BLE_otac/build + cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/Bluetooth/BLE_otac/build printf ">>>>>>> Flashing BLE_otac on main device: $MAIN_DEVICE_NAME_UPPER\r\n " flash_with_openocd $MAIN_DEVICE_NAME_LOWER $MAIN_DEVICE_ID printf ">>>>>>> Flashing done" #revert files back - cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/BLE_otac + cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/Bluetooth/BLE_otac git restore . cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_otas @@ -559,14 +559,14 @@ function run_ota_test() { if [[ "$INTERNAL_FLASH_TEST" -ne "0" ]]; then failedTestList+="| BLE_ota_cs_int ($DUT_NAME_UPPER) " # test failed, save elfs datc/s - cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/BLE_otac/build + cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/Bluetooth/BLE_otac/build cp $MAIN_DEVICE_NAME_LOWER.elf $EXAMPLE_TEST_PATH/results/failed_elfs/$MAIN_DEVICE_NAME_LOWER"_"$DUT_NAME_LOWER"_BLE_otacs_client_int.elf" cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_otas/build cp $DUT_NAME_LOWER.elf $EXAMPLE_TEST_PATH/results/failed_elfs/$DUT_NAME_LOWER"_BLE_otacs_server_int.elf" else failedTestList+="| BLE_ota_cs_ext ($DUT_NAME_UPPER) " # test failed, save elfs datc/s - cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/BLE_otac/build + cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/Bluetooth/BLE_otac/build cp $MAIN_DEVICE_NAME_LOWER.elf $EXAMPLE_TEST_PATH/results/failed_elfs/$MAIN_DEVICE_NAME_LOWER"_"$DUT_NAME_LOWER"_BLE_otacs_client_ext.elf" cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_otas/build cp $DUT_NAME_LOWER.elf $EXAMPLE_TEST_PATH/results/failed_elfs/$DUT_NAME_LOWER"_BLE_otacs_server_ext.elf" @@ -610,31 +610,31 @@ if [ $CURRENT_TEST == "all" ]; then erase_all_devices run_all_not_conencted_tests CURRENT_TEST="all" - # temp diasble datc/s and otas tests until new RF PHY is debugged with ME17B - # run_datcs_conencted_tests - # CURRENT_TEST="all" - # run_ota_test 1 # arg 1= internal flash - # if [[ $DUT_NAME_UPPER != "MAX32690" ]]; then - # run_ota_test 0 # arg 0 = external flash - # fi + temp diasble datc/s and otas tests until new RF PHY is debugged with ME17B + run_datcs_conencted_tests + CURRENT_TEST="all" + run_ota_test 1 # arg 1= internal flash + if [[ $DUT_NAME_UPPER != "MAX32690" ]]; then + run_ota_test 0 # arg 0 = external flash + fi echo elif [ $CURRENT_TEST == "dats" ]; then echo echo "Running Datc/s connected test" erase_all_devices - # temp diasble datc/s and otas tests until new RF PHY is debugged with ME17B - #run_datcs_conencted_tests + temp diasble datc/s and otas tests until new RF PHY is debugged with ME17B + run_datcs_conencted_tests echo elif [ $CURRENT_TEST == "ota" ]; then echo echo "Running OTA test" - # temp diasble datc/s and otas tests until new RF PHY is debugged with ME17B - # erase_all_devices - # run_ota_test 1 # arg 1 = internal flash - # if [[ $DUT_NAME_UPPER != "MAX32690" ]]; then - # run_ota_test 0 # arg 0= external flash - #fi + temp diasble datc/s and otas tests until new RF PHY is debugged with ME17B + erase_all_devices + run_ota_test 1 # arg 1 = internal flash + if [[ $DUT_NAME_UPPER != "MAX32690" ]]; then + run_ota_test 0 # arg 0= external flash + fi echo else echo diff --git a/Examples/MAX32690/Bluetooth/BLE_datc/datc_main.c b/Examples/MAX32690/Bluetooth/BLE_datc/datc_main.c index 14246d85d9c..47934a08841 100644 --- a/Examples/MAX32690/Bluetooth/BLE_datc/datc_main.c +++ b/Examples/MAX32690/Bluetooth/BLE_datc/datc_main.c @@ -1251,7 +1251,19 @@ void DatcHandlerInit(wsfHandlerId_t handlerId) datcCb.scanTimer.handlerId = handlerId; datcCb.scanTimer.msg.event = SCAN_START_EVT; } - +/*************************************************************************************************/ +/*! + * \brief Check to see if btn timer is enabled. + * + * \param[in] tmr btn timer. + * + * \return TRUE if enabled, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t btnTmrIsEnabled(mxc_tmr_regs_t *tmr) +{ + return (bool_t)(BTN_1_TMR->ctrl0 & (MXC_F_TMR_CTRL0_EN_A | MXC_F_TMR_CTRL0_EN_B)); +} /*************************************************************************************************/ /*! * \brief Platform button press handler. @@ -1265,6 +1277,11 @@ void DatcHandlerInit(wsfHandlerId_t handlerId) static void btnPressHandler(uint8_t btnId, PalBtnPos_t state) { if (btnId == 1) { + if (!btnTmrIsEnabled(BTN_1_TMR)) { + APP_TRACE_INFO0("Software timer is not enabled!"); + return; + } + /* Start/stop button timer */ if (state == PAL_BTN_POS_UP) { /* Button Up, stop the timer, call the action function */ @@ -1283,6 +1300,11 @@ static void btnPressHandler(uint8_t btnId, PalBtnPos_t state) MXC_TMR_SW_Start(BTN_1_TMR); } } else if (btnId == 2) { + if (!btnTmrIsEnabled(BTN_2_TMR)) { + APP_TRACE_INFO0("Software timer is not enabled!"); + return; + } + /* Start/stop button timer */ if (state == PAL_BTN_POS_UP) { /* Button Up, stop the timer, call the action function */ diff --git a/Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c b/Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c index dd076d2cf50..cbb22c89a85 100644 --- a/Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c +++ b/Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c @@ -895,7 +895,19 @@ static void datsWsfBufDiagnostics(WsfBufDiag_t *pInfo) pInfo->param.alloc.taskId, pInfo->param.alloc.len); } } - +/*************************************************************************************************/ +/*! + * \brief Check to see if btn timer is enabled. + * + * \param[in] tmr btn timer. + * + * \return TRUE if enabled, FALSE otherwise. + */ +/*************************************************************************************************/ +static bool_t btnTmrIsEnabled(mxc_tmr_regs_t *tmr) +{ + return (bool_t)(BTN_1_TMR->ctrl0 & (MXC_F_TMR_CTRL0_EN_A | MXC_F_TMR_CTRL0_EN_B)); +} /*************************************************************************************************/ /*! * \brief Platform button press handler. @@ -909,6 +921,10 @@ static void datsWsfBufDiagnostics(WsfBufDiag_t *pInfo) static void btnPressHandler(uint8_t btnId, PalBtnPos_t state) { if (btnId == 1) { + if (!btnTmrIsEnabled(BTN_1_TMR)) { + APP_TRACE_INFO0("Software timer is not enabled!"); + return; + } /* Start/stop button timer */ if (state == PAL_BTN_POS_UP) { /* Button Up, stop the timer, call the action function */ @@ -927,6 +943,11 @@ static void btnPressHandler(uint8_t btnId, PalBtnPos_t state) MXC_TMR_SW_Start(BTN_1_TMR); } } else if (btnId == 2) { + if (!btnTmrIsEnabled(BTN_2_TMR)) { + APP_TRACE_INFO0("Software timer is not enabled!"); + return; + } + /* Start/stop button timer */ if (state == PAL_BTN_POS_UP) { /* Button Up, stop the timer, call the action function */ diff --git a/Libraries/Boards/MAX32690/EvKit_V1/Source/board.c b/Libraries/Boards/MAX32690/EvKit_V1/Source/board.c index 36bb67f674a..9a8f74c969b 100644 --- a/Libraries/Boards/MAX32690/EvKit_V1/Source/board.c +++ b/Libraries/Boards/MAX32690/EvKit_V1/Source/board.c @@ -32,6 +32,7 @@ #include "spixf.h" #include "tft_st7735.h" #include "uart.h" +#include "icc.h" /***** Global Variables *****/ mxc_uart_regs_t *ConsoleUart = MXC_UART_GET_UART(CONSOLE_UART); @@ -102,6 +103,9 @@ __weak void GPIO2_IRQHandler(void) /******************************************************************************/ int Board_Init(void) { + //Disable to prevent cache bug + MXC_ICC_Disable(MXC_ICC0); + int err; // Enable GPIO