micro:bit Architecture Flashcards

(77 cards)

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

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

Regulator

A

Steps down to 3.3V

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

Xtal (Crystal)

A

Electronic crystal oscillator that provides the clock signal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
SWD bus
Serial wire debug for programming the target MCU
26
UART bus
Universal asynchronous receiver-transmitter for exchanging data with the device connected to the USB
27
I^2C
Integer-integrated circuit bus that allows the main component (target MCU) to communicate with secondary components
28
Define DAPLink
An open-source interface firmware that creates a bridge between the PC and SWD
29
Why does the micro:bit not require a device driver?
It presents itself to the device as a USB disk
30
What happens when you drop code onto the micro:bit when the DAPLink is an interface mode?
The code is written into the target MCU flash memory
31
What is DAPLink bootloader mode?
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
Describe the divide and conquer method for debugging
Removing and adding code to monitor when your program works and when it breaks to indicate where the bug is
33
Describe logging method of debugging
Inserting printf to determine the state of your program in different locations to find the bug
34
What are the disadvantages of logging as a debugging method?
1. Not efficient 2. Requires a lot of memory 3. Can cause a heisenbug
35
What is a heinsenbug?
A bug that occurs when you remove a printf statement and and error occurs
36
Why does a heisenbug happen?
Removing a printf statement causes memory allocation to change and the stack will be affected triggering bus errors
37
Define big endian
The MSB is stored in the lowest memory address
38
Define little endian
The LSB is stored first in the lowest memory address
39
What class do you use to perform debugging by logging for a micro:bit?
The serial class
40
What does the flag -g do?
Tells the compiler to generate and embed debug symbols which include names of functions, file names, and line numbers of errors
41
What does the Stack pointer point to?
The lowest address of the stack for the current frame which will be the top of the stack
42
What does the base/frame pointer point to?
A reference address of the previous frame
43
What does the saved instruction pointer point to?
The address that the function will return to
44
What does stack memory contain?
Stack frames that include data needed by function calls including argument and local variables
45
What does heap memory contain?
Data used for variables within the program that have a dynamic size
46
What is the Block Starting Symbol (BSS) section of memory used for?
Global variables that are initialised to 0 or do not have explicit initialisation
47
What is the DATA section of memory used for?
Global variables that have been intitialised
48
What does the TEXT section of memory contain?
The binary executable instructions of a program
49
What are the pointers contained within a stack frame?
Stack pointer, frame/based pointer, saved instruction pointer
50
What does the OS Kernel memory contain?
Memory reserved by the OS to monitor and control mapping between virtual and physical addresses
51
What is the translation lookaside buffer?
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
What is the difference between RAM and DAM?
Accessing memory addresses in DAM it takes longer because it linearly searches through each memory address to find one
53
Which component handles virtual-to-physical address translation?
The Memory Management Unit
54
What does CPP stand for?
C preprocessor
55
What is a macro?
A brief abbreviation for longer constructs
56
What is the time complexity of the compiler
It is greater than linear
57
What is the initial processing stage of the CPP?
1. Input file read to memory 2. Accepts line feed and carriage return as end of line marker 3. Continued lines are merged together (lines that end in backslashes) 4. All comments replaced with spaces
58
What is the tokenisation stage of the CPP?
The C file is split into preprocessing tokens: 1. Identifiers = any sequence of letters, digits, or underscores 2. Numbers 3. String literals = a string/character constant and header file names These streams of tokens are then passed into the compiler's parser
59
Why is tokenisation important?
It turns an unstructured string into a numerical data structure that consists of discrete elements which are manageable for the processor
60
What does the preprocessing language consist of?
Directives and macros
61
What is a directive?
A command to be executed
62
What does the preprocessor do to macros?
Replaces them with their definitions throughout the program
63
Define conditional compilation
Including or excluding code segments from compilation based on various conditions
64
What are the two types of macros?
Object like and function like
65
What do object like macros do?
Replace an identifier with a code segment
66
What do function like macros do?
Replaces one function call with another
67
Define stringification
The process of converting macro arguments into string constants
68
How do you undefine a macro?
#undef
69
What does undefining a macro do?
Undefines the macro and allows us to redefine it as something else
70
Two methods for debugging
Divide and conquer = removing and adding code to monitor where the error appears Logging = inserting printf to determine the state of your program in different locations to find the bug
71
What is a datagram?
A packet that can be up to 32 bytes long
72
What are the three types of datagrams?
1. Array of bytes 2. Sequence of characters 3. Packet buffer
73
What are managed types?
Types that automatically reserve and release memory
74
Give two managed types that can be sent as datagrams
ManagedString and PacketBuffer
75
What is a ManagedString?
An immutable type that stores strings which can be compared and joined to other strings
76
How does the MMU translate physical addresses to virtual addresses and vice versa?
It uses the translation lookaside buffer which is memory allocated to storing the translation table
77
What is the difference between micro:bit memory allocation with and without Bluetooth enabled?
Memory is reduced when Bluetooth is enabled because space is needed for UICR