Are there any STMF0 examples available for the USART address mark detection wakeup?
I can find examples in the STMF0 Cube folders for wakeup from STOP for various peripherals; however, I cannot find any examples of address mark detection wakeup for USART.
I have attempted to implement the address mark detection wakeup via the description in the STMF0 Reference Manual, Section 27.5.7. And, I have attempted to implement my project via the code references I can find in the stm32f0xx_hal_uart.c and stm32f0xx_hal_uart_ex.c (which are few). However, the HAL_UARTEx_WakeupCallback() is never called, and the interrupts never stop reception of data. So, I cannot seem to figure out what isn't being setup correctly.
In my USART init function, I am setting up my word length to be 9 bits; I am disabling MSBFIRST; and, I am using the HAL_MultiProcessor_Init() function to setup the address mark wakeup method. I assume, since there is no separate "SetAddress()" function, that this is the way to set the device address:
huart1.Instance = USART1;
huart1.Init.BaudRate = 115200;
huart1.Init.WordLength = UART_WORDLENGTH_9B;
huart1.Init.StopBits = UART_STOPBITS_1;
huart1.Init.Parity = UART_PARITY_NONE;
huart1.Init.Mode = UART_MODE_TX_RX;
huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart1.Init.OverSampling = UART_OVERSAMPLING_16;
huart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
huart1.AdvancedInit.MSBFirst = UART_ADVFEATURE_MSBFIRST_DISABLE;
huart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_MSBFIRST_INIT;
if (HAL_MultiProcessor_Init(&huart1, 0x00, UART_WAKEUPMETHOD_ADDRESSMARK) != HAL_OK)
{
Error_Handler();
} else {
HAL_MultiProcessorEx_AddressLength_Set(&huart1, UART_ADDRESS_DETECT_7B);
HAL_MultiProcessor_EnableMuteMode(&huart1);
HAL_MultiProcessor_EnterMuteMode(&huart1); // Tried with and without this line
}Then, I setup my interrupt for USART1 and call HAL_UART_Receive_IT() to start receiving.
However, my HAL_UARTEx_WakeupCallback() function is never called. I get callbacks to HAL_UART_RxCpltCallback() constantly.
Is there any example for multiprocessor UART communication using the address mark detection?
Thanks for any help in advance.