unexpected reset after changing the GPIO mode on Fly.
Dear experts,
my STM32F042G6 is unexpectedly reset after I switched on fly CAN_TX GPIO to output GPIO pin.
for this I did this steps.
1).HAL_CAN_STOP() and then
2). GPIOA->MODER &= ~((U32) "pinX");
GPIOA->MODER|= ~(U32) "pinX");
I have also made the following steps.
1) . HAL_CAN_DeInit(hcan)
2) . HAL_GPIO_Init(x_GPIO_Port, &GPIO_InitStruct);
the result is the same.
I have looked at the reset register (RCC->CSR). I can't find any difference to normal power on .
after Reading (RCC->CSR) i become this Value : 0x0c80 0000
that mean :
1) Bit 27 PORRSTF: POR/PDR reset flag
2) Bit 26 PINRSTF: PIN reset flag
3) Bit 23 V18PWRRSTF: Reset flag of the 1.8 V domain.
also set a little breakpoint before changing GPIO mode and go through the lines Step over then there will be no reset.
but if I am in debug mode without breakpoint but through GPIO change debugging tool breaks.
maybe somebody has an idea why this reset happens or how I can find out what he is causing the reset.
thank you
