FRI · Organizacija računalnikov

OR labs on the STM32H7

Every STM32 topic from the lab exercises, mapped to the guides, topic pages and the exact pages of the ST manuals. Each lab has the ideas you need, a reading list, and a short assembly example in the style of the course project.

Unofficial help, not course material. Your assistants’ instructions and the files on Učilnica always come first. The examples explain the ideas; they are not solutions to the graded tasks.

Labs 2026/27

The labs posted on Učilnica so far.

Lab 1

Introduction: the H7 board and an assembly review

You meet the STM32H750B-DK, build the course’s stm32h7-asm project in STM32CubeIDE and step through it with the debugger. The exercises revise the ARM assembly you know from the first year: registers, loads and stores, flags and loops.

What you need to understand

  • The core has 16 registers: r0-r12 for data, sp (stack pointer), lr (return address) and pc. Flags N, Z, C, V live in APSR.
  • ARM is a load/store architecture: only ldr and str touch memory, every calculation works on registers.
  • An s suffix (subs, adds) updates the flags, and a conditional branch (beq, bne, blt…) reads them. Without the s, a countdown loop never ends.
  • ldr r0, =label loads an address (or a big constant), ldr r0, [r1] loads the word at the address in r1.
  • The memory map: code runs from flash at 0x08000000, the course project keeps variables and the stack in AXI SRAM at 0x24000000, and peripherals are registers at fixed addresses (0x4000 0000 and up).
Assembly example

Paste into Main.s of stm32h7-asm. Assembled with the arm-none-eabi-as from STM32CubeIDE.

        .syntax unified
        .cpu cortex-m7
        .thumb

        .data
table:  .word 3, 7, -2, 10, 5      // five 32-bit numbers in RAM
sum:    .word 0

        .text
        .global main
        .type main, %function
main:
        ldr   r0, =table           // r0 = address of the first element
        mov   r1, #5               // r1 = elements left
        mov   r2, #0               // r2 = running sum
next:
        ldr   r3, [r0], #4         // r3 = word at r0, then r0 = r0 + 4
        add   r2, r2, r3
        subs  r1, r1, #1           // S: sets the Z flag when r1 reaches 0
        bne   next
        ldr   r0, =sum
        str   r2, [r0]             // sum = 23: check it in the Memory view
end:    b     end

Common mistakes

  • sub instead of subs in a loop counter: the flags never change and bne loops forever.
  • Mixing up ldr r0, =x (address of x) and ldr r0, [r0] (value at that address).
  • Values in .data are copied from flash to RAM by the startup code before main. Looking at them before main runs shows garbage.
Lab 2

Logical instructions, working with bits, shifts

Every peripheral is controlled by bits in its registers, so this lab is the base of all the I/O labs that follow: set, clear, toggle and test single bits, change a bit field without touching its neighbours, and shift values.

