Skip to content

Commit

Permalink
Revert "fix(BLE): MAX32690 DATC Hardfaulting with ICC enabled (#988)"
Browse files Browse the repository at this point in the history
This reverts commit 0665fe0.
  • Loading branch information
EricB-ADI committed Aug 21, 2024
1 parent 6964b91 commit 970ddd7
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 90 deletions.
82 changes: 41 additions & 41 deletions .github/workflows/scripts/test_launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -295,42 +295,42 @@ 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/Bluetooth\r\n\r\n"
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_dats
printf "> changing advertising names : $MSDK_DIR/Examples/$DUT_NAME_UPPER\r\n\r\n"
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_dats
perl -i -pe "s/\'D\'/\'X\'/g" dats_main.c
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_datc
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_datc
perl -i -pe "s/\'D\'/\'X\'/g" datc_main.c
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_otac
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_otac
perl -i -pe "s/\'S\'/\'X\'/g" datc_main.c
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_otas
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_otas
perl -i -pe "s/\'S\'/\'X\'/g" dats_main.c
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_FreeRTOS
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/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/Bluetooth/BLE_datc
cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/BLE_datc
perl -i -pe "s/\'D\'/\'X\'/g" datc_main.c
cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/Bluetooth/BLE_otac
cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/BLE_otac
perl -i -pe "s/\'S\'/\'X\'/g" datc_main.c
# build BLE examples
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER
else
# 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/Bluetooth/BLE_dats
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_dats
perl -i -pe "s/\'D\'/\'Z\'/g" dats_main.c
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_datc
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_datc
perl -i -pe "s/\'D\'/\'Z\'/g" datc_main.c
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_otac
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_otac
perl -i -pe "s/\'S\'/\'Z\'/g" datc_main.c
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_otas
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_otas
perl -i -pe "s/\'S\'/\'Z\'/g" dats_main.c
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_FreeRTOS
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/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/Bluetooth/BLE_datc
cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/BLE_datc
perl -i -pe "s/\'D\'/\'Z\'/g" datc_main.c
cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/Bluetooth/BLE_otac
cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/BLE_otac
perl -i -pe "s/\'S\'/\'Z\'/g" datc_main.c
fi
}
Expand Down Expand Up @@ -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/Bluetooth/BLE_datc
cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/BLE_datc
make clean
make libclean
make -j

# flash client first because it takes longer
cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/Bluetooth/BLE_datc/build
cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/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/Bluetooth/BLE_dats
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_dats
make clean
make libclean
make -j
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/Bluetooth/BLE_dats/build
cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/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
Expand All @@ -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/Bluetooth/BLE_datc/build
cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/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"
Expand Down Expand Up @@ -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/Bluetooth/BLE_otac
cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/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
Expand Down Expand Up @@ -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/Bluetooth/BLE_otac
cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/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/Bluetooth/BLE_otac/build
cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/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/Bluetooth/BLE_otac
cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/BLE_otac
git restore .

cd $MSDK_DIR/Examples/$DUT_NAME_UPPER/BLE_otas
Expand All @@ -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/Bluetooth/BLE_otac/build
cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/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/Bluetooth/BLE_otac/build
cd $MSDK_DIR/Examples/$MAIN_DEVICE_NAME_UPPER/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"
Expand Down Expand Up @@ -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
Expand Down
24 changes: 1 addition & 23 deletions Examples/MAX32690/Bluetooth/BLE_datc/datc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1251,19 +1251,7 @@ 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.
Expand All @@ -1277,11 +1265,6 @@ static bool_t btnTmrIsEnabled(mxc_tmr_regs_t *tmr)
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 */
Expand All @@ -1300,11 +1283,6 @@ 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 */
Expand Down
23 changes: 1 addition & 22 deletions Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,19 +895,7 @@ 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.
Expand All @@ -921,10 +909,6 @@ static bool_t btnTmrIsEnabled(mxc_tmr_regs_t *tmr)
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 */
Expand All @@ -943,11 +927,6 @@ 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 */
Expand Down
4 changes: 0 additions & 4 deletions Libraries/Boards/MAX32690/EvKit_V1/Source/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#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);
Expand Down Expand Up @@ -103,9 +102,6 @@ __weak void GPIO2_IRQHandler(void)
/******************************************************************************/
int Board_Init(void)
{
//Disable to prevent cache bug
MXC_ICC_Disable(MXC_ICC0);

int err;

// Enable GPIO
Expand Down

0 comments on commit 970ddd7

Please sign in to comment.