Difference between revisions of "Embedded System Tutorial File I/O"

From Embedded Systems Learning Academy
Jump to: navigation, search
(Assignment)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
Socialledge is moving to two portals. 
 +
*  The Wiki will remain here for general references about the SJ-One board, and to document student reports.
 +
*  The bookstack will now be used for SJSU assignments
 +
 +
[http://books.socialledge.com/books/embedded-drivers-real-time-operating-systems/chapter/lesson-watch-dogs This article has been moved here]
 +
 +
<!--
 +
 
In this project, we will attempt to "combine" all the FreeRTOS knowledge into a single assignment.
 
In this project, we will attempt to "combine" all the FreeRTOS knowledge into a single assignment.
  
  
After completing the assignment, you will get a sensor of how the CPU is utilized, and how to use a new FreeRTOS event group API.  All together, you should acheive a better sense of designing your tasks and using the File I/O for debugging purposes.
+
After completing the assignment, you will get a sense of how the CPU is utilized, and how to use a new FreeRTOS event group API.  All together, you should achieve a better sense of designing your tasks and using the File I/O for debugging purposes.
  
  
Line 24: Line 32:
 
#  Create a '''<code>watchdog task</code>''' that monitors the operation of the two tasks.
 
#  Create a '''<code>watchdog task</code>''' that monitors the operation of the two tasks.
 
#*  Use high priority for this task.
 
#*  Use high priority for this task.
#*  Every sixty seconds, save the CPU usage info to a file named "cpu.txt".  See terminal command "infoHandler" for reference.  Open the file, write the file, and close it immediately so the data is immediately flushed.
 
 
#*  Use a timeout of 1 second, and wait for all the bits to set.  If there are two tasks, wait for bit1, and bit2 etc.
 
#*  Use a timeout of 1 second, and wait for all the bits to set.  If there are two tasks, wait for bit1, and bit2 etc.
 
#*  If you fail to detect the bits are set, that means that the other tasks did not reach the end of the loop.
 
#*  If you fail to detect the bits are set, that means that the other tasks did not reach the end of the loop.
 
#*  In the event of failed to detect the bits, append a file (stuck.txt) with the information about which task may be "stuck"
 
#*  In the event of failed to detect the bits, append a file (stuck.txt) with the information about which task may be "stuck"
 
#*  Open the file, append the data, and close the (stuck.txt) file to flush out the data immediately.
 
#*  Open the file, append the data, and close the (stuck.txt) file to flush out the data immediately.
 +
#*  Extra Credit: Every sixty seconds, save the CPU usage info to a file named "cpu.txt".  See terminal command "infoHandler" for reference.  Open the file, write the file, and close it immediately so the data is immediately flushed.
 
#  Create a terminal command to "suspend" and "resume" a task by name.
 
#  Create a terminal command to "suspend" and "resume" a task by name.
 
#*  "task suspend task1" should suspend a task named "task1"
 
#*  "task suspend task1" should suspend a task named "task1"
Line 38: Line 46:
  
 
What you created is a "software watchdog".  This means that in an event when a loop is stuck, or a task is frozen, you can save relevant information such that you can debug at a later time.
 
What you created is a "software watchdog".  This means that in an event when a loop is stuck, or a task is frozen, you can save relevant information such that you can debug at a later time.
 +
-->

Latest revision as of 20:10, 25 January 2019

Socialledge is moving to two portals.

  • The Wiki will remain here for general references about the SJ-One board, and to document student reports.
  • The bookstack will now be used for SJSU assignments

This article has been moved here