What you need to understand

  • orr sets bits, bic clears them, eor toggles them, tst tests them (only the flags change). The mask says which bits.
  • A mask is built with a shift: #(1 << 13) is bit 13, #(0b11 << 26) is the 2-bit field at bits 27:26.
  • Changing a field is read-modify-write: ldr, clear the field with bic, put the new value in with orr, str. Only orr would leave old ones in place.
  • bfi inserts and ubfx extracts a field in one instruction.
  • lsl multiplies by 2ⁿ, lsr divides unsigned numbers, asr divides signed numbers and keeps the sign. The second operand of most instructions can be shifted for free (add r0, r0, r0, lsl #2 = ×5).
Assembly example

Paste into Main.s of stm32h7-asm. Assembled with the arm-none-eabi-as from STM32CubeIDE.

        .syntax unified
        .cpu cortex-m7
        .thumb

        .text
bits:
        // single bits of r0
        orr   r0, r0, #(1 << 5)    // set bit 5
        bic   r0, r0, #(1 << 3)    // clear bit 3
        eor   r0, r0, #(1 << 0)    // toggle bit 0
        tst   r0, #(1 << 7)        // r0 AND bit 7, only the flags change
        ite   ne
        movne r8, #1               // bit 7 was 1
        moveq r8, #0               // bit 7 was 0

        // a 2-bit field, bits 27:26 of r1 (MODER13 of a GPIO port)
        bic   r1, r1, #(0b11 << 26) // clear the field first
        orr   r1, r1, #(0b01 << 26) // then write 01

        // the same with bit-field instructions
        mov   r2, #0b01
        bfi   r1, r2, #26, #2      // insert r2[1:0] into r1[27:26]
        ubfx  r3, r1, #26, #2      // extract r1[27:26] into r3

        // shifts
        lsl   r4, r0, #4           // r4 = r0 * 16
        lsr   r5, r0, #1           // unsigned divide by 2
        asr   r6, r0, #1           // signed divide by 2, keeps the sign bit
        add   r7, r0, r0, lsl #2   // r7 = r0 * 5, shift on the second operand
        bx    lr

Common mistakes

  • Writing a field with orr only: if it held 11 before, it still holds 11 after "writing" 01.
  • Not every constant fits in one instruction (e.g. #0x12345678). Use ldr r1, =0x12345678 for those.
  • lsr on a negative number gives a big positive one. For signed values use asr.
Lab 3

Subroutines and the stack

You split the program into subroutines, pass arguments in registers and use the stack to save what a subroutine must not lose: the return address and the registers it borrows.

What you need to understand

  • bl label jumps and stores the return address in lr. bx lr returns.
  • A subroutine that calls another one must save lr first, because the inner bl overwrites it. Usual pattern: push {r4, lr} at the start, pop {r4, pc} at the end (popping into pc returns).
  • The stack is full descending: push lowers sp by 4 per register, then stores. Every push needs a matching pop.
  • Calling convention (AAPCS): arguments in r0-r3, the result in r0. A subroutine may change r0-r3 and r12, but must restore r4-r11 if it uses them.
  • In the course project the stack starts at the top of AXI SRAM (_estack = 0x24080000 in the linker script) and grows down.
Assembly example

Paste into Main.s of stm32h7-asm. Assembled with the arm-none-eabi-as from STM32CubeIDE.

        .syntax unified
        .cpu cortex-m7
        .thumb

        .text
        .global main
        .type main, %function
main:
        mov   r0, #7               // arguments go in r0-r3
        mov   r1, #12
        mov   r2, #9
        bl    max3                 // BL: LR = return address, jump
        // r0 = 12 here: the result comes back in r0
end:    b     end

// max: r0 = the larger of r0 and r1 (signed).
// A leaf (it calls nothing), so LR stays intact and no stack is needed.
max:
        cmp   r0, r1
        it    lt
        movlt r0, r1
        bx    lr                   // return: jump to the address in LR

// max3: r0 = the largest of r0, r1, r2.
// It calls max, and every BL overwrites LR, so LR goes on the stack first.
max3:
        push  {r4, lr}             // save r4 (we use it) and the return address
        mov   r4, r2               // max may change r0-r3, but must keep r4-r11
        bl    max                  // r0 = max(r0, r1)
        mov   r1, r4
        bl    max                  // r0 = max(r0, r2)
        pop   {r4, pc}             // restore r4, and the saved LR goes straight into PC

Common mistakes

  • A nested bl without saving lr: the outer subroutine returns to itself and loops forever.
  • Unbalanced push/pop (an early return that skips the pop): the next pop {pc} jumps to a random address and you end in the HardFault handler.
  • Keeping a value in r0-r3 across a bl: the callee is allowed to change them.
Lab 4

GPIO: LEDs and the button

The first real I/O: switch on a GPIO port’s clock, make a pin an output for an LED and an input for the blue button, and read and write the pins through the port registers.

What you need to understand

  • Every port is off after reset: first set its bit in RCC_AHB4ENR (port A = bit 0 … C = 2 … I = 8, J = 9). A port without a clock ignores your writes.
  • Each port is a block of registers at its base address. The offsets are the same for every port: MODER 0x00, IDR 0x10, ODR 0x14, BSRR 0x18.
  • MODER has 2 bits per pin: 00 input, 01 output, 10 alternate function, 11 analog (the reset value for most pins).
  • The user LEDs LD6 (red, PI13) and LD7 (green, PJ2) are active-low: pin low = LED on. The blue button B1 (PC13) reads 1 while pressed.
  • BSRR changes single pins in one write: the low half sets pins high, the high half (bit n+16) drives them low.
Assembly example

Paste into Main.s of stm32h7-asm. Assembled with the arm-none-eabi-as from STM32CubeIDE.

        .syntax unified
        .cpu cortex-m7
        .thumb

        .equ  RCC_AHB4ENR, 0x580244E0  // GPIO clock enables, one bit per port
        .equ  GPIOC_BASE,  0x58020800
        .equ  GPIOI_BASE,  0x58022000
        .equ  MODER,       0x00        // offsets, the same for every port
        .equ  IDR,         0x10
        .equ  BSRR,        0x18

        .text
        .global main
        .type main, %function
main:
        // 1. clocks for port C (bit 2) and port I (bit 8)
        ldr   r0, =RCC_AHB4ENR
        ldr   r1, [r0]
        orr   r1, r1, #((1 << 2) | (1 << 8))
        str   r1, [r0]
        ldr   r1, [r0]                 // read back: the clock is on before we touch the ports

        // 2. PI13 (red LED LD6) as output: MODER13 = 01
        ldr   r0, =GPIOI_BASE
        ldr   r1, [r0, #MODER]
        bic   r1, r1, #(0b11 << 26)
        orr   r1, r1, #(0b01 << 26)
        str   r1, [r0, #MODER]

        // 3. PC13 (blue button B1) as input: MODER13 = 00
        ldr   r2, =GPIOC_BASE
        ldr   r1, [r2, #MODER]
        bic   r1, r1, #(0b11 << 26)
        str   r1, [r2, #MODER]

        // 4. copy the button to the LED, forever
loop:
        ldr   r1, [r2, #IDR]
        tst   r1, #(1 << 13)           // pressed = 1 (external pull-down on the board)
        ite   ne
        movne r3, #(1 << (13 + 16))    // pressed:  BR13, PI13 low  = LED on (active-low)
        moveq r3, #(1 << 13)           // released: BS13, PI13 high = LED off
        str   r3, [r0, #BSRR]
        b     loop

Common mistakes

  • Writing 1 to light an LED. LD6 and LD7 are active-low.
  • Forgetting the port clock: reads return 0 and writes vanish.
  • Using the bit number of the pin in MODER: pin n is bits 2n+1:2n (pin 13 = bits 27:26), not bit n.
Lab 5

Timers: SysTick and TIMx

Replace busy-wait loops with real time. SysTick is the 24-bit timer inside the Cortex-M7 core, described in the programming manual. The TIMx timers are STM32 peripherals in the reference manual: here the basic timer TIM6.

What you need to understand

  • After reset the CPU runs on HSI = 64 MHz, so 1 ms = 64 000 clock cycles. The course project keeps this clock.
  • SysTick counts down from RVR to 0 and reloads. A period of N clocks needs RVR = N - 1. COUNTFLAG (bit 16 of CSR) becomes 1 at every wrap and clears when you read CSR.
  • A TIMx timer counts up: the prescaler PSC divides the clock (f / (PSC + 1)), the counter runs from 0 to ARR, then an update event sets UIF in TIMx_SR.
  • PSC is buffered: it takes effect at the next update. Write EGR.UG = 1 to load it at once (this also sets UIF, so clear it).
  • TIM6 is on APB1: its clock enable is bit 4 of RCC_APB1LENR, not in the GPIO register.
Assembly example (SysTick (polling), TIM6 (polling))

Paste into Main.s of stm32h7-asm. Assembled with the arm-none-eabi-as from STM32CubeIDE.

        .syntax unified
        .cpu cortex-m7
        .thumb

        .equ  SYST_CSR, 0xE000E010     // control and status
        .equ  SYST_RVR, 0xE000E014     // reload value
        .equ  SYST_CVR, 0xE000E018     // current value

        .text
// init_systick: one wrap every 1 ms. After reset the CPU runs on HSI = 64 MHz,
// so 1 ms = 64 000 clocks and the reload value is 64 000 - 1.
init_systick:
        ldr   r0, =SYST_RVR
        ldr   r1, =63999
        str   r1, [r0]
        ldr   r0, =SYST_CVR
        mov   r1, #0
        str   r1, [r0]                 // any write clears the counter and COUNTFLAG
        ldr   r0, =SYST_CSR
        mov   r1, #0b101               // CLKSOURCE = 1 (CPU clock), ENABLE = 1
        str   r1, [r0]
        bx    lr

// delay_ms: waits r0 milliseconds (r0 > 0).
// COUNTFLAG (bit 16) becomes 1 each time the counter wraps; reading CSR clears it.
delay_ms:
        ldr   r1, =SYST_CSR
wait_tick:
        ldr   r2, [r1]
        tst   r2, #(1 << 16)
        beq   wait_tick
        subs  r0, r0, #1
        bne   wait_tick
        bx    lr

Common mistakes

  • RVR = 64000 instead of 63999: every millisecond is one clock too long.
  • Reading CSR somewhere else (e.g. in the debugger’s register view) clears COUNTFLAG, and your loop misses a tick.
  • Copying numbers from a C project: if it runs SystemClock_Config with the PLL (400 or 480 MHz), 1 ms is no longer 64 000 cycles.
  • Waiting for UIF without clearing it: after the first period the loop never waits again.

Next topics (from the 2025/26 archive)

Last year these labs followed GPIO and timers. The numbering may differ this year, the content mostly does not.

2025/26 · lab 9

Interrupts and the timer

Instead of polling a flag, let the hardware call your code. The SysTick example turns on TICKINT, and the core runs SysTick_Handler every millisecond while main does something else.

What you need to understand

  • The vector table at the start of the program holds one address per exception and interrupt. The startup file fills it with weak handlers. Defining a function with the same name (SysTick_Handler, EXTI15_10_IRQHandler, USART3_IRQHandler) replaces the default.
  • On entry the hardware saves r0-r3, r12, lr, pc and xPSR on the stack and puts a special EXC_RETURN value in lr. That is why a handler is an ordinary subroutine that ends with bx lr.
  • SysTick is a core exception: TICKINT alone enables it. A peripheral interrupt also needs its bit in the NVIC (NVIC_ISER) and the enable bit in the peripheral itself.
  • The IRQ number decides the NVIC bit: USART3 is 39, so bit 7 of NVIC_ISER1. The table is in the reference manual.
  • The button interrupt goes through EXTI: PC13 is line 13, selected in SYSCFG_EXTICR4, served by EXTI15_10_IRQHandler (IRQ 40). The button guide does it step by step in C.
  • Running from RAM (the course’s RAM linker script): the vector table is in RAM too, so VTOR must point to it, or no handler is ever called.
Assembly example

Paste into Main.s of stm32h7-asm. Assembled with the arm-none-eabi-as from STM32CubeIDE.

        .syntax unified
        .cpu cortex-m7
        .thumb

        .equ  SYST_CSR, 0xE000E010
        .equ  SYST_RVR, 0xE000E014
        .equ  SYST_CVR, 0xE000E018

        .data
ms_ticks: .word 0                      // incremented by the handler

        .text
// init_systick_irq: like the polling version, plus TICKINT = 1 (bit 1),
// so every wrap raises the SysTick exception.
init_systick_irq:
        ldr   r0, =SYST_RVR
        ldr   r1, =63999
        str   r1, [r0]
        ldr   r0, =SYST_CVR
        mov   r1, #0
        str   r1, [r0]
        ldr   r0, =SYST_CSR
        mov   r1, #0b111               // CLKSOURCE | TICKINT | ENABLE
        str   r1, [r0]
        bx    lr

// The name must match the vector table entry in the startup file, which
// only has a weak default: this strong definition replaces it.
        .global SysTick_Handler
        .type SysTick_Handler, %function
SysTick_Handler:
        ldr   r0, =ms_ticks            // r0-r3, r12, LR, PC, xPSR were already stacked
        ldr   r1, [r0]                 // by the hardware, so the handler may use r0-r3
        add   r1, r1, #1
        str   r1, [r0]
        bx    lr                       // LR = EXC_RETURN (0xFFFFFFF9): this returns from the exception

Common mistakes

  • A typo in the handler name (Systick_Handler): it assembles, but the weak default handler runs instead and loops forever.
  • Forgetting to clear the peripheral’s pending flag (e.g. EXTI_CPUPR1) in the handler: it fires again right after returning.
  • A handler that uses r4-r11 without push/pop: the main program’s values change under its feet.
2025/26 · lab 10

Serial port: USART3 and the virtual COM port

Send and receive characters to a terminal on your PC. The ST-LINK doubles as a USB serial adapter wired to USART3, so the same USB cable you flash with also carries text.

What you need to understand

  • The virtual COM port is USART3 on PB10 (TX) and PB11 (RX), 115200 baud, 8 data bits, no parity, 1 stop bit.
  • The pins must be in alternate function mode (MODER = 10) with AF7 selected in GPIOx_AFRH (pins 8-15, 4 bits each).
  • Clocks: port B in RCC_AHB4ENR (bit 1), USART3 in RCC_APB1LENR (bit 18).
  • Baud rate: BRR = f / baud = 64 000 000 / 115 200 ≈ 556 (with oversampling by 16, the reset setting).
  • Sending: wait for TXE (bit 7 of USART_ISR), write the byte to USART_TDR. Receiving: wait for RXNE (bit 5), read USART_RDR.
Assembly example

Paste into Main.s of stm32h7-asm. Assembled with the arm-none-eabi-as from STM32CubeIDE.

        .syntax unified
        .cpu cortex-m7
        .thumb

        .equ  RCC_AHB4ENR,  0x580244E0 // GPIOBEN = bit 1
        .equ  RCC_APB1LENR, 0x580244E8 // USART3EN = bit 18
        .equ  GPIOB_BASE,   0x58020400
        .equ  MODER,        0x00
        .equ  AFRH,         0x24       // AF numbers of pins 8..15, 4 bits each
        .equ  USART3_BASE,  0x40004800
        .equ  USART_CR1,    0x00
        .equ  USART_BRR,    0x0C
        .equ  USART_ISR,    0x1C
        .equ  USART_RDR,    0x24
        .equ  USART_TDR,    0x28

        .text
// init_usart3: 115200 baud 8N1 on PB10 (TX) and PB11 (RX), the ST-LINK virtual COM port.
init_usart3:
        ldr   r0, =RCC_AHB4ENR
        ldr   r1, [r0]
        orr   r1, r1, #(1 << 1)
        str   r1, [r0]
        ldr   r0, =RCC_APB1LENR
        ldr   r1, [r0]
        orr   r1, r1, #(1 << 18)
        str   r1, [r0]
        ldr   r1, [r0]                 // read back

        ldr   r0, =GPIOB_BASE
        ldr   r1, [r0, #MODER]         // PB10, PB11: MODER = 10 (alternate function)
        bic   r1, r1, #(0b1111 << 20)
        orr   r1, r1, #(0b1010 << 20)
        str   r1, [r0, #MODER]
        ldr   r1, [r0, #AFRH]          // AF7 = USART3 on both pins
        bic   r1, r1, #(0xFF << 8)
        orr   r1, r1, #(0x77 << 8)
        str   r1, [r0, #AFRH]

        ldr   r0, =USART3_BASE
        ldr   r1, =556                 // BRR = 64 000 000 / 115 200 = 555.6, rounded
        str   r1, [r0, #USART_BRR]
        mov   r1, #0b1101              // TE (bit 3), RE (bit 2), UE (bit 0)
        str   r1, [r0, #USART_CR1]
        bx    lr

// send_char: sends the byte in r0. Waits until TDR is free (TXE, ISR bit 7).
send_char:
        ldr   r1, =USART3_BASE
wait_txe:
        ldr   r2, [r1, #USART_ISR]
        tst   r2, #(1 << 7)
        beq   wait_txe
        strb  r0, [r1, #USART_TDR]
        bx    lr

// recv_char: waits for a byte (RXNE, ISR bit 5) and returns it in r0.
recv_char:
        ldr   r1, =USART3_BASE
wait_rxne:
        ldr   r2, [r1, #USART_ISR]
        tst   r2, #(1 << 5)
        beq   wait_rxne
        ldrb  r0, [r1, #USART_RDR]     // reading RDR clears RXNE
        bx    lr

Common mistakes

  • Pins left in output mode instead of AF: nothing reaches the PC.
  • AF7 written into AFRL: that register is for pins 0-7, PB10 and PB11 are in AFRH.
  • A BRR computed for another clock: garbage characters in the terminal usually mean the baud rate is off.
  • The terminal on the PC uses a different speed, or another program already holds the serial port.
2025/26 · lab 11

DMA with the serial port

Let the DMA controller copy a whole string to USART3 while the CPU does other work. On the H7 a request multiplexer (DMAMUX) sits between the peripheral and the DMA, so there is one more block to set up than on older STM32s.

What you need to understand

  • DMAMUX1 routes a peripheral request to a DMA stream. USART3 TX is request 46 (RX is 45). Writing 46 into DMAMUX1_C0CR connects it to DMA1 stream 0.
  • A stream needs: the peripheral address (DMA_SxPAR = address of USART3_TDR), the memory address (DMA_SxM0AR), the number of items (DMA_SxNDTR), and in DMA_SxCR the direction memory-to-peripheral, memory increment, then EN.
  • USART3 asks the DMA for data only when DMAT (bit 7 of USART_CR3) is set.
  • The end of the transfer shows as TCIF0 in DMA_LISR. Clear it in DMA_LIFCR before the next transfer, and disable the stream before changing its settings.
  • DMA1 and DMA2 cannot reach DTCM (0x20000000). The course project puts its data in AXI SRAM (0x24000000), which DMA1 can read.
  • DMA clock: DMA1EN is bit 0 of RCC_AHB1ENR (it also clocks DMAMUX1).

Common mistakes

  • Buffer in DTCM: the transfer error flag goes up and nothing is sent.
  • Changing DMA_SxCR while EN is still 1: the writes are ignored.
  • Not clearing the old TCIF flag: the second transfer looks finished before it starts.
  • In C projects with the data cache on: the DMA reads RAM, while your new string may still sit in the cache.
2025/26 · lab 12

MiniRTOS: switching between tasks

A tiny operating system in assembly: two tasks, each with its own stack, and the SysTick handler that switches between them every few milliseconds. It ties together the stack, interrupts and the core registers.

What you need to understand

  • A task is a function plus its own stack and saved registers. Switching tasks means saving one set of registers and loading another.
  • The core has two stack pointers: MSP for handlers and PSP for tasks. CONTROL.SPSEL picks which one thread code uses.
  • On an interrupt the hardware already stacks r0-r3, r12, lr, pc, xPSR on the task’s stack. The handler saves r4-r11 itself (stmdb/ldmia), swaps PSP, and returns.
  • The EXC_RETURN value 0xFFFFFFFD returns to thread mode using PSP; 0xFFFFFFF9 uses MSP.
  • Reading and writing PSP and CONTROL needs mrs and msr.

Common mistakes

  • A new task’s stack must already look like an exception frame (with the task’s start address as pc and xPSR = 0x01000000, the Thumb bit), or the first switch faults.
  • Each task’s stack must be big enough for its own calls plus one full frame.

Extra: in the lab repo

Extra

Counting clock cycles with DWT (lectures OR-4)

The lab repo’s DWT_Cycles_Measurements project measures how many cycles a loop really takes. It makes the lecture on instruction-level parallelism concrete: the dual-issue pipeline and branch prediction of the Cortex-M7 change the numbers more than instruction size does.

What you need to understand

  • The DWT unit has a free-running cycle counter, DWT_CYCCNT at 0xE0001004. Read it before and after the code you measure.
  • It must be switched on first: TRCENA in DEMCR, then CYCCNTENA in DWT_CTRL. On the Cortex-M7 the DWT also has to be unlocked by writing 0xC5ACCE55 to DWT_LAR.
  • Measure several times: the first run includes cache and branch-predictor warm-up.

Addresses you need in the labs

For .equ lines. Every row opens the page of the manual it comes from, so you can check it yourself.

RegisterAddressWhat for
RCC_AHB4ENR0x580244E0GPIO clocks: A = bit 0, B = 1, C = 2 … I = 8, J = 9RM0433 p.457
RCC_APB1LENR0x580244E8TIM2 = bit 0 … TIM6 = 4, TIM7 = 5, USART3 = 18RM0433 p.461
RCC_AHB1ENR0x580244D8DMA1 = bit 0, DMA2 = 1RM0433 p.453
GPIOB / GPIOC0x58020400 / 0x58020800USART3 pins / blue buttonRM0433 p.130
GPIOI / GPIOJ0x58022000 / 0x58022400Red LED PI13 / green LED PJ2RM0433 p.130
GPIO offsets+0x00 … +0x24MODER 00, OTYPER 04, OSPEEDR 08, PUPDR 0C, IDR 10, ODR 14, BSRR 18, AFRL 20, AFRH 24RM0433 p.546
SYST_CSR / RVR / CVR0xE000E010 / 14 / 18SysTick control, reload, current valuePM0253 p.212
TIM60x40001000CR1 00, SR 10, EGR 14, CNT 24, PSC 28, ARR 2CRM0433 p.1859
USART30x40004800CR1 00, CR3 08, BRR 0C, ISR 1C, RDR 24, TDR 28RM0433 p.2069
NVIC_ISER00xE000E100IRQ 0-31; ISER1 at +4 for IRQ 32-63 (USART3 = 39, EXTI15_10 = 40)PM0253 p.185
VTOR0xE000ED08Where the vector table is (0x24000000 when running from RAM)PM0253 p.197
DMA1 / DMAMUX10x40020000 / 0x40020800Stream 0 registers at DMA1 + 0x10, channel 0 at DMAMUX1 + 0x00RM0433 p.659
DWT_CYCCNT0xE0001004Clock-cycle counterRM0433 p.3227

Files from Učilnica, in the finder

The PDFs on Učilnica are chapters of the ST documents. Here they are searchable and linked to each other.

On UčilnicaWhat it isIn the finder
Spisek ukazov za STM32H7 (ARM Cortex M7-Thumb2 ISA) - Podroben spisekEvery instruction with its operands and flagsPM0253 Chapter 3 of the programming manual
STM32H7_rm0433_Ch11-General-purpose IOs (GPIO)The GPIO chapter of the reference manualRM0433 Chapter 11 of RM0433
STM32H7 PM chap4-4 SysTick CasovnikThe SysTick timerPM0253 Section 4.4 of the programming manual
STM32H750B-DK Discovery kit (stran proizvajalca)What is on the board and which pins it usesUM2488 Hardware chapter of the user manual UM2488
Shema plošče (MB1381)The board schematic: LEDs, button, connectorsMB1381 MCU sheet, every pin and its net
stm32h750xb datasheetPins, alternate functions, electrical limitsDS12556 Pinout and AF tables

Ideas for the 2nd homework

A low-level application on the board. Each idea lists the guides that cover its parts.

Morse code transmitter

Text from the serial port blinks as Morse code on an LED, timed by SysTick. Uses everything from labs 2 to 5 and the USART lab.

Reaction-time game

An LED lights after a random delay, you press the button, the time in ms goes to the terminal. Button interrupt plus a timer.

Dimmable LED or tone on a buzzer

PWM from a timer channel on an Arduino header pin, duty cycle or frequency set from the terminal.

Voltmeter on the terminal

Read a potentiometer on an Arduino analog pin with the ADC and print millivolts every 100 ms.

Something on the screen

Draw on the 4.3" display or react to touch. The lab repo’s BSP_ASM_Touch_Demo calls the C display functions from assembly.