cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103C8 Can't go main()?

Carter Lee
Associate III
Posted on September 15, 2017 at 07:17

Hi.

I've got a new custum-board

https://www.keil.com/dd2/stmicroelectronics/stm32f103c8/#/eula-container

from device mart.

http://www.st.com/content/ccc/resource/technical/document/datasheet/33/d4/6f/1d/df/0b/4c/6d/CD001615pdf/files/CD001615pdf/jcr:content/translations/en.CD001615pdf

This is connected Ulink2 for debugging.

I've just checked Ulink2 and board can be connected and success write flash.

Build target 'STM3210C-EVAL'

''.\STM3210C-EVAL\STM3210C-EVAL.axf'' - 0 Error(s), 0 Warning(s).

Build Time Elapsed: 00:00:00

Load ''C:\\work\\en.stswtm32054\\STM32F10x_StdPeriph_Lib_V3.5.0\\Project\\STM32F10x_StdPeriph_Template\\MDK-ARM\\STM3210C-EVAL\\STM3210C-EVAL.axf''

Erase Done.

Programming Done.

Verify OK.

Flash Load finished at 13:43:07

Then I've set up withGPIO's IOToggle example code inSTM32F10x_StdPeriph_Template .

But can't step through code.

What am I supposed to do to resolve this problem.?

fig1.

0690X00000608DqQAI.png

fig2.

0690X00000608DvQAI.png

fig3.

0690X000006086IQAQ.png

fig4.

0690X00000608BRQAY.png

fig5.

0690X00000608FSQAY.png

fig6.

0690X000006088XQAQ.png

fig7.

0690X00000608EAQAY.png

fig8.

0690X00000608EFQAY.png

fig9.

0690X00000608E5QAI.png

fig This is the first time what I've push the ''start debugger session button''

0690X00000608F3QAI.png

fig This is screenshot after figf10 with F5 button.

See Attachements 20569

But as you can see thefig11, there is no movement

I think it's not going to main() from startup and i've also defined USE_STDPERIPH_DRIVER, STM32F10X_CL, USE_STM3210C_EVAL,HSE_VALUE=8000000

--update

I think I found the point of problem.

See Attachements 20575

/* Wait till PLL2 is ready */

while((RCC->CR & RCC_CR_PLL2RDY) == 0)

//<===STUCK HERE

{

}

But I still don't know how to resolve this problem.

3 REPLIES 3
AvaTar
Lead
Posted on September 15, 2017 at 07:54

There is obviously a 'run to main()' enabled in the debugger settings.

I have no Keil uVision installation, so I can't tell you the exact dialog/location.

Disable it, and you can step into the reset vector.

I guess either the memory initialization fails (wrong startup ?), or the clock initialization in SystemInit() fails.

Posted on September 15, 2017 at 08:11

Thanks but I've checked the 'run to main'. but it still does not work.

Now, I'm using 'startup_stm32f10x_cl.s' file from C:\work\en.stsw-stm32054\STM32F10x_StdPeriph_Lib_V3.5.0\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\

What am I missing? should I have to add something or fix?

Posted on September 15, 2017 at 10:28

Thanks but I've checked the 'run to main'.

This statement is a bit ambiguous.

You need to un-check any 'Run to main()', to debug the initialization after reset.

while((RCC->CR & RCC_CR_PLL2RDY) == 0)

 //<===STUCK HERE

This means that either your configuration is wrong, (perhaps an incorrect multiplier, resulting in an un-achievable clock frequency), or there is something with the quartz. Either not present, not working, or of a wrong frequency.