Skip to content

Commit

Permalink
Merge branch 'feat/ME30' of github.com:analogdevicesinc/msdk into fea…
Browse files Browse the repository at this point in the history
…t/ME30
  • Loading branch information
sihyung-maxim committed May 13, 2024
2 parents 3c58bb4 + 662b061 commit a59f777
Show file tree
Hide file tree
Showing 11 changed files with 241 additions and 179 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@

def build_project(project:Path, target, board, maxim_path:Path, distclean=False, extra_args=None) -> Tuple[int, tuple]:
clean_cmd = "make clean" if not distclean else "make distclean"
if "Bluetooth" in project.as_posix() or "BLE" in project.as_posix():
# Clean cordio lib for BLE projects
clean_cmd += "&& make clean.cordio"
res = run(clean_cmd, cwd=project, shell=True, capture_output=True, encoding="utf-8")

# Test build
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/zephyr-hal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@ on:

env:
# Add environment variables here
PR_NUM: ${{ github.event.number }}
PR_NUM: ${{ github.event.pull_request.number }}

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
if_merged:
# Run only when a PR is merged
if: github.event.pull_request.merged == true

# The type of OS that the job will run on
runs-on: [ ubuntu-latest ]

Expand All @@ -39,6 +36,7 @@ jobs:
with:
# Specific Branch, tag, or SHA to checkout (uses default branch if empty)
ref: ''
ssh-key: ${{ secrets.MSDK_SSH_KEY }}
# Repository name (Default will be the current repo the action is running from)
repository: ${{ github.repository }}
fetch-depth: 0
Expand All @@ -51,6 +49,7 @@ jobs:
with:
# Specific Branch, tag, or SHA to checkout (uses default branch if empty)
ref: 'develop'
ssh-key: ${{ secrets.MSDK_SSH_KEY }}
# Name of different repository ('organization_name/repo_name')
# Update the following line to point to the hal_adi repo once that repo is created.
repository: 'analogdevicesinc/hal_adi'
Expand All @@ -66,11 +65,12 @@ jobs:
# directory that contains the 'msdk' and 'hal_adi' folders.
bash ./msdk/.github/workflows/scripts/zephyr-hal.sh
- name: Push hal_adi repository
uses: EndBug/[email protected]
with:
add: '*'
message: 'Updating Zephyr MSDK Hal based on msdk PR# $PR_NUM'
push: true
# Specify path in workspace to the repo you want to push to
cwd: './hal_adi'
- name: Push changes to hal_adi repository
run: |
echo "$(pwd) - $(ls)"
cd ./hal_adi
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git add *
git commit -m "Update Zephyr MSDK Hal based on MSDK PR: https://github.com/analogdevicesinc/msdk/pull/${PR_NUM}"
git push
22 changes: 15 additions & 7 deletions Examples/MAX32655/Bluetooth/RF_Test/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ uint8_t processEscSequence(uint8_t *seq)
*
* \brief adds latest command to command history buffer
*
* \param q pointer to the circular buffer holding command history
* \param cmd pointer to the command string to be added
* \param q pointer to the circular buffer holding command history
* \param cmd pointer to the command string to be added
*
* \return None.
*/
Expand All @@ -271,9 +271,9 @@ void cmdHistoryAdd(queue_t *q, const uint8_t *cmd)
* \fn updateQueuePointer.
*
* \brief Updates an internal marker pointing to historical command to be printed, based on up/down arrow
*
* \param q pointer to the circular buffer holding command history
*
*
* \param q pointer to the circular buffer holding command history
*
* \param upArrow flag used to upated the queuePoniter delimiting which command to print
*
* \return None.
Expand Down Expand Up @@ -393,9 +393,9 @@ void prompt(void)
* \fn printHint
*
* \brief Prints the help string of any command matching the current inputbuffer
*
*
* \param buff pointer to the inputbuffer
*
*
* \return None.
*/
/*************************************************************************************************/
Expand Down Expand Up @@ -694,17 +694,25 @@ void txTestTask(void *pvParameters)
snprintf(str, sizeof(str), "%s%s", str, (const char *)getPhyStr(phy));
APP_TRACE_INFO1("%s", str);

//Prevent FreeRTOS from context switching until the LL is finished
vTaskSuspendAll();

/* stat test */
if (testConfig.testType == BLE_TX_TEST) {
res = LlEnhancedTxTest(testConfig.channel, packetLen, packetType, phy, 0);
} else {
res = LlEnhancedRxTest(testConfig.channel, phy, 0, 0);
}
xTaskResumeAll(); //Restore scheduler

