Share one AVR handler between vectors with ISR_ALIASOF
Point a second AVR interrupt vector at an existing handler with ISR_ALIASOF from avr-libc 2.2, so both vectors share one function body.
Short posts that solve one thing: the code, the output we got, and why it works.
Point a second AVR interrupt vector at an existing handler with ISR_ALIASOF from avr-libc 2.2, so both vectors share one function body.
Make printf with %f print numbers under newlib-nano on Arm GNU Toolchain 13 by forcing the float formatter into the link with -Wl,-u,_printf_float.
HAL_DMA_Abort stops an STM32 DMA stream in a blocking call that polls for 5 ms, returns HAL_OK, and does not run the abort callback.
Log numbers and strings from firmware over SEGGER RTT with SEGGER_RTT_printf, which takes %d, %u, %x, %s and %c but no floating-point formats.
Configure STM32F4 SPI1 as a mode 0 master by setting MSTR, SSM and SSI in SPI_CR1 with a divide-by-16 baud rate, then enable it with SPE.
Start OpenOCD 0.12 with an adapter script and a target script, as -f interface/stlink.cfg -f target/stm32f4x.cfg, and read what its startup log tells you.
Set USART2 to 115200 baud on an STM32F411 by writing 417 into BRR from a 48 MHz APB1 clock, then enable TE, RE and UE in CR1.
Set MODER bits 11:10 to 01 and leave OTYPER at 0 to make PA5 a push-pull output on an STM32F4, using a read-modify-write that keeps other pins intact.
Read the main stack pointer into r0 with mrs r0, msp on Cortex-M, privileged code only, for fault handlers that need to inspect the stacked frame.
Set HSEON in RCC->CR and poll HSERDY with a timeout on STM32F4 before using the crystal, so a missing or dead oscillator fails visibly instead of hanging.
Build the Cortex-M vector table as a const array of function pointers in C, placed in its own section, with the stack top in slot 0 and Reset in slot 1.
Turn on printf output on a Pico with stdio_init_all, choosing USB or UART in CMake, and wait for the USB host before printing. Pico SDK 2.1.0.
We send one email when a new post is published. No spam.