Infotronik
HSLU - HS17 Systemstrukturierung und Programmierung von Embedded Systems
HSLU - HS17 Systemstrukturierung und Programmierung von Embedded Systems
Kartei Details
Karten | 185 |
---|---|
Sprache | Deutsch |
Kategorie | Elektronik |
Stufe | Universität |
Erstellt / Aktualisiert | 08.10.2017 / 06.12.2018 |
Weblink |
https://card2brain.ch/box/20171008_infotronik
|
Einbinden |
<iframe src="https://card2brain.ch/box/20171008_infotronik/embed" width="780" height="150" scrolling="no" frameborder="0"></iframe>
|
The abbreviation SWV stands for the following on ARM Cortex:
Implement a possible Round Robin Scheduling (preemtive) using the following functions: System_Init(), Task1(), Task2() and Task3():
void main ( void ) {
System_Init ( ) ;
for ( ; ; ) {
Task1 ( ) ;
Task2 ( ) ;
Task3 ( ) ;
}
}
Explain in a few words what Cooperative Scheduling means:
- Context switches treten nur auf wenn ein Task blockiert oder explizit anfordert (Task sind kooperativ untereinander)
- The 'super loop' reads the system time, and depending on the system time it decides which task to run.
- It is cooperative in the sense that each task needs to return to the 'super loop' in a timely fashion.
German: - Die 'Superschleife' liest die Systemzeit und entscheidet abhängig von der Systemzeit, welche Aufgabe ausgeführt werden soll.
- Es ist kooperativ in dem Sinne, dass jede Aufgabe rechtzeitig zur "Superschleife" zurückkehren muss.
What is the main advantage of Cooperative Scheduling compared to Round Robin Scheduling?
Die Häufigkeit der ausgeführten Aufgaben hängt nicht von der Ausführungszeit der Aufgabe ab (solange die Aufgaben die Zeitfenster / Zeitgenauigkeit nicht überschreiten).
(engl.: The frequency of the executed tasks is not depending on the task execution time (as long as the tasks are not exceeding the time slots/timing precision).
What is the main disadvantage of Cooperative Scheduling compared to using an RTOS?
There is no preemption.
Explain in a few words what Round Robin Scheduling means:
Mehrere Dinge werden nacheinander und sequentiell ausgeführt.
(engl.: Multiple things are done in sequence and in a sequential need.)
Explain in a few words what Predictability means:
In der Lage zu sagen, was das System mit einem bestimmten Status macht.
Explain in a few words what Scalability means:
Ein System neu hinzuzufügen oder zu erweitern
Write below the source code to create a FreeRTOS task:
xTaskCreate (myTask, "myTask", configMINIMAL_STACK_SIZE, NULL, 1, NULL);
Another term for a Round Robin scheduler is:
Using the concept of Concurrent Tasks means:
What is the main advantage of Preemptive Scheduling?
- bessere Reaktionsfähigkeit und Skalierbarkeit des Systems
- real-time response on the task level
FreeRTOS offers the following features
In FreeRTOS, the task are running in a infinite loop because:
On ARM Cortex-M, the following is typically used as RTOS time base:
Write a FreeRTOS task to blink an LED every 500 ms:
void task(void *param) {
for(;;){
LED1_Neg();
vTaskDelay(500/port_TICK_PERIOD_MS);
}
}
With configMINIMAL_STACK_SIZE set to 200, this means how many bytes for the task stack on a ARM Cortex-M4F?
In FreeRTOS, TCB stands for
To create a FreeRTOS task, I have to provide:
A Context Switch means:
If you FreeRTOS application stops in vApplicationMallocHook :
With Statistical Profiling I see:
On ARM Cortex, it is possible to have a 32bit hardware multiplication synthesized in the core. Why is this different for M0+ and M4?
- Für Synthetisierung benötigt es mehr Chip Fläche -> höhere Kosten
- Grösserer Chip -> bessere Performance - hier schneller Vervielfachung
If adding a new event to the list of events in evnt.h, what do you have to consider?
A new event has to be above the EVNT_NOF_EVENTS.
List 3 possible states of a task:
- Ready
- Running
- Blocked
- Suspended
What is a main difference in using semaphore or mutex in FreeRTOS?
- Mutex: die Resource wird blockiert und gehört dem Task bis wieder zurückgegeben wird
- Semaphor: Ressource wird nicht geblockt und muss nicht zurückgegeben werden
- If a Mutex is taken by a task the resource is locked and owned by this task until it is given back.
- A semaphore is used to notify a task by giving the semaphore to another task which is pending for it. No giving back is required. The resource is not locked!
What does Priority Inheritance mean?
Wenn eine Aufgabe mit höherer Priorität eine Ressource benötigt, die bereits durch eine Aufgabe mit niedrigerer Priorität gesperrt ist, wird die Aufgabe mit niedrigerer Priorität vorübergehend erhöht, um die gleiche Priorität zu erreichen, um die Aufgabe schnell zu erledigen und die Ressource für die Aufgabe mit höherer Priorität freizugeben.
Provide a list of good reasons why to use macros:
- Verwenden von Namen anstelle von "magischen" Zahlen (Verwendung für die Konfiguration zur Kompilierungszeit)
- Verbergen von Dingen für die Portabilität
- Optimierung, da Textersetzung als Inlining* verwendet werden kann
*Inline-Ersetzung ist eine Optimierungstechnik von Compilern zur Steigerung der Ausführungsgeschwindigkeit eines Computerprogramms.
What is a header and source file? What should be considered when using those two files?
- *.c is the implementation file - It contains the definition, also Sourcefile
- *.h is the Interface/Header File - Contains the external declarations
Comment:
Stelle nur in der Headerdatei dar, was benötigt wird. Das Sourcefile enthält die Schnittstellen, die für die Implementierung verwendet wird.
What should you consider when using an I/O pin for multiple LED's?
- Es spielt keine Rolle, welche Seite mit dem Mikrocontroller-Pin verbunden wird.
- Ausgang kann auf logisch low oder high gsetzt werden
- Beachte aber, dass der MC nicht als Stromquelle dienen muss
Can you provide a few reasons why to use Processor Expert?
- Schnelles Anwendungstool
- Erspart low level Implementierungen ->Zeitersparnis z.B.using a I2C component, rather than implementing one yourself
Name at least three components you can add with Processor Expert.
- BitIO
- LED
- Wait
- Shell
- FreeRTOS
- Interrupt
What are the advantages and disadvantages of linked folders in Eclipse?
- Vorteile: Code nur einmal Schreiben (alles in einem freigegebenen / verknüpften Ordner)
- Nachteile: Der IDE bzw. Eclipse muss mitgeteilt werden, wo sich der Ordner befindet
Can you think of a different solution to share code / system blocks?
- Library (static)
- Duplicate (Copy)
Which different kind of Embedded Systems do we know? Can you provide typical examples?
- Transforming System (Radio -> mp3 Daten abspielen)
- Reactive System (Airbag, ESP beim Auto)
- Interactive System (Taschenrechner, Ticketautomat)
What requirements does a Realtime System has to fulfill?
- Das richtige Resultat,
- zur richtigen Zeit,
- unabhängig von der Systemlast und
- in einer deterministischen und vorhersehbaren Weise.
Which problems does a good VCS solve?
- Ermöglicht mehreren Benutzern gleichzeitig an demselben Projekt zu arbeiten
- Verfolgt die Projekthistorie und ältere Versionen
- Behandelt Synchronisation und Backup.
What are three important rules using a VCS?
- Schreibe verständliche "commit" Messages
- Commite öfters mal --> kleine Schritte machen
- Löse Konflikte mit Bedacht
What is the purpose of the .gitignore file?
- In diesem File kann festgelegt werden, welche Dateien/Verzeichnisse mit Git nicht geteilt werden sollen.
Explain what the remote repository, the local repository and the working directory are and how they relate.
- Remote Repository: Actual project on the server
- Local Repository: Local copy of the server.
- Working Directory: Where you actually work on and change things.