I have a project that I have used stm32f746g discovery board. It receives data with fixed size from Uart sequentially and to inform application about each data receive completed, dma callback is used (HAL_UART_RxCpltCallback function). It works fine at the beginning but after several minutes of running, the dma callback stops to be called, and as a result, the specified parameter value doesn't get updated. Because the parameter is used in another thread too (actually a rtos defined timer), I believe this problem is caused by lacking of thread safety. But my problem is that mutex and semaphore don't be supported in ISRs and I need to protect my variable in dma callback which is an interrupt routine. I am using keil rtx to handle multithreading and the timer I use is osTimer that is defined in rtx. How can I handle the issue?
Uart dma receive interrupt stops receiving data after several minutes
1.2k Views Asked by masoud At
1
There are 1 best solutions below
Related Questions in MUTEX
- What is a 'map' in terms of Ansible variables?
- Vagrant - Ansible error installing Apache
- How can I pass variable to ansible playbook in the command line?
- How to add apt key with --recv-keys instead of --recv?
- Ansible inventory parameters for pem key
- Ansible git clone 'Permission Denied' but direct git clone working
- Register variable in ansible and using custom filter in when
- Ansible git clone as root
- Ansible - conditionally include a file in a role
- Extracting file persmission data in Ansible
Related Questions in SEMAPHORE
- What is a 'map' in terms of Ansible variables?
- Vagrant - Ansible error installing Apache
- How can I pass variable to ansible playbook in the command line?
- How to add apt key with --recv-keys instead of --recv?
- Ansible inventory parameters for pem key
- Ansible git clone 'Permission Denied' but direct git clone working
- Register variable in ansible and using custom filter in when
- Ansible git clone as root
- Ansible - conditionally include a file in a role
- Extracting file persmission data in Ansible
Related Questions in UART
- What is a 'map' in terms of Ansible variables?
- Vagrant - Ansible error installing Apache
- How can I pass variable to ansible playbook in the command line?
- How to add apt key with --recv-keys instead of --recv?
- Ansible inventory parameters for pem key
- Ansible git clone 'Permission Denied' but direct git clone working
- Register variable in ansible and using custom filter in when
- Ansible git clone as root
- Ansible - conditionally include a file in a role
- Extracting file persmission data in Ansible
Related Questions in DMA
- What is a 'map' in terms of Ansible variables?
- Vagrant - Ansible error installing Apache
- How can I pass variable to ansible playbook in the command line?
- How to add apt key with --recv-keys instead of --recv?
- Ansible inventory parameters for pem key
- Ansible git clone 'Permission Denied' but direct git clone working
- Register variable in ansible and using custom filter in when
- Ansible git clone as root
- Ansible - conditionally include a file in a role
- Extracting file persmission data in Ansible
Related Questions in STM32F7
- What is a 'map' in terms of Ansible variables?
- Vagrant - Ansible error installing Apache
- How can I pass variable to ansible playbook in the command line?
- How to add apt key with --recv-keys instead of --recv?
- Ansible inventory parameters for pem key
- Ansible git clone 'Permission Denied' but direct git clone working
- Register variable in ansible and using custom filter in when
- Ansible git clone as root
- Ansible - conditionally include a file in a role
- Extracting file persmission data in Ansible
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Generally, only one thread should communicate with the ISR. If multiple threads are accessing a variable shared with an ISR, your design is wrong and needs to be fixed. In case of DMA, only one thread should access the buffer.
You'll need to protect the variables shared between that thread and the ISR - not necessarily with a mutex/semaphore but perhaps with something simpler like guaranteeing atomic access (best solution if possible), or by using the non-interrruptable abilitiy that many ISRs have. Example for simple, single-threaded MCU applications. Alternatively just temporarily disable interrupts during access, but that may not be possible, depending on real-time requirements.