cancel
Showing results for 
Search instead for 
Did you mean: 

SWD floats, STM32F2, code don't run

vindhyachal
Associate II
Posted on August 13, 2015 at 08:39

1. I am using STM32F205, with serial wire debug, composing reset, clk, data & gnd pins.

2. Whenever I connect debugger my code runs perfectly. But without debugger, sometimes code just don't run. I am toggling a pin which never happens. it happens only sometimes.

3. No other clk init is done, so default 16Mhz clck, as soon as MCU power up, I keep on toggling pin. No code in between so couldn't be memory access other or anything. So pin toggle.

3. I have 0.1uf cap on reset pin & 10k pull down on boot pins.

4. However I have left swclk & swdata pins float.

5. I had checked below link & connected 10k pull down to clk & 10k pull-up to data.

http://support.code-red-tech.com/CodeRedWiki/HardwareDebugConnections

6.Code is running now. I will check multiple times before reaching conclusion, but any idea on this.

#wait-for-you--clive1-!-!-! #wait-for-you--clive1-!-!-!
17 REPLIES 17
Posted on August 13, 2015 at 14:27

How does your design treat the BOOT0 and BOOT1 pins?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Nesrine M_O
Lead II
Posted on August 13, 2015 at 15:45

Hi,

It seems like you execute from RAM, can you please check the boot pins configuration.

-Syrine-

Posted on August 13, 2015 at 17:39

How does your design treat the BOOT0 and BOOT1 pins?

Nevermind, I see you mentioned them now.

A pull-up on NRST? What address are you building the code for? Do you have a (partial) schematic for how the STM32F2 circuit is built?
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
vindhyachal
Associate II
Posted on August 14, 2015 at 09:37

1. 

there is also 10K pull-down to boot0 pin so code should enter flash rather than RAM.

2. 

In reset network, R is internal to STM32F205 as datasheet mentions, I have only 0.1uF external capacitor to it.

3. 

From yesterday, problem has arrived only once. When MCU failed to start.

4. 

1. Load is around 50mA. I have bypassed the supply properly & checked in CRO, till now no issues.

5. Problem is pin never toggles. 

 I have disabled systeminit() code by pacing a return at first line. But when MCU fails then pin remains high(default state high impedence).

That means control never enter main.

vindhyachal
Associate II
Posted on August 14, 2015 at 11:44

1. I had same problem in two boards.

2. In one of board, again same problem came, & I had noticed that reset pin is low (which is bypassed by 0.1uF).

3. I have checked all VDD & VSS pins on CRO, all are ok.

4. Additionally i had connected two 10pf caps on pins PH0-OSC_IN , PH1-OSC_OUT. However no oscillator is connected since i am using internal oscillator. They were soldered during soldering process at that I don't have oscillator. Right now i am using internal oscillator.

5. Pin sequence of MCU is: PH0-OSC_IN(5) , PH1-OSC_OUT(6) , & NRST(7)

6. however datsheet says on power up , oscillator pins are default to GPIO.

7. So could this be problem? 

8. Right now I have removed these caps, & board is working again. but I am not sure.

vindhyachal
Associate II
Posted on August 15, 2015 at 20:47

1. Again problem arises. I had checked that reset pin voltage output is low.

Don't know why it so. So code never runs, as MCU is in rese state always. 

What can lead to hardware reset pin to logic, provided there is only 0.1uF cap across it.

& 0.1uF is of 16V. 

2. I have changed that 0.1uF cap also, in 1 board problem gone, while in other problem still remains. I have checked that removed 0.1uF cap, it is showing correct value in DMM.

Posted on August 15, 2015 at 21:36

The NRST being low is indicative that the analogue supply is not connected. The analogue supply controls the POR, OSC and PLL.

You should also see 1.25V on the VCAP pins. When you don't see these you need to double check supply and orientation issues.

Doesn't sound like an orientation issue here. I would recommend double checking your soldering (shorts/opens), grounds and supplies.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
vindhyachal
Associate II
Posted on August 16, 2015 at 10:19

1. I had checked multiples times to check supply pin voltages of MCU, by placing CRO pin on MCU pin itself, rater than on track, to be double sure. & with multimeter for continuity. 

2. ALL VDDD, VSSD, VDDA, VSSA has 3.3V & ground properly.

3. Vcap1 & Vcap2 have correct voltage levels.

4. boot pin has 10k pull down.

Posted on August 16, 2015 at 15:53

Do you have a schematic for this? Is it a break-out board, or do you have other parts connected?

Does the behaviour change if you have a 10K pull-up in NRST?

Does the behaviour change if you pull-up BOOT0 instead of having it low?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..