Interrupts, RTT host and Buttons
We’ve just leveled up our STM32F405 emulation! 🚀 Now featuring full NVIC and EXTI line support, button switch handling, and RTT host integration for a truly immersive embedded development experience. With that, applications the requires interrupts should be ready to be build.
RTT Host
RTT (Real-Time Transfer) is a protocol that lets the host read messages directly from a specific memory region, bypassing the MCU’s CPU, enabling fast and efficient logging.
Simulator86 now includes a RTT host that listens and prints output from a RTT target. By locating the _SEGGER_RTT symbol in the emulated firmware.
If you’re using Rust, which honestly you probably should. You can leverage the rtt-target crate to send debug output via RTT instead of UART.
NVIC and EXTI
NVIC (Nested Vectored Interrupt Controller) which is a peripheral in the Cortex-M that manages and prioritize interrupts. Whenever the NVIC recieves an interrupt signal, it determines it’s priority and whether the new interrupt has a higher priority than the currently executing one. If so, it pauses the current one so it executes the new one.
EXTI (External Interrupt Controller) is one of the sources that the NVIC recieves an interrupt signal from. EXTI. For example, it could be configured so that it sends an interrupt to the NVIC on falling edge of a specific GPIO.
Both NVIC and EXTI are now fully emualted for the STM32F405.
Button Switch
We also added a Button Switch which is a mechanical switch with 4 pins (L1, L2, R1, R2) having pins L1 and R1 always connected and L2 is always connected to R2.
When button is clicked, it closes the circuit between the two pairs, connecting all of the pins together.
Demo
Here is a little demo that generates an interrupt using port 1 of GPIOC when the button switch is clicked.