issue with UART call back function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-01 2:42 AM
Hello Everyone!!
i am using HAL_UART_RxCpltCallback function in my program, whenever i receive 9 bytes of data via uart an interrupt will trigger and the above mentioned function will get called and execute but the issue is if i sent a 9 bytes command for the very first time then it is not responding to that command and from 2nd time onwards it is working properly. may i know the reason why the callback function not working for the very first time when cmd is sent and y it is working properly from the next time onwards. here are few pics about my code.
- Labels:
-
AzureRTOS
-
STM32Cube MCU Packages
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-01 6:12 AM
A few bad things are happening here:
- Blocking functions are used within the interrupt, specifically HAL_UART_Transmit, which may cause overflows.
- HAL_UART_Receive_IT is being called from the main thread and from within the interrupt. Only do it in one place.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-01 6:56 AM
Sometimes, uninitialized buffers can cause unexpected behavior during the initial reception.