APP_TRACE_INFO2("result = %u %s", res, res == LL_SUCCESS ? "(SUCCESS)" : "(FAIL)");
/* if duration value was given then let the test run that amount of time and end */
if (testConfig.duration_ms) {
vTaskDelay(testConfig.duration_ms);
//Prevent FreeRTOS from context switching until the LL is finished
vTaskSuspendAll();
LlEndTest(NULL);
xTaskResumeAll(); //Restore scheduler
xSemaphoreGive(rfTestMutex);
}
pausePrompt = false;
Expand Down
22 changes: 15 additions & 7 deletions Examples/MAX32665/Bluetooth/RF_Test/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ uint8_t processEscSequence(uint8_t *seq)
*
* \brief adds latest command to command history buffer
*
* \param q pointer to the circular buffer holding command history
* \param cmd pointer to the command string to be added
* \param q pointer to the circular buffer holding command history
* \param cmd pointer to the command string to be added
*
* \return None.
*/
Expand All @@ -274,9 +274,9 @@ void cmdHistoryAdd(queue_t *q, const uint8_t *cmd)
* \fn updateQueuePointer.
*
* \brief Updates an internal marker pointing to historical command to be printed, based on up/down arrow
*
* \param q pointer to the circular buffer holding command history
*
*
* \param q pointer to the circular buffer holding command history
*
* \param upArrow flag used to upated the queuePoniter delimiting which command to print
*
* \return None.
Expand Down Expand Up @@ -396,9 +396,9 @@ void prompt(void)
* \fn printHint
*
* \brief Prints the help string of any command matching the current inputbuffer
*
*
* \param buff pointer to the inputbuffer
*
*
* \return None.
*/
/*************************************************************************************************/
Expand Down Expand Up @@ -695,17 +695,25 @@ void txTestTask(void *pvParameters)
snprintf(str, sizeof(str), "%s%s", str, (const char *)getPhyStr(phy));
APP_TRACE_INFO1("%s", str);

//Prevent FreeRTOS from context switching until the LL is finished
vTaskSuspendAll();

/* stat test */
if (testConfig.testType == BLE_TX_TEST) {
res = LlEnhancedTxTest(testConfig.channel, packetLen, packetType, phy, 0);
} else {
res = LlEnhancedRxTest(testConfig.channel, phy, 0, 0);
}
xTaskResumeAll(); //Restore scheduler

APP_TRACE_INFO2("result = %u %s", res, res == LL_SUCCESS ? "(SUCCESS)" : "(FAIL)");
/* if duration value was given then let the test run that amount of time and end */
if (testConfig.duration_ms) {
vTaskDelay(testConfig.duration_ms);
//Prevent FreeRTOS from context switching until the LL is finished
vTaskSuspendAll();
LlEndTest(NULL);
xTaskResumeAll(); //Restore scheduler
xSemaphoreGive(rfTestMutex);
}
pausePrompt = false;
Expand Down
22 changes: 15 additions & 7 deletions Examples/MAX32690/Bluetooth/RF_Test/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ uint8_t processEscSequence(uint8_t *seq)
*
* \brief adds latest command to command history buffer
*
* \param q pointer to the circular buffer holding command history
* \param cmd pointer to the command string to be added
* \param q pointer to the circular buffer holding command history
* \param cmd pointer to the command string to be added
*
* \return None.
*/
Expand All @@ -274,9 +274,9 @@ void cmdHistoryAdd(queue_t *q, const uint8_t *cmd)
* \fn updateQueuePointer.
*
* \brief Updates an internal marker pointing to historical command to be printed, based on up/down arrow
*
* \param q pointer to the circular buffer holding command history
*
*
* \param q pointer to the circular buffer holding command history
*
* \param upArrow flag used to upated the queuePoniter delimiting which command to print
*
* \return None.
Expand Down Expand Up @@ -396,9 +396,9 @@ void prompt(void)
* \fn printHint
*
* \brief Prints the help string of any command matching the current inputbuffer
*
*
* \param buff pointer to the inputbuffer
*
*
* \return None.
*/
/*************************************************************************************************/
Expand Down Expand Up @@ -695,17 +695,25 @@ void txTestTask(void *pvParameters)
snprintf(str, sizeof(str), "%s%s", str, (const char *)getPhyStr(phy));
APP_TRACE_INFO1("%s", str);

//Prevent FreeRTOS from context switching until the LL is finished
vTaskSuspendAll();

/* stat test */
if (testConfig.testType == BLE_TX_TEST) {
res = LlEnhancedTxTest(testConfig.channel, packetLen, packetType, phy, 0);
} else {
res = LlEnhancedRxTest(testConfig.channel, phy, 0, 0);
}
xTaskResumeAll(); //Restore scheduler

