2014-01-31 08:50 AM
Hi all,
I wrote a small program for testing a STM32L152CBT6 Stop Mode via command PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI).The program switches to stop mode immediatelly after MCU starts and after 4 seconds the RTC clock IRQ wake up the MCU.This sequence runs in while(1) cycle and writes via SWO ITM_SendChar sentences ''going to stop...'' and ''wake up''.Everything works perfectly well BUT after I've disconnected SWD J-Link GDB Server it is not possible to connect again :-(.The Segger J-link GDB server just writes:3,3V ...Connecting to target...ERROR...Could not connect to targetTarget connection failed. GDB Server will be closed....and GDB server finishes running.I've tried various reset types in J-Link, J-LinkSTM32 for reset the MCU to default state but with no success.I think the Debug engine is not running in stop mode and the J-Link GDB server cannot detect the target.Please help me how can I reset the MCU a flash or erase the program in memory.Thanksjdx #swd-stop-mode-stm322014-01-31 09:01 AM
Hi
Try this: Use Boot0 and DFU to re-flash a different binary into the STM32 (one that does not put the STM32 into stop mode!).2014-01-31 09:36 AM
Do you think is it enough to just set boot0 to High which disables loadsing the program form flash memory and use SWD to write the program into the flash memory?
2014-01-31 09:40 AM
Hi
I hope so. I think the problem is that your program is putting the processor into stop mode. The debugger cannot connect to the processor because it is stopped.2014-02-01 09:43 AM
YES!!! It works!.
So, the solution is:- Set BOOT0 pin HIGH (in my case floating was enough)- Now the MCU is ''connectable'' by SWD- Flash working program- Disconnect MCU- Set BOOT0 to LOWDone!Thanks a lot!