STcube MX code issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-12-17 8:30 PM
Hi Team,
Facing some issues on below
- HAL Delay goes into infinite loop or the program stops there only (Inside the "IF" condition)
- "IF" Condition works, data transfer works, but Toggling of pin, or any action with Delay command is not working
- Upon going thru the literature, found that priority clash between Interrupt and delay, but not convinced also changed the "Premption Priority" tried and not worked.
- Share your insights and go ahead directions to control activities thru' UART between MCUs (Tried in F4, L0, CubeMX+Keil & CubeMX+Truestudio)
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(huart);
/* NOTE : This function should not be modified, when the callback is needed,
the HAL_UART_RxCpltCallback can be implemented in the user file.
*/
if (receivedata[0] == 'a')
{
HAL_UART_Transmit(&huart2,transmitData2,10,10);
HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_13);
HAL_Delay(1000);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_13, GPIO_PIN_RESET);
}
- Labels:
-
STM32Cube MCU Packages
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-12-18 8:54 AM
HAL_UART_RxCpltCallback is likely called from the UART interrupt handler.
Do not use HAL_Delay in an interrupt handler.
-- pa