APP_TRACE_INFO2("result = %u %s", res, res == LL_SUCCESS ? "(SUCCESS)" : "(FAIL)");
/* if duration value was given then let the test run that amount of time and end */
if (testConfig.duration_ms) {
vTaskDelay(testConfig.duration_ms);
//Prevent FreeRTOS from context switching until the LL is finished
vTaskSuspendAll();
LlEndTest(NULL);
xTaskResumeAll(); //Restore scheduler
xSemaphoreGive(rfTestMutex);
}
pausePrompt = false;
Expand Down
6 changes: 5 additions & 1 deletion Libraries/CMSIS/Device/Maxim/MAX32657/Include/max32657.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ typedef enum {

#include <core_cm33.h>
#include <arm_cmse.h>
#define IS_SECURE_ENVIRONMENT (defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U))
#if defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
#define IS_SECURE_ENVIRONMENT 1
#else
#define IS_SECURE_ENVIRONMENT 0
#endif

/* ================================================================================ */
/* ================== Device Specific Memory Section ================== */
Expand Down
3 changes: 2 additions & 1 deletion Libraries/Cordio/platform/targets/maxim/build/cordio_lib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ ${CORDIO_BUILD_DIR}/${CORDIO_LIB}: ${CORDIO_C_FILES} ${PROJECTMK}
$(MAKE) -f ${CORDIO_DIR}/platform/targets/maxim/build/libCordio.mk lib MAXIM_PATH=${MAXIM_PATH} PROJECT=${CORDIO_LIB} \
CORDIO_LIB_VAR=${CORDIO_LIB_VAR} BUILD_DIR=${CORDIO_BUILD_DIR} MFLOAT_ABI=$(MFLOAT_ABI) \
DUAL_CORE=$(DUAL_CORE) RISCV_CORE=$(RISCV_CORE) TRACE=${TRACE} DEBUG=${DEBUG} RTOS=${RTOS} \
CFG_DEV="${CFG_DEV}" PROJECTMK=${PROJECTMK} BOARD=${BOARD} MXC_OPTIMIZE_CFLAGS=${CORDIO_OPTIMIZE_CFLAGS}
CFG_DEV="${CFG_DEV}" PROJECTMK=${PROJECTMK} BOARD=${BOARD} MXC_OPTIMIZE_CFLAGS=${CORDIO_OPTIMIZE_CFLAGS} \
BT_VER=${BT_VER}


clean.cordio:
Expand Down
50 changes: 33 additions & 17 deletions Libraries/Cordio/platform/targets/maxim/max32655/sources/pal_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,37 +82,51 @@ static struct {
* \return None.
*/
/*************************************************************************************************/
void UART_CommonHandler(mxc_uart_regs_t *uart)
{
const int32_t err = MXC_UART_AsyncHandler(uart);

if(err == E_INVALID)
{
// If the uart is the console, we can try to recover since it is not critical
if(MXC_UART_GET_IDX(uart) == CONSOLE_UART)
{
MXC_UART_ClearRXFIFO(uart);
}
else
{
PAL_SYS_ASSERT(err == E_NO_ERROR);
}
}

}
void UART0_IRQHandler(void)
{
int result0;

PalLedOn(PAL_LED_ID_CPU_ACTIVE);
result0 = MXC_UART_AsyncHandler(MXC_UART0);
(void)result0;
PAL_SYS_ASSERT(result0 == 0);
UART_CommonHandler(MXC_UART0);

}
void UART1_IRQHandler(void)
{
int result1;

PalLedOn(PAL_LED_ID_CPU_ACTIVE);
result1 = MXC_UART_AsyncHandler(MXC_UART1);
(void)result1;
PAL_SYS_ASSERT(result1 == 0);
UART_CommonHandler(MXC_UART1);

}
void UART2_IRQHandler(void)
{
int result2;
{

PalLedOn(PAL_LED_ID_CPU_ACTIVE);
result2 = MXC_UART_AsyncHandler(MXC_UART2);
(void)result2;
PAL_SYS_ASSERT(result2 == 0);
UART_CommonHandler(MXC_UART2);

}
void UART3_IRQHandler(void)
{
int result3;

PalLedOn(PAL_LED_ID_CPU_ACTIVE);
result3 = MXC_UART_AsyncHandler(MXC_UART3);
(void)result3;
PAL_SYS_ASSERT(result3 == 0);
UART_CommonHandler(MXC_UART3);

}

/*************************************************************************************************/
Expand Down Expand Up @@ -159,6 +173,8 @@ void RISCV_IRQHandler(void)
/*************************************************************************************************/
void palUartCallback(mxc_uart_req_t* req, int error)
{


int i;
for(i = 0; i < PAL_UARTS; i++) {
/* Find the corresponding rqeuest and call the callback */
Expand Down
Loading

0 comments on commit a59f777

Please sign in to comment.