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] Power failPosted by ady001 on May 3, 2016 When my application detects a power fail I'd like to 'kill' the RTOS ( stop all tasks ) so that 100% micro processing resource is available for PF Code. Probably there is no graceful way for code execution to reach PF Code ? I need to execute PF Code directly following execution of code at a certain point within the low priority task that is fully responsible for non volatile storage access ( I'd like to 'kill' the RTOS from this task ).
/* Finally start the scheduler. */
vTaskStartScheduler();
/* PF Code: ( all tasks and RTOS are now 'dead' )
/* Save all my data to non volatile storage */
/* Force a micro reset */
/* Will only reach here if there is insufficient heap available to start
the scheduler. */
return 0;
Power failPosted by rtel on May 3, 2016 Which architecture are you running on? Few ports provide an "end
scheduling" function as there is nothing to return to. For example the
Cortex-M port re-uses the stack that was used by main().
However, why not perform this processing from any task - or even a high
priority task that runs in response to a power fail event? The task can
enter a critical section to stop RTOS interrupts interfering with your
post power fail processing.
Power failPosted by ady001 on May 4, 2016 I'll use a critical section as you suggest within my PIC24 architecture.
I was just hoping to exit RTOS gracefully rather than reset the micro from within a task
i.e.
Pre RTOS tasks ( hardware initialization etc. )
RTOS starts
Post RTOS tasks ( save power fail data, reset micro )
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|