| 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]
using setjmp and longjmpPosted by joe_her  on October 16, 2016Is it OK to use longjmp inside a task? 
What if I have an error detected deeply nested, and I want to jump to a "clean" location in the task ( for example some error in communication hardware, needs to restart it, etc.)
Thanks
 using setjmp and longjmpPosted by rtel  on October 16, 2016I have to be honest and say I have no idea, although I would suspect not 
unless you can find some way of making it thread aware.  I have used 
these functions to jump from a running FreeRTOS application back to a 
host environment, but not within a task.
 using setjmp and longjmpPosted by richard_damon  on October 16, 2016My guess is that a setjmp/longjmp within a single task will likely work (and between tasks will cause all sorts of problems). setjmp/longjmp shouldn't have thread issue themselves, as all the information should be in the jmpbuf, but they would have no knowledge of how to change threads.
 using setjmp and longjmpPosted by happygimp0  on February 17, 2017Possible Problem with Microcontrollers which need more then a single instruction to manipulate the stack pointer: 
In longjmp() you change the stack pointer, while you change it, a scheduler interrupt can happen, scheduler want to store the current registers on stack, the stack pointer points on a more or less random location and the push commands rewrite some random locations. 
Such a bug will be very hard to find, it is very unlikely that the timer interrupt is exactly at this moment and it is possible that you overwrite always other places.
						
 
 
						
 
							
								Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.  |