0% found this document useful (0 votes)
2 views3 pages

2018 Spring Soln

The document is an exam paper for the course CSE 345&347 on Real-Time and Embedded Systems Design from Ain Shams University, dated June 2nd, 2018. It consists of 6 questions, with specific tasks related to FreeRTOS application and debugging sessions, requiring students to analyze task states and execution timing diagrams. The total marks for the exam are 40, and it is designed to be completed in 3 hours.

Uploaded by

zainbmaged114
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

2018 Spring Soln

The document is an exam paper for the course CSE 345&347 on Real-Time and Embedded Systems Design from Ain Shams University, dated June 2nd, 2018. It consists of 6 questions, with specific tasks related to FreeRTOS application and debugging sessions, requiring students to analyze task states and execution timing diagrams. The total marks for the exam are 40, and it is designed to be completed in 3 hours.

Uploaded by

zainbmaged114
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

95 79 98

77 82 100
79 95 98
82 77 95
84 84 77
86 86 79
98 79 82
100 82 84
95 84 86
77 86 98
AIN SHAMS UNIVERSITY
FACULTY OF ENGINEERING
CREDIT HOURS ENGINEERING PROGRAMS
June 2nd.,2018 I
Course Code: CSE 345&347
Real-Time and Embedded Systems Design
A
Time: 3 Hours

The Exam Consists of 6 Questions in 6 Pages I Total Marks: 40 Marks I 5/6

Ouesti.on (5): (8 Marks)


The figure below is a snap shot from FreeRTOS application using tasks communicating through a
queue. Fill the given table with task states (Ready, Running, or Blocked) in consecutive time slots Tx.
Show the content of the queue at the end of each slot assuming initial HEX value of (00 00 00 00 - 00
00 00 00 - 00 00 00 00). "Sender 2" is the first running task just after scheduler-start in T 1.
60 int main( void)
61- - {
62 xQueue = xQueueCreate( 3, sizeo£( long ) );
63 �( vSenderTask, "Sender1-", 2 40, ( void "-· ) '.l O O, 2, NULL );
64 �( vSenderTask, "Sender2", 240, ( void ,,. ) 200, 2, NULL ) ;
65 �( vReceiverTask, "Receiver", 2 4 0, NULL, ]. , NULL ) ;
66 v'Task.StartScheduler();
67
68 static void vSenderTask( void *pvParameters )
69 - {

71- canst portTickType xTicksToWait = 1-00 / portTICK_RATE_MS;


72 lValueToSend = ( long ) pvParameters;
73 £or( ; ; )
{
75 x.QueueSendToB-ack( xQueue, &lValueToSend, x.TicksToWait );
76 task YIELD();
77
78
79 static void vReceiverTask( void *pvParameters )

81- long lReceivedValue;


82 £or( ; ; )
83 - {
84 xQueueReceive( xQueue, &lReceivedValue, 0 );
85 vPrintStringAndNutmber( "Received = ", lReceivedValue );
86
87

Sender 1 Sender 2 Receiver Queue Content at The End of Tx Period


Tl Running C8 00 00 00 00 00 00 00 00 00 00 00
T2
T3
T4
TS
T6
T7
TS
T9
TlO
Tll
T12
T13
T14
T15
T16

Sherif Hammad P.T.O


AIN SHAMS UNIVERSITY
FACULTY OF ENGINEERING
CREDIT HOURS ENGINEERING PROGRAMS
June 2nd.,2018 I
Course Code: CSE 345&347
Real-Time and Embedded Systems Design
Time: 3 Hours
A
The Exam Consists of 6 Questions in 6 Pages I Total Marks: 40 Marks I 6/6

Ouesti.on (6):(8 Marks)


The figure below is a snap shot from a debugging session. Show the sequence of execution timing
diagram starting just after vTaskStartScheduler. Tasks should be shown down-up vertically according
to their priorities (e.g. Highest priority should be on the top). Also show the debug (print£) viewer.
82 .i.nt ma.i.n( vo1d.)
83
8"1 vSemaphoJI:eCJI:eateBinary( xB.i.narySemaphoJI:e );
85 if( xBinarySemaphoJI:e ! = NULL)
86 {
87 prvSetupSoftwaJI:einteil:i!:Upt();
88 �( vHand.1e i!:Task, "Hand..1er", 2 "10 , NULL, l, NULL);
89 ���( vPeriodicTask, "Per.i.od..i.c", 2"10, NULL, 3, NULL);
90 v'TaskStartScb.edu.1ei!:();
9l }
92 }
93 stat1c void vHand.1eJI:Task( void. pvParameters}
9"1
95 xSemaph.oJI:eTake( xBi.narySemaphoJI:e, 0 )';
96 for( ; ; ),
97 {
98 xSemaphoJI:eTake( xBinarySemaphoJI:e, portMAX_DE.LAY J,;
99 vPrintString( "fland..1er task - Processing event.'\n");
lOO }
lOJ. }
l02 stat1c void vPer.i.od..i.cTask( vo.i.d. pvParameteJI:s}
l03
lO"l for( ;;
l05 {
l06 vTaskDe.1ay( 500 / portTICK_RATE_MS ),;
l07 vPrintString( "Per.i.od.i.c task - About to generate an i.nterrupt.'\n" );
l08 mainTRIGG:ER_INTERRUPT();
l09 vPJI:.i.ntStJI:ing( "PeI.i.od.i.c task - InteIIupt geneiatect.'\n'\n" );
llO }
lll }
ll2 void. vSoftwaJI:einteIJI:uptHand.1eI ( vo.i.d.)

��!
ll5 l
!ortBASE TYPE xHi.gheJI:PJI:i.oJI:.i.tyTaskWoken = pd.FALSE;
xSemaphoJI:eGiveFJI:omISR( xBinaiySemaphoJI:e, &xH1gheIPI10I1tyTaskWoken);
ll6 mainCLEAR_INTERRUPT();
ll7 poitEND_SWITCHING_ISR( xH..i.ghei!:PJI:ioJI:i.tyTask:Woken);
l.18 }

End of Questions

Sherif Hammad P.T.O

You might also like