



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The instructions and questions for a 2-hour exam on embedded systems software development for students pursuing a master of engineering in telecommunications engineering at cork institute of technology. The exam covers topics such as statecharts, finite state machines, inter-task communications, frame size, static scheduler, and interrupt handling in the context of an rtos. Students are required to answer question 1 and any two other questions, and may use class notes. The exam is overseen by mr. P. French, dr. S. Mcgrath, mr. A. Murphy, and mr. D. O’donovan.
Typology: Exams
1 / 5
This page cannot be seen from the preview
Don't miss anything!




Read instructions carefully Answer Question 1 AND any TWO other questions. Class notes MAY be used.
Examiners: Mr. P. French Dr. S. McGrath Mr. A. Murphy Mr. D. O’Donovan
a) Discuss the benefits of statecharts over finite state machines. Use the microwave oven in Figure 5 to illustrate your answer. [6 %]
b) Describe each of the following concepts used for inter-task communications in a typical RTOS. i. Event flag group ii. Pipe iii. Mailbox. [6 %]
c) Select a situation from Figure 5 to illustrate how an event flag group may be applied. [2 %]
d) Taking any 2 of the communications mechanisms discussed in b) show, using μC/OS-II RTOS commands, how you would
(continued over)
e) In Figure 5, assume the (period, execution time) for the following tasks are: ‘Cooking’ task (10, 4) ‘Displaying’ task (15, 4) ‘Door’ task (6, 1) where all values quoted are in milliseconds.
For the three periodic tasks above: i. Select an appropriate frame size [2 %] ii. Determine an appropriate static scheduler for the corresponding hyper- period. [6 %] iii. How would such a scheduler be implemented in practice? [4 %]
f) ‘The commands void OSIntEnter(void) and void OSIntExit(void) should be called on entry and exit of an ISR in the μC/OS-II RTOS.’
Discuss why these two commands are required. During your discussion make reference to inter-task communications and nesting interrupts. [6 %]
b) Why is the keyword ‘volatile’ in the C language a necessity in terms of RTOS. [2 %]
c) Consider the following generic RTOS code: (It is assumed that GetLevelValue() and SetOffAlarm()exist.) static int iLevels[2]; void interrupt vReadLevels (void) { iLevels[0] = GetLevelValue(); iLevels[1] = GetLevelValue(); } void main (void) { int iLevel0, iLevel1; while (TRUE) { iTemp0 = iLevels[0]; iTemp1 = iLevels[1]; if (iLevel0 != iLevel1) { SetOffAlarm(); } } } Figure 1 (continued over)
b) Describe what is meant by Priority inversion how μC/OS-II RTOS deals with this issue [6 %] c) Draw a table showing the outcome of Figure 3 for a priority-driven, pre-emptive scheduler for a two processor system. [15 %]
Figure 3
b) Describe the problem associated with the unblocking of higher priority tasks from interrupt routines, as illustrated in Figure 4. How may this problem be remedied? [5 %]
Figure 4
c) How are interrupts connected to the shared data problem in RTOSs? Describe 2 methods for solving this problem. [6 %] (continued over)
d) In a static schedule RTOS configuration, explain one approach for dealing with the occurrences of interrupts? [4 %]
e) Explain, using examples, how jitter is introduced into RTOS timing delay. How can such delays be minimised? [7 %]
Figure 5
evEnter
evCook[IS_IN(DoorClosed)/cookTiime = params->timeToCook(cookTime);
Emitter Idle
Door Clock Source
Cooking
Microwave Oven
entry/theEmitter->disable()
tm(CookTime)
evDoorOpen evCook[IS_IN(DoorClosed)]
evStop
evSetPower/pclOn = params->pclOb; OnTime = 1000 * pclOn;OffTime = 1000 * (1-pclOn);
WaitingToEmit tm(OnTime)/theEmitter->Disable(); Emitting
tm(OffTime)/theEmitter->enable();
DoorOpen DoorClosed
evDoorClose evDoorOpen WaitingForTick
tm(1000)/++timeOfDay; GEN(evTick);
[else] [isDoorClosed()]
DisplayTimeOfDay entryClock ->show(timeOfDay);
evTick/theClock ->show(timeOfDay) Processing
DisplayTimeOfDay entry/theDisplay ->show(cmd);
evTick/--cookTiime; theTimer ->show(cookTime);
DisplayingCookTime
tm(CookTime)
evStop (^) evStop
evKeyPress/cmd = params->key;
/cmd += params->key;
Displaying
Emitting
C