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] [October 2016 Threads] xQueueTakeMutexRecursive not supported from an ISRPosted by jon-gordon on October 13, 2016 Using Tracealyzer for FreeRTOS, I'm trying to call a vTracePrintF from inside an ISR.
The code works fine for non-ISR and I see my event printed but inside the ISR, I end up with an assert failure because in xQueueTakeMutexRecursive, there is a call to xQueueGenericReceive without checking whether the "fromISR" alternative should be called instead.
Is this an oversight or am I missing something?
Cheers,
Jon
xQueueTakeMutexRecursive not supported from an ISRPosted by edwards3 on October 13, 2016 The trace recorder is source code so you can edit the code to check if you are in an interrupt, but also check if vTracePrintF is ok to call from an interrupt. You would not normally want to call the library printf() from there because its slow, stack heavy and not reentrant.
xQueueTakeMutexRecursive not supported from an ISRPosted by richard_damon on October 13, 2016 Generally it doesn't make sense to use a mutex in an ISR, as the ISR has no way to 'wait' for the shared resource to become available.
As MEdwards said, 'printing' something in a ISR is almost certainly a bad idea,
xQueueTakeMutexRecursive not supported from an ISRPosted by jon-gordon on October 17, 2016 I had figured it was using its own derived version of a printf routine but alas, no, it uses my compiler's version which attempts to be thread safe by using a mutex - hence the problem.
I'll stick to SEGGER's RTT for printing in an ISR then. Would just have been nice to have the interrupt behaviour observed in Tracealyzer but I must be missing something else there.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|