2015-08-12 11:39 PM
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/HardwareDebugConnections6.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-!-!-!2015-08-16 11:01 AM
1. Here it schematic, I have my own custom board.
http://docdro.id/z7owNme2. Today I have problem in other board. Code does not run. Because as soon as code enters into systeminit(), I pulled a pin low. Since this never happens, that means code never enter to execute. 3. Checked voltage levels with CRO , directly on MCU pins Reset pin = 3.3 VCLK = 0VData = 3.3VBOOT0 = 0VAll AVDD & DVDD = 3.3V 4. Also checked continuity by multimeter of various connections to check dry solder, but all are ok.5. Issue is code never starts to execute.?2015-08-16 11:03 AM
Edit: Didn't tey 10k pullup on reset pin, since no place in hardare. Can solder to check.
Boot0 is directlty grounded.Problem arises only once in while. Say 1 in 100 times.2015-08-16 12:03 PM
Is there some value to enumerating your answers?
What code exactly are you running, perhaps there's an issue with that? Does it run under the debugger?2015-08-16 12:05 PM
You said you pull the boot pins low, BOOT1 (PD2) really needs a pull-down on it.
2015-08-17 01:49 AM
1. Yes code always run on debugger. no problem ever. I am using keil ulink2.
2. I have 10K pull-down resistor on boot0 pin.You said ''BOOT1 (PD2) really needs a pull-down on it.
''But datasheet says if boot0 is pulled low, then boot1 is don't care for executing code from flash.Also I had made this pin as GPIO_ANALOG as this is unused3. As I have told that as soon as I enter the code, I make pin toggle with a timer.Since this never happens when problem arises, that mean code never start to execute.Even if reset is high 3.3V, all vdd = 3.3V, boot0 is low.2015-08-17 05:07 AM
I'm leaning towards an issue with the crystal or the code. Marginal, or slow to start.
I'd probably instrument the code more tightly from the reset handler, to the point where the timer is configured.2015-08-22 02:05 AM
1. There is no external crystal. I use internal 16Mhz crystal which then use PLL for 120Mhz.
2. I had given some delay(50ms) between power up & pll setup. System worked for sometime.But again sometimes problem arises3. Parts of my code are:Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDPvoid SystemInit(void){ initialize_unused_pins(); configure_general_timer(); configure_pll();}2015-08-22 07:29 AM
Not sure I can do much with that amount of information. Your going to need to look at how to effectively instrument and debug your own code.
I will note that when SystemInit() is call the C Runtime environment has not been initialized, so you'll need to watch what static variables and assignments are being used. SystemInit() really just needs to enable the clocks and external memory interfaces.