Memory Mapped IO used for GPIO Lecture Notes

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/49

flashcard set

Earn XP

Description and Tags

Practice flashcards covering Memory Mapped I/O, peripheral access (GPIO), specific microcontroller memory maps (RP2040, STM32U545), and the Rust embedded implementation stack.

Last updated 6:06 PM on 6/10/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

50 Terms

1
New cards

What does the acronym MMIO stand for?

Memory Mapped Input Output

2
New cards

According to the transcript, which component asks for a data transfer on the bus?

The Memory Controller

3
New cards

In the RP2040 example, what is the address space size and the base address for the SIO Registers?

The address space is 4GB4GB and the SIO Registers base address is 0xd000_00000xd000\_0000

4
New cards

For the STM32U545RE example, what is the base address for GPIO?

0x4202_00000x4202\_0000

5
New cards

What is the address range for the Private Peripheral Bus (PPB) in the Cortex-M33 memory layout?

0xE00000000xE0000000 to 0xE00FFFFF0xE00FFFFF

6
New cards

What is the specific address for the SysTick Timer in the Cortex-M33 layout?

0xE000E0100xE000E010

7
New cards

What are the two common examples of System Control Registers and their actual addresses?

SYST_CSR at 0xe000_e0100xe000\_e010 and CPUID at 0xe000_ed000xe000\_ed00

8
New cards

Why might writing several values to the same memory address via a compiler result in only the last value being stored?

Compilers optimize code and do not know that a memory address represents a peripheral register like UART_TX

9
New cards

Which Rust functions should be used to avoid compiler optimization when reading from or writing to registers?

read_volatile and write_volatile

10
New cards

What is the difference between write-through and write-back cache?

In write-through, data is written to the cache and main memory simultaneously; in write-back, data is written to the cache and later to main memory

11
New cards

In chips that use cache, how is the Memory Mapped I/O region typically handled to ensure correct peripheral operation?

The MMIO region is set as nocache, or the cache must be flushed before a volatile_read and after a volatile_write

12
New cards

What is the register offset for the CPUID Register?

0xed000xed00

13
New cards

In the CPUID register bit manipulation example, how many bits are shifted and masked to retrieve the variant?

Shift right 2020 bits and keep only the last 44 bits (0b11110b1111)

14
New cards

What does the acronym AIRCR stand for?

Application Interrupt and Reset Control Register

15
New cards

What is the bit position (POS) for VECTKEY and SYSRESETREQ in the AIRCR register according to the transcript code?

VECTKEY_POS is 1616 and SYSRESETREQ_POS is 22

16
New cards

What is the VECTKEY value required to write to the AIRCR register fields?

0x05fa0x05fa

17
New cards

What does an SVD XML file describe?

System View Description, which defines names, base addresses, registers, offsets, and field bit ranges for a device

18
New cards

What are the three peripherals involved in connecting RP2040 GPIO pins to the processor?

PAD, IO Bank (GPIO), and SIO

19
New cards

What is the function of the SIO peripheral on the RP2040 regarding GPIO?

Single Cycle Input/Output, able to set the pin as Input or Output and control common pin values

20
New cards

What is the function of the IO Bank (GPIO) peripheral on the RP2040?

It multiplexes the functions of the GPIO pins using the MUX function (F5 for SIO)

21
New cards

Which SIO register is used to read the input value of GPIO pins on the RP2040?

GPIO_IN

22
New cards

What is the address for GPIO_OE on the RP2040 SIO?

0xd000_00200xd000\_0020

23
New cards

Which SIO register on the RP2040 is used to set the Output Enable bit for a specific pin to 0 (input)?

GPIO_OE_CLR (0xd000_00280xd000\_0028)

24
New cards

What are the addresses for GPIO_OUT_SET and GPIO_OUT_CLR on the RP2040?

GPIO_OUT_SET is 0xd000_00140xd000\_0014 and GPIO_OUT_CLR is 0xd000_00180xd000\_0018

25
New cards

What is the base address for IO_BANK0_BASE in the RP2040 SDK?

0x400140000x40014000

26
New cards

In the RP2040 GPIOx_CTRL register, what does setting FUNCSEL to 5 accomplish?

It selects the SIO function for that GPIO pin

27
New cards

What logic functions are available in the IO Bank GPIOx_CTRL register via IRQOVER, INOVER, OEOVER, and OUTOVER?

Inversion and Override logic (e.g., don't invert, invert, drive low, drive high)

28
New cards

According to the RP2040 IO Bank input procedure, what register must be adjusted to set pull up/down resistors?

The Pad Control GPIOx Register

29
New cards

How are GPIO pins organized in the STM32U545?

They are split into smaller groups of up to 1616 pins called Ports (e.g., A to J)

30
New cards

In the STM32U545, what register is used to enable the clock signal for an I/O Port?

The RCC AHB2 peripheral clock enable register 1

31
New cards

What is the bit value in GPIOx_MODER required to set a pin to General Purpose Output mode on the STM32U545?

0b010b01

32
New cards

What is the base address of the RCC for the STM32U545RE?

0x4602_0C000x4602\_0C00

33
New cards

What is the address offset for the GPIOx_IDR (Input Data Register) in the STM32U545?

0x100x10

34
New cards

What are the four layers of the Rust Embedded Stack described in the lecture?

Framework (Tasks/Network), BSC (Board Support Crate), HAL Implementation, and PAC (Platform Access Crate)

35
New cards

What is the role of the Platform Access Crate (PAC) in the Rust Embedded Stack?

It accesses registers and is usually created automatically from SVD files

36
New cards

What are the two required methods for the InputPin trait in the Rust Embedded HAL?

fn is_high and fn is_low

37
New cards

Which enum is used to represent the state of an output pin in the Rust Embedded HAL?

PinState { Low, High }

38
New cards

What are the two primary rules for a Rust bare metal main function?

  1. Never exit the main function; 2. Add a panic handler that does not exit
39
New cards

In a bare metal Rust application, what is provided by the #[entry] attribute?

It defines the entry point of the application (the main function)

40
New cards

In the bare metal RP2 application example, what is the address for GPIO_OUT_SET used to drive a pin high?

0xd000_00140xd000\_0014

41
New cards

For the STM32U545RE bare metal example, how is the GPIOx_BASE_ADDR calculated?

0x4202_0000+0x400×PORT_x0x4202\_0000 + 0x400 \times PORT\_x

42
New cards

What framework is described as 'Embedded Asynchronous' and uses the rust-embedded-hal?

embassy-rs

43
New cards

Name four features of the embassy-rs framework mentioned in the transcript.

Real-time, Low power, Networking (Bluetooth/USB), and Bootloader/DFU

44
New cards

In embassy-rs for STM32, how is an input pin initialized?

Input::new(p.PC13, Pull::Down)

45
New cards

In embassy-rs for STM32, what three parameters are passed to Output::new?

The pin (e.g., p.PA5), the initial Level, and the Speed

46
New cards

What is the main function signature when using the embassy-rs framework?

[embassy_executor::main] async fn main(_spawner: Spawner)

47
New cards

In the Tock-registers example, what structure is generated to represent peripheral registers?

A C-style register_struct (e.g., SysCtrl)

48
New cards

What is the reset value of the CPUID register for the RP2040 according to the SVD example?

0x410cc6010x410cc601

49
New cards

In the STM32U545, what MODER bit setting corresponds to configuring a pin as an input?

0b000b00

50
New cards

What is the base address for SRAM in the Cortex-M33 memory layout?

0x200000000x20000000