2025-10-23 6:26 AM
Im using a STM32WLE5CCU6 board, I am able to log easily using the APP_LOG() helper function that is provided. The problem is that im not able to receive anything as the USART interrupt never fires hence,
UTIL_ADV_TRACE_Status_t vcom_Trace_DMA(uint8_t *p_data, uint16_t size)
{
/* USER CODE BEGIN vcom_Trace_DMA_1 */
/* USER CODE END vcom_Trace_DMA_1 */
HAL_UART_Transmit_DMA(&huart1, p_data, size);
return UTIL_ADV_TRACE_OK;
/* USER CODE BEGIN vcom_Trace_DMA_2 */
/* USER CODE END vcom_Trace_DMA_2 */
}
then interrupt starts working but obviously logging will stop. I haven't found a solution which enables me to transmit and receive at the same time. I am attaching the .ioc file for reference. Any help will be really helpful.
This is how I am enabling RX using the helper utilities
void SystemApp_Init(void)
{
/* USER CODE BEGIN SystemApp_Init_1 */
/* USER CODE END SystemApp_Init_1 */
/* Ensure that MSI is wake-up system clock */
__HAL_RCC_WAKEUPSTOP_CLK_CONFIG(RCC_STOP_WAKEUPCLOCK_MSI);
/*Initialize timer and RTC*/
UTIL_TIMER_Init();
SYS_TimerInitialisedFlag = 1;
/* Initializes the SW probes pins and the monitor RF pins via Alternate Function */
DBG_Init();
/*Initialize the terminal */
UTIL_ADV_TRACE_Init();
UTIL_ADV_TRACE_RegisterTimeStampFunction(TimestampNow);
/*Set verbose LEVEL*/
UTIL_ADV_TRACE_SetVerboseLevel(VERBOSE_LEVEL);
/*Init low power manager*/
UTIL_LPM_Init();
/* Disable Stand-by mode */
UTIL_LPM_SetOffMode((1 << CFG_LPM_APPLI_Id), UTIL_LPM_DISABLE);
#if defined (LOW_POWER_DISABLE) && (LOW_POWER_DISABLE == 1)
/* Disable Stop Mode */
UTIL_LPM_SetStopMode((1 << CFG_LPM_APPLI_Id), UTIL_LPM_DISABLE);
#elif !defined (LOW_POWER_DISABLE)
#error LOW_POWER_DISABLE not defined
#endif /* LOW_POWER_DISABLE */
/* USER CODE BEGIN SystemApp_Init_2 */
UTIL_ADV_TRACE_StartRxProcess(NULL);
/* USER CODE END SystemApp_Init_2 */
}
Also simple python code which sends single character and makes the LED toggle to check RX
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
/* USER CODE BEGIN HAL_UART_RxCpltCallback_1 */
HAL_GPIO_TogglePin(LED3_GPIO_Port, LED3_Pin);
/* USER CODE END HAL_UART_RxCpltCallback_1 */
if (huart->Instance == USART1)
{
if ((NULL != RxCpltCallback) && (HAL_UART_ERROR_NONE == huart->ErrorCode))
{
RxCpltCallback(&charRx, 1, 0);
}
HAL_UART_Receive_IT(huart, &charRx, 1);
}
/* USER CODE BEGIN HAL_UART_RxCpltCallback_2 */
/* USER CODE END HAL_UART_RxCpltCallback_2 */
}
TLDR: USART TX and RX work individually, doesn't work simultaneously when using helper functions provided by STM32 WL package