Skip to content

Commit

Permalink
readded mxc version
Browse files Browse the repository at this point in the history
  • Loading branch information
EricB-ADI committed Jun 14, 2024
2 parents c6eb053 + 1430a0c commit 9dd470b
Show file tree
Hide file tree
Showing 37 changed files with 9,699 additions and 0 deletions.
249 changes: 249 additions & 0 deletions .github/workflows/scripts/local_BLE_Examples_Test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
#!/usr/bin/env bash

echo
echo "#####################################################################################################################"
echo "# This script is used to test the BLE_Examples_Test.yml locally at wall-e. #"
echo "# local_BLE_Examples_Test.sh <0/1 for max32655> <0/1 for max32665> <0/1 for max32690 devkit> <0/1 for max32690 WLP> #"
echo "#####################################################################################################################"

echo
echo $0 $@

if [[ $# -ne 4 ]]; then
echo
echo "Invalid arguments."
echo "local_BLE_Examples_Test.sh <0/1 for max32655> <0/1 for max32665> <0/1 for max32690 devkit> <0/1 for max32690 WLP>"
exit 1
fi

host=`hostname`
if [ $host == "wall-e" ]; then
MSDK=/home/$USER/Workspace/yc/msdk_open
else
MSDK=/home/$USER/Workspace/msdk_open
fi

echo
echo "MSDK=$MSDK"

DO_MAX32655=$1
DO_MAX32665=$2
DO_MAX32690_EVKIT=$3
DO_MAX32690_WLP=$4

#--------------------------------------------------------------------------------------------------
# For MAX32655
if [[ $DO_MAX32655 -eq 1 ]]; then
echo
echo "-----------------------------------------------------------------------------------------"
echo "TEST MAX32655"

echo
echo "Lock the used recourse files."
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 max32655_board1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 max32655_board2
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 max32665_board1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 max32690_board_w1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 max32690_board_A5

touch /home/$USER/Workspace/Resource_Share/local-BLE_Examples_Test-MAX32690_EvKit.txt

set -e

cd $MSDK
echo "PWD="`pwd`

cd .github/workflows/scripts
chmod +x test_launcher.sh
FILE=/home/$USER/Workspace/Resource_Share/boards_config.json
if [ $(hostname) == "wall-e" ]; then
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'])"`
else
dut_uart=`/usr/bin/python3 -c "import sys, json; print(json.load(open('$FILE'))['max32655_board_y2']['uart0'])"`
dut_serial=`/usr/bin/python3 -c "import sys, json; print(json.load(open('$FILE'))['max32655_board_y2']['daplink'])"`
fi
./test_launcher.sh max32655 $dut_uart $dut_serial

echo
echo "Release the used resource files."
echo
ls -hal ~/Workspace/Resource_Share

python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py max32690_board_A5
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py max32690_board_w1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py max32665_board1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py max32655_board2
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py max32655_board1

echo
echo "-----------------------------------------------------------------------------------------"
echo "FINISH TEST MAX32655"
fi

#--------------------------------------------------------------------------------------------------
# For MAX32665
if [[ $DO_MAX32665 -eq 1 ]]; then
echo
echo "-----------------------------------------------------------------------------------------"
echo "TEST MAX32665"

echo "Lock the used recourse files."
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 max32655_board1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 max32655_board2
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 max32665_board1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 max32690_board_w1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 max32690_board_A5

touch /home/$USER/Workspace/Resource_Share/local-BLE_Examples_Test-MAX32665.txt

set +e

cd $MSDK
echo "PWD="`pwd`

cd .github/workflows/scripts
chmod +x test_launcher.sh
FILE=/home/$USER/Workspace/Resource_Share/boards_config.json
if [ $(hostname) == "wall-e" ]; then
dut_uart=` /usr/bin/python3 -c "import sys, json; print(json.load(open('$FILE'))['max32665_board1']['uart1'])"`
dut_serial=`/usr/bin/python3 -c "import sys, json; print(json.load(open('$FILE'))['max32665_board1']['daplink'])"`
else
dut_uart=` /usr/bin/python3 -c "import sys, json; print(json.load(open('$FILE'))['max32665_board_2']['uart1'])"`
dut_serial=`/usr/bin/python3 -c "import sys, json; print(json.load(open('$FILE'))['max32665_board_2']['daplink'])"`
fi

./test_launcher.sh max32665 $dut_uart $dut_serial

set -e

echo
echo "Release the used resource files."
echo
ls -hal ~/Workspace/Resource_Share

python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py max32690_board_A5
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py max32690_board_w1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py max32665_board1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py max32655_board2
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py max32655_board1

echo
echo "-----------------------------------------------------------------------------------------"
echo "FINISH TEST MAX32655"
fi

#--------------------------------------------------------------------------------------------------
# For MAX32690_EVKIT
if [[ $DO_MAX32690_EVKIT -eq 1 ]]; then
echo
echo "-----------------------------------------------------------------------------------------"
echo "TEST MAX32690 EVKIT"
echo

echo "Lock the used recourse files."
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 max32655_board1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 max32655_board2
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 max32665_board1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 max32690_board_w1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 max32690_board_A5

touch /home/$USER/Workspace/Resource_Share/local-BLE_Examples_Test-MAX32690_EvKit.txt

set +e

cd $MSDK
echo "PWD="`pwd`

cd .github/workflows/scripts
chmod +x test_launcher.sh
FILE=/home/$USER/Workspace/Resource_Share/boards_config.json
if [ $(hostname) == "wall-e" ]; then
dut_uart=` /usr/bin/python3 -c "import sys, json; print(json.load(open('$FILE'))['max32690_board_w1']['uart2'])"`
dut_serial=`/usr/bin/python3 -c "import sys, json; print(json.load(open('$FILE'))['max32690_board_w1']['daplink'])"`
else
dut_uart=` /usr/bin/python3 -c "import sys, json; print(json.load(open('$FILE'))['max32690_board_3']['uart2'])"`
dut_serial=`/usr/bin/python3 -c "import sys, json; print(json.load(open('$FILE'))['max32690_board_3']['daplink'])"`
fi

./test_launcher.sh max32690 $dut_uart $dut_serial

set -e

echo
echo "Release the used resource files."
echo
ls -hal ~/Workspace/Resource_Share

if [ -f /home/$USER/Workspace/Resource_Share/local-BLE_Examples_Test-MAX32690_EvKit.txt ]; then
rm /home/$USER/Workspace/Resource_Share/local-BLE_Examples_Test-MAX32690_EvKit.txt
fi
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py max32690_board_A5
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py max32690_board_w1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py max32665_board1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py max32655_board2
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py max32655_board1

echo
echo "-----------------------------------------------------------------------------------------"
echo "FINISH TEST MAX32690 EVKIT"
fi


#--------------------------------------------------------------------------------------------------
# For MAX32690_WLP
if [[ $DO_MAX32690_WLP -eq 1 ]]; then
echo
echo "-----------------------------------------------------------------------------------------"
echo "TEST MAX32690 WLP"
echo

FILE=/home/$USER/Workspace/Resource_Share/boards_config.json

if [ $host == "wall-e" ]; then
max32690_wlp_brd=max32690_board_A5
else
max32690_wlp_brd=max32690_board_A3
fi

dut_uart=` /usr/bin/python3 -c "import sys, json; print(json.load(open('$FILE'))['${max32690_wlp_brd}']['con_sn'])"`
dut_serial=`/usr/bin/python3 -c "import sys, json; print(json.load(open('$FILE'))['${max32690_wlp_brd}']['DAP_sn'])"`

echo "Lock the used recourse files."
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 max32655_board1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 max32655_board2
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 max32665_board1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 max32690_board_w1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py -l -t 3600 ${max32690_wlp_brd}

touch /home/$USER/Workspace/Resource_Share/local-BLE_Examples_Test-MAX32690_WLP.txt # indicate which jos is running
set +e

cd $MSDK
echo "PWD="`pwd`

cd .github/workflows/scripts
chmod +x test_launcher.sh
./test_launcher.sh max32690 $dut_uart $dut_serial WLP_V1

set -e

echo
echo "Release the used resource files."
echo
ls -hal ~/Workspace/Resource_Share

python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py ${max32690_wlp_brd}
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py max32655_board1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py max32655_board2
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py max32665_board1
python3 /home/$USER/Workspace/Resource_Share/Resource_Share.py max32690_board_w1

if [ -f /home/$USER/Workspace/Resource_Share/local-BLE_Examples_Test-MAX32690_WLP.txt ]; then
rm /home/$USER/Workspace/Resource_Share/local-BLE_Examples_Test-MAX32690_WLP.txt
fi

echo
echo "-----------------------------------------------------------------------------------------"
echo "FINISH TEST MAX32690 WLP"
fi
76 changes: 76 additions & 0 deletions .github/workflows/scripts/mass_erase_board.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/bin/bash
#script accepts 2 arguments: device , device key in boards config

#****************************************************************************************************
# Function accepts parameters:device , CMSIS-DAP serial #
function erase_with_openocd() {
echo "-----------------------------------------------------------------------------------------"
printf "> Erasing $1 : $2 \r\n"
echo "-----------------------------------------------------------------------------------------"
echo

$OPENOCD -f $OPENOCD_TCL_PATH/interface/cmsis-dap.cfg -f $OPENOCD_TCL_PATH/target/$1.cfg -s $OPENOCD_TCL_PATH/ -c "cmsis_dap_serial $2" -c "gdb_port 3333" -c "telnet_port 4444" -c "tcl_port 6666" -c "init; reset halt; max32xxx mass_erase 0;" -c " exit" &
openocd_dapLink_pid=$!
# wait for openocd to finish
wait $openocd_dapLink_pid

# erase second bank of larger chips
if [[ $1 != "max32655" ]]; then
printf "> Erasing second bank of device: $1 with ID:$2 \r\n"
$OPENOCD -f $OPENOCD_TCL_PATH/interface/cmsis-dap.cfg -f $OPENOCD_TCL_PATH/target/$1.cfg -s $OPENOCD_TCL_PATH/ -c "cmsis_dap_serial $2" -c "gdb_port 3333" -c "telnet_port 4444" -c "tcl_port 6666" -c "init; reset halt; max32xxx mass_erase 1;" -c " exit" &
openocd_dapLink_pid=$!
# wait for openocd to finish
wait $openocd_dapLink_pid
fi
}

#****************************************************************************************************
# Function accepts parameters: device, CMSIS-DAP serial #
function flash_with_openocd() {
# mass erase and flash
set +e
$OPENOCD -f $OPENOCD_TCL_PATH/interface/cmsis-dap.cfg -f $OPENOCD_TCL_PATH/target/$1.cfg -s $OPENOCD_TCL_PATH -c "cmsis_dap_serial $2" -c "gdb_port 3333" -c "telnet_port 4444" -c "tcl_port 6666" -c "init; reset halt;max32xxx mass_erase 0" -c "program ext_flc_erase_$1.elf verify reset exit" >/dev/null &
openocd_dapLink_pid=$!
# wait for openocd to finish
while kill -0 $openocd_dapLink_pid; do
sleep 1
# we can add a timeout here if we want
done
set -e

# Check the return value to see if we received an error
if [ "$?" -ne "0" ]; then
printf "> Verify failed , flashibng again \r\n"
# Reprogram the device if the verify failed
$OPENOCD -f $OPENOCD_TCL_PATH/interface/cmsis-dap.cfg -f $OPENOCD_TCL_PATH/target/$1.cfg -s $OPENOCD_TCL_PATH -c "cmsis_dap_serial $2" -c "gdb_port 3333" -c "telnet_port 4444" -c "tcl_port 6666" -c "init; reset halt;max32xxx mass_erase 0" -c "program ext_flc_erase_$1.elf verify reset exit" >/dev/null &
openocd_dapLink_pid=$!
fi
}

if [ $(hostname) == "wall-e" ]; then
FILE=/home/$USER/Workspace/Resource_Share/boards_config.json
# WALL-E paths
export OPENOCD_TCL_PATH=/home/btm-ci/Tools/openocd/tcl
export OPENOCD=/home/btm-ci/Tools/openocd/src/openocd
elif [ $(hostname) == "yingcai-OptiPlex-790" ]; then
FILE=/home/$USER/Workspace/Resource_Share/boards_config.json
export OPENOCD_TCL_PATH=/home/$USER/Tools/openocd/tcl
export OPENOCD=/home/$USER/Tools/openocd/src/openocd
else
FILE=/home/$USER/boards_config.json
export OPENOCD_TCL_PATH=/home/eddie/workspace/openocd/tcl
export OPENOCD=/home/eddie/workspace/openocd/src/openocd
fi
dut_serial=$(/usr/bin/python3 -c "import sys, json; print(json.load(open('$FILE'))['$2']['daplink'])")

# flash device with an application to mass erase external flash
if [[ $1 != "max32690" ]]; then
# flash device with an application to mass erase external flash
echo "Flashing ext flash erase application on $1 with ID:$dut_serial"
flash_with_openocd $1 $dut_serial
echo "External flash erased"
fi
sleep 2
# mass erase internal flash
erase_with_openocd $1 $dut_serial
echo "Internal flash erased"
1 change: 1 addition & 0 deletions Examples/MAX32655/I2S/ARM/Abstract.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
I2S Example!
9 changes: 9 additions & 0 deletions Examples/MAX32655/I2S/ARM/EventRecorderStub.scvd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>

<component_viewer schemaVersion="0.1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="Component_Viewer.xsd">

<component name="EventRecorderStub" version="1.0.0"/> <!--name and version of the component-->
<events>
</events>

</component_viewer>
24 changes: 24 additions & 0 deletions Examples/MAX32655/I2S/ARM/I2S.sct
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#! armcc -E -I .\..\

#include "sct_config.h"

; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************

LR_IROM1 0x10000000 0x00080000 { ; load region size_region
ER_IROM1 0x10000000 0x00080000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}

// ADDER _BIN_START_ {
// all_imgs.o (.bin_storage_img)
// }

RW_IRAM1 0x20000000 0x00020000 { ; RW data
.ANY (+RW +ZI)
}
}
Loading

0 comments on commit 9dd470b

Please sign in to comment.