Embedded Systems Interview Questions

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

TCP vs UDP

(Transmission Control Protocol) Reliablity - TCP is all about reliability - Packets are tracked to prevent any data loss or corruption while in transit. - Orders packets by numbering them - Error checking by having percipient send message back "I received the message all good" - If sender doesn't get correct response it then resends the packets (User Datagram Protocol) Speed and low latency - UDP removes the latency of TCP back-and-forth comms - Just sends out packets, if some are lost/missed by receiver then no big deal - Lossy (Good for video feeds)

Explain what is a semaphore?

A semaphore is an abstract datatype or variable that is used for controlling access by multiple process to a common resouce in a concurrent systems such as multi-progaming operating system. They are generally used for two purposes: 1. To share a common memory space 2. To share access to files

Explain what a Watchdog timer is?

A timer which runs independently of the cpu that can be used to trigger an interrupt or reset the MCU. Use it to 1. Perform a task at a regular interval. 2. Wake up from sleep at a timed interval. 3. Reset the MCU if it is stuck in a bad state. A watchdog timer is an electronic or software timer that is used to detect and recover from a comptuer's malfunctions. During normal operation the microcontroler would regularyy restart the watchdog timer to prevent it from elapsings. When this happens a timeout signal will be generated which then initates corrective actions. E.g. compute reboot

Explain what is an embedded system in a computer system is?

An embedded system is a computer system that is part of a larger system or machine. It is a system with a dedicated function within a larger electrical or mechanical system.

List out some of the commonly found errors in Embedded Systems?

Damage of memory devices static discharges and transient current Address line malfunctioning due to a short in circuit Data lines malfunctioning Due to garbage or errors some memory locations being inaccessible in storage Inappropriate insertion of memory devices into the memory slots Wrong control signals

What does DMA address deals with?

Direct Memory Access is a feature of computer systems that allows certain hardware subsystems to access main system memory (random-access memory) independent of the central processing unit (CPU).

What is EEPROM?

Electrically erasable programmable read-only memroy and the big thing is that its non-volatile meaning it'll retain it's information w/o power

FET debugger

Flaash Emulation Tool made by TI. You can do real-time programming via a JTAG

Flashing Firmware vs Installing Firmware vs Rooting

Flashing: Writing data to nonvolatile flash memory. Typically used when writing to ROM, Installing: Writing data/software to nonvolatile memory that is typically called upon by the bootloader in the power up process. Rooting: Gaining permanent access to the privileged account (root on Unix-based systems). Rooting might be achieved by flashing modified firmware.

What is an ISR (interrupt service routine)?

Function that's called when an interrupt occurs

What is the GFP flag in linux?

GFP = Get Free Pages

GPOS

General Purpose Operating System needs to 1. Task Schedule 2. Resouce Management and 3. Device Drivers MacOS, Windows, etc Can missing some timing Scheulde ris non-detmistisc

Mention what are the essential components of an embedded system?

Hardware, Processor, Memory, Timers, I/O circuits, systems application specific circuits, software, RTOS if multi-threading is required to run process scheduling and do the switching from one process to another

Heap vs Stack

Heap: Can be fragmented memory used by the program to store global variables and its supports dynamic memory allocation. Stack: Linear memory which stores temporary variables created by a function. Variables are declared, stored, and initialized during run time. It will contains things such as methods, local variables, and reference

ISP vs IAP - Bootloader

In-System Programming: Device can be programmed in the circuit by using an utility such as the ULINK USB-JTAG Adapter In-Application Programming: The application itself can re-program the on-chip FLASH ROM. The bootloader is useful since you can program the microcontroller by any interface, you decide the pgramming method and the bootloader The only advantage of bootloader is you don't need complicated hardware to upgrade the program on the chip.But to use that feature you still need to use a serial/usb or parallel port programmer. So to use bootloader you still need a conventional programmer to load the initial program to the chip.

Explain what is interrupt latency and how can you reduce?

Interrupt latency is a time taken to return from the interrupt service routine post handling a specific interrupt. By writing minor ISR routines, interrupt latency can be reduced.

What is context switching?

Involves storing the context or state of a process so that it can be reloaded when required and execution can be resumed from the same point as earlier.

What is a bootloader?

It is a program that starts whenever a device is powered on to activate the right operating system. Bootloader from bootstrap loader from boot manager . likened to the support of a bootsrap when putting a boot on

What is kmalloc

It is the normal method of allocating memory for objects smaller than a page size in the linux kernel

What is a thread?

It is the smallest sequence of programmed instructions that can be managed independently by a scheduler (OS). It consists of a program counter, registers, call stack and thread-local storage. Threads share memory. Each thread is either new, runnable, blocked, waiting, or terminated.

What is a page? or paging

It's a fixed-length of contiguous block of virtual memory. Same sized blocks of memory called pages it's virtual memory. Stored on a secondary storage (e.g. hard drive)

What is a Kernal?

It's the part of the operation system that is always persent in memory and handles the interaction between software and hardware CPU MEMory -> kernal -> applications Device

What is a Mutex

