Quality RTOS & Embedded Software

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


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 ]    [ Privacy ]    [ Sitemap ]    [ ]


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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

Xilinx Microblaze and Zynq partner