memcpy in ISR Context when another memcpy() was already running on main thread or another ISR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-12 3:25 AM
Is it safe to use memcpy() in an ISR when another memcpy() was already running on main thread or another ISR?
I am getting conflicting info on web about using memcpy() in an ISR to copy data between two uint32_t buffers.
MCU: STM32H723
CubeIDE V: 1.16.0
Solved! Go to Solution.
- Labels:
-
Interrupt
-
STM32H7 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-12 4:34 AM
Yes, it's thread safe. The operations are independent, there is no shared configuration data or internal state to worry about.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-12 4:34 AM
Yes, it's thread safe. The operations are independent, there is no shared configuration data or internal state to worry about.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-12 4:52 AM
The problem would come if the structure ends up with partially old data and partially new data.
In RTOS systems you might want to lock the operations with a semaphore or mutex, so you can recover content in a more atomic fashion.
Up vote any posts that you find helpful, it shows what's working..
