Hello, I'm using STM32l152RCT6 and i have a debugging problem with GPIOx->MODER
In my program I have to change the mode of 2 pin very frequently, I have to get from Input mode (to have an "high impedance" state) to output mode (to use a PP) etc. These pins are PA6 and PA7.
And it's working, no problems to do that, I just use the GPIOA->MODER register and reassign the bits I need to.
But when I do that i have a problem : I can start debugging, charge the program through the board, but then I immediatly lose connexion with it. So I can't do any observation during debbuging (no "step by step", no variable visualisation...).
I have already found that this problem is here when I assign a bit on MODER register, when I don't do this I can debug easily.
I don't change the mode of PA13 and PA14, so the problem is not that I can't use the SWD process anymore (also if it was that, I would not be able to charge the program on the MCU).
Another thing that I don't understand is that depend on where I put this line on my program, it can work (I do a "calibration" cycle before my main loop, and this is when the problem appears)...
Also, if I try to do this on another PIN and use another register (like GPIOC->MODER for example), the problem remains the same...
Does anyone have an idea ? :)
Edit : here the messages I have in the console :
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target STM32L152RCTx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 6300ms
