Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

Suspend a task till the dma isr returns

Posted 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 returns

Posted 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


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS