[BUG] STM32 HAL drivers are not interrupt-safe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-04-09 9:05 AM
In function HAL_DMA_IRQHandler() the lines 872, 914, 949 modify the hdma->State variable after __HAL_UNLOCK(hdma) has been called.
STM32 HAL is full of bugs, especially race condition related ones, but this one seems to be more urgent, because multiple instances of the DMA are used together with many other peripherals in different combinations. I'm reporting this for F7, but drivers for other series also should be checked for the same.
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-04-16 9:22 AM
Hi @Piranha ,
I confirm this issue and insured that the team is currently working on fixing all impated drivers. So that state change will be before unlock
/* Change the DMA state */
hdma->State = HAL_DMA_STATE_READY;
/* Process Unlocked */
__HAL_UNLOCK(hdma);
Thank you for your feedback and for helping us improve the ST products !
Imen
Thanks
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-04-13 6:44 AM
Hello @Piranha ,
Thanks for your post. I have raised your request to the involved team to take a closer look at this issue and treated it accordingly to the priority.
I will give you an update as soon as possible.
Thanks for your contribution.
Imen
Thanks
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-04-16 9:22 AM
Hi @Piranha ,
I confirm this issue and insured that the team is currently working on fixing all impated drivers. So that state change will be before unlock
/* Change the DMA state */
hdma->State = HAL_DMA_STATE_READY;
/* Process Unlocked */
__HAL_UNLOCK(hdma);
Thank you for your feedback and for helping us improve the ST products !
Imen
Thanks
Imen
