FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [May 2016 Threads] Suspend a task till the dma isr returnsPosted by cjedic on May 31, 2016 I'm trying to write drivers for our peripherals using dma's on all writes over 1 word. I use mutexes inside the read and write block functions for the peripheral and I have tried using a suspend within the take/give mutexes to suspend the task while waiting for the isr to return and resume my task. However, I am finding the isr is happening before the suspend is completed, meaning the task never gets resumed because the resume has already happened.
I have thought about using a semaphore but it continues to execute once I have taken the semaphore when what I really want to do is suspend.
What are your thought or suggestions? Any other solutions I'm missing?
Suspend a task till the dma isr returnsPosted by rtel on May 31, 2016 First thought - definitely DO NOT use a suspend/resume for synchronising
tasks with interrupts for exactly the reason you have experienced, which
is the reason stated on the API documentation pages for not attempting this.
In most cases the optimal solution is to use a direct to task
notification. See the examples on the following pages:
http://www.freertos.org/RTOSTaskNotificationAsBinary_Semaphore.html
http://www.freertos.org/ulTaskNotifyTake.html
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|