micro:bit Architecture Flashcards

1
Q

What 4 components create an executable file?

A

The preprocessor, compiler, assembler and linker

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the compiler do?

A

It transforms C commands into assembly code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the assembler do?

A

Translates assembly code to machine code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the collective name for the preprocessor, compiler, and assembler?

A

The compiler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does the linker do?

A

Combine several object files together that are dependent on one another due to calling function from other files, libraries, header files etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the sections of an object file?

A

Text section = machine code
Data section = global constants
Relocation information = information about what to modify when linking

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What happens when the address of a function in unknown?

A

A placeholder is inserted until the location is known

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

When are placeholders resolved?

A

During generation of an executable file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the linker do?

A

It resolves unknown addresses by using the relocation information stored in the main program and the symbol table which is stored in the not main program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe the linking process

A
  1. Object files include references to each other’s code and/or data
  2. The linker uses relocation records to fill in all addresses
  3. The linker combines information from the symbol table and relocation records
  4. Assembling to machine code remove all labels form the code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Describe static linking of libraries

A

The library and program are linking by the linker at runtime meaning that the binding between the program and the library is fixed, this also means that if the library is changed you will need to re-link it. Takes up more disk space

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Describe dynamic linking of libraries

A

The program and library it references are not combined in the linker. The linker simply places information into the executable and tells the loader the location of shared objects where required code can be found and the references are found during runtime. Two programs can share libraries in memory and you don’t need to re-assemble the whole program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Define microcontroller

A

A compact integrated circuit equipped with one or more central processing units and memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Define embedded system

A

An electronic product that compromises a microcontroller or multiple microcontrollers executing software instructions stored on a memory module to perform an essential function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Micro USB

A

Streams data to a from the micro:bit and provides power

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

JST connector

A

Provides power when connected to a 3V battery (2 x 1.5V batteries)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

ARM Cortex-M4F Processor

A

Interface that handles USB connection, used for flashing code and data to/from connected devices

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

ARM Cortex-M4 32-bit processor

A

Contains memory, radio capabilities, and has an integrated temperature sensor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

BLE antenna

A

Used for Bluetooth and radio

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Difference between Bluetooth and Radio capabilities in a micro:bit

A

Bluetooth allows the micro:bit to talk with central devices only whereas radio allows micro:bit devices to talk to each other so the peripheral can talk to devices other than central devices

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Motion sensor

A

Accelerometer and magnetometer, contains the footprint for two sensors (LSM & FXOS) but only one is placed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Edge connector

A

20 pins/strips and 5 rings for connection with external components using crocodile clips or banana plugs

23
Q

Regulator

A

Steps down to 3.3V

24
Q

Xtal (Crystal)

A

Electronic crystal oscillator that provides the clock signal

25
Q

SWD bus

A

Serial wire debug for programming the target MCU

26
Q

UART bus

A

Universal asynchronous receiver-transmitter for exchanging data with the device connected to the USB

27
Q

I^2C

A

Integer-integrated circuit bus that allows the main component (target MCU) to communicate with secondary components

28
Q

Define DAPLink

A

An open-source interface firmware that creates a bridge between the PC and SWD

29
Q

Why does the micro:bit not require a device driver?

A

It presents itself to the device as a USB disk

30
Q

What happens when you drop code onto the micro:bit when the DAPLink is an interface mode?

A

The code is written into the target MCU flash memory

31
Q

What is DAPLink bootloader mode?

A

Used to update the version of the DAPLink and the code is written to the interface MCU flash and updates the version of the DAPLink

32
Q

Describe the divide and conquer method for debugging

A

Removing and adding code to monitor when your program works and when it breaks to indicate where the bug is

33
Q

Describe logging method of debugging

A

Inserting printf to determine the state of your program in different locations to find the bug

34
Q

What are the disadvantages of logging as a debugging method?

A
  1. Not efficient
  2. Requires a lot of memory
  3. Can cause a heisenbug
35
Q

What is a heinsenbug?

A

A bug that occurs when you remove a printf statement and and error occurs

36
Q

Why does a heisenbug happen?

A

Removing a printf statement causes memory allocation to change and the stack will be affected triggering bus errors

37
Q

Define big endian

A

The MSB is stored first

38
Q

Define little endian

A

The LSB is stored first

39
Q

What class do you use to perform debugging by logging for a micro:bit?

A

The serial class

40
Q

What does the flag -g do?

A

Tells the compiler to generate and embed debug symbols which include names of functions, file names, and line numbers of errors

41
Q

What does the Stack pointer point to?

A

The lowest address of the stack for the current frame which will be the top of the stack

42
Q

What does the base/frame pointer point to?

A

A reference address of the previous frame

43
Q

What does the instruction pointer point to?

A

The address that the function will return to

44
Q

What does stack memory contain?

A

Stack frames that include data needed by function calls including argument and local variables

45
Q

What does heap memory contain?

A

Data used for variables within the program that have a dynamic size

46
Q

What is the Block Starting Symbol (BSS) section of memory used for?

A

Global variables that are initialised to 0 or do not have explicit initialisation

47
Q

What is the DATA section of memory used for?

A

Global variables that have been intitialised

48
Q

What does the TEXT section of memory contain?

A

The binary executable instructions of a program

49
Q

What are the pointers contained within a stack frame?

A

Stack pointer, frame/based pointer, saved instruction pointer

50
Q

What does the OS Kernel memory contain?

A

Memory reserved by the OS to monitor and control mapping between virtual and physical addresses

51
Q

What is the translation lookaside buffer?

A

A specialised cache that contains recent virtual-to-physical address translations so that the CPU can quickly retrieve them without having to refer to the table again

52
Q

What is the difference between RAM and DAM?

A

Accessing memory addresses in DAM it takes longer because it linearly searches through each memory address to find one

53
Q

Which component handles virtual-to-physical address translation?

A

The Memory Management Unit