Locking based mechanism. It is an object. It allows multiple program threads to access a single resource but with a restriction of not accessing it simultaneously. Locked or unlocked. If nothing is available then wait until the lock is released. Mutex allows many program threads to access a resource, but, not at the same point in time. https://www.youtube.com/watch?v=8wcuLCvMmF8 Mutual exclusion (often abbreviated to mutex) algorithms are used in concurrent programming to avoid the simultaneous use of a common resource, such as a global variable, by pieces of computer code called critical sections.

What does the volatile keyword mean?

Mean that the variable can be changed anytime without any task given by the source code Use when changing a variable inside an ISR

Mention what is the difference between microprocessor and microcontroller?

Microprocessor is managers of the resources (I/O, memory) which lie outside of its architecture Microcontroller have I/O, memory, etc. built into it and specifically designed for control

What is JTAG?

Programming / Debugging / Boundary Scan (Joint Test Action Group) An industry standard Software Debugging / Emulating, In-System Programmign, Boundary-Scans, Structural Board Testing, etc... Programming a MCU, FPGA, and debugging TAP (Test Access Port) JTAG can talks to the lfash congtroller and debug controller pinds (TDO, TDI, TCK, TMS) TDO Data Out TDI Serial Data In TCK Synchronous Clock TMS Control Line JTAG Programmer you can daisy chain jtag

Common communication protocols in embedded systems?

RS-232, TLL Serial, SPI, I2C, CAN, UART

RTEMS

RTOS for Mil/Space

What are some various uses of timers in an embedded system?

Real Time Clock (RTC), initiating an event after a preset time delay, initiating an event after a comparison of preset times, capturing the count value in timer on an event, find the time interval between two times, scheduling of various tasks in RTOS

RTOS

Real Time Operating System GPOS but the scheduler can guarantee meeting timing deadlines on the tasks. Need this for stuff that can't be missed E.g. system running the spark plugs in a car Can run multiple tasks concurrently Super Loop/No OS/ Bare-Metal: Setup -> Main loop When you need to do several things concurrently

Explain what are real-time embedded systems?

Real-time embedded systems are computer systems that monitor, respond or control an external environment. This environment is connected to the computer system through actuators, sensors, and other input-output interfaces.

Mention how I/O devices are classified for embedded systems?

Serial (Synchronous and Asynchronous) and Parallel (Single bit and multi bit) Serial: in out Synchronous AV AV Asynchronous keypad/mouse printer Parallel Single bit rotation pulses Multi bit Vp from ADC LCD

What is RS232

Serial data transmission

What is a Semaphore

Signaling mechanism (binary or integar). Multiple threads can access a finite instance of resources. uses signal and wait. If nothing is available wait until number increases https://www.youtube.com/watch?v=8wcuLCvMmF8 In computer science, a semaphore is a protected variable or abstract data type which constitutes the classic method for restricting access to shared resources such as shared memory in a parallel programming environment. A binary / counting semaphore is a counter for a set of available resources, rather than a locked/unlocked flag of a single resource.

Super Loop vs RTOS

Super Loop: Easy to implement/debug but you cannot run tasks concurrently RTOS: Guaranteed to meet timing dead lines, can run tasks concurrently, can prioritize tasks. Needs more resources (faster clock), more flash, and more RAM due to the overhead of a RTOS (scheduler) RTOS can usually only handle a single process but multiple tasks

Task vs Thread vs Process

Task: Set of program instructions loaded in memroy Thread: Unit of CPU utilization along with its own program counter and stack Process: instance of a computer progarm

Explain what is microcontroller?

The microcontroller is a self-contained system with peripherals, memory and a processor that can be used as embedded system.

What is UART?

Universal Asynchronous/ Receiver/ Transmitter Basically it's just a serial communication standard

Explain the difference between a mutex and a semaphore?

Used in software process synchronization Mutex [lock based approach] (Bathroom key ex) Semaphore [signaling based approach] (Train crossing signal: Shared resource of the rail crossing is in use and cars must wait) When many resources are available, (bunch of printers) semaphore is preferred. If there is only one shared resource in place, (bathroom key), Mutex is preferred. https://www.youtube.com/watch?v=8wcuLCvMmF8

Why are embedded systems so useful?

With embedded system, it is possible to replace dozens or even more of hardware logic gates, input buffers, timing circuits, output drivers, etc. with a relatively cheap microprocessor.

What is a boundary scan?

You can access the boundary scan via JTAG. It lets you read/write to each pin on a board/Microcontroller so that if your firmware isn't written yet that's okay and so you can check for shorts/opens.

SRAM

static random access memory and it is volatile. Typically used for CPU caches

Race conditions

x=x+10 two flows examples (x is shared memory) solution:locking It's possible to have a software system in which the output depends o nthe sequence of events. In the case the events do not occurs a fault happens ' Can take place when multiple process/threads operator on a shared data


Set pelajaran terkait

GOHS Level Gov - Final Exam Spring 22

View Set

ATI Real Life 3.0 RN Preeclampsia

View Set

Obesity and chronic disease (Epi Exam4)

View Set

Azure data Fundamentals: 1. Explore core data concepts

View Set

BUS 101 Chapter 1 Study Questions

View Set

Principles of Management (Multiple Choice)

View Set