Hi When I use optimization level 2 or 3, the debbuger crash and the Uvision halt. I'm using uVision 4.21 and ULINK Pro with STM32F103ZC (the same problem also with the ST-LINK V2). Thanks
It is also possible that your code enabled some low power mode which disabled the debugger; and that code is optimized out at higher settings.
I meant to say that your code might contain manual pragmas to exclude some low power code in case of certain optimization settings.