Debug randomly causes "Signal Thread #1 (Suspended : Signal : SIGTRAP:Trace/breakpoint trap)"
I'm trying to write a piece of code using STM32 Cube IDE but when trying to debug i get the following error and i really cant get rid of it.
Thread #1 (Suspended : Signal : SIGTRAP:Trace/breakpoint trap)
0x1fffecec
<signal handler called>() at 0xfffffff1
0x42332600
<signal handler called>() at 0xfffffff9
HAL_GPIO_WritePin() at stm32f0xx_hal_gpio.c:416 0x8000dc6
main() at main.c:178 0x8000442
Tried on two different computers, trimmed the code to a few GPIO writes, disabled most pins/peripherals, changed Flash Wait States, nothing solves the issue yet.
I'm using a STM32F051K6T7 on custom board with a STLINK V2

