First of all, thanks for sharing this. Really helpful
I ported your code to the Windows version of STM32IDE, and I noticed that every time I pushed the Black Pill KEY button, the code would hang in the following section of startup_stm32f411ceux.s
.section .text.Default_Handler,"ax",%progbits
Default_Handler:
Infinite_Loop:
b Infinite_Loop
.size Default_Handler, .-Default_Handler
I fixed the problem by making two changes in stm32f4xx_it.c
It looks like at some point, you changed the interrupt you used and the pin to trigger it, so the code was jumping to a non-existent IRQ service routine and trapped in the infinite loop handler
I would also suggest adding the following to the hardware connections, to explain how to generate the debug print in the USART2 output
A2 TX Serial debug
A3 RX
GND GND
--------------------------------------------------------------------
To trigger debug printout (if enabled with DEBUG_FEEDBACK_ENDPOINT). press the KEY button on the Black Pill
[Not sure if it repros also with the STM32F401 project, I only compiled for STM32F411, but I think the same would happen for the STM32F401, too]
First of all, thanks for sharing this. Really helpful
I ported your code to the Windows version of STM32IDE, and I noticed that every time I pushed the Black Pill KEY button, the code would hang in the following section of startup_stm32f411ceux.s
I fixed the problem by making two changes in stm32f4xx_it.c
from
to
It looks like at some point, you changed the interrupt you used and the pin to trigger it, so the code was jumping to a non-existent IRQ service routine and trapped in the infinite loop handler
I would also suggest adding the following to the hardware connections, to explain how to generate the debug print in the USART2 output
[Not sure if it repros also with the STM32F401 project, I only compiled for STM32F411, but I think the same would happen for the STM32F401, too]