2024-12-04 03:38 PM
hello everyone
I'm having problem with debugging stm32f103 blue pill with Keil 5.39 ans st-link v2 programmer.
my programmer work fine when i load code without debug on micro but when i want to go to debug mode, my code run till the line
__HAL_AFIO_REMAP_SWJ_NOJTAG();
and then go to the reset handler part and when it reach to the BX line in reset handler, micro will be halt and not go further anymore.
can anyone help me?
Solved! Go to Solution.
2024-12-05 02:56 AM
A lot of Blue Pills have fake parts, those are not supported by ST's tools.
Fake / clone parts don't function consistently with STM32F1 devices.
2024-12-04 05:31 PM
Why do you need to remap mid debug session?
Is the stack setup properly?
Does it go to the Hard Fault Handler? Perhaps instrument that so you know, debugger, or not.
2024-12-04 11:28 PM
actually, i am new in working with ST.
I just install the CubeMX and Keil and create a very simple program to test Debug.
This is my project on CubeMX. as you see i just change the sys configuration to SerialWire.
in Keil, i
1- Change arm compiler to version 6 because version 5 was not installed in new version of Keil.
2- Set the optimization level to O0.
3- in the St-Link Debugger setting, the Connect and Reset setting are Under Reset and autodetect respectively (other options were also tried, but the problem still existed) . in flash download tab Reset and Run option is enabled. and in Pack tab, I unchecked the Enable option because when it was checked, The program could not be loaded on the micro, and the error of the genuinity of the micro was received (when it is unchecked, program could load on micro and work fine without debug mode of course).
2024-12-05 02:56 AM
A lot of Blue Pills have fake parts, those are not supported by ST's tools.
Fake / clone parts don't function consistently with STM32F1 devices.