2015-12-29 07:46 PM
I goofed, big time. I'm new to the STM32F and I didn't follow the STM32F4 discovery schematic. I built a board that I wanted to power up from flash, and while I remembered the BOOT0 setting (GND), I left nRST floating.
I can use SWD to program the board, but simply applying power doesn't start the code execution. If I use the ST-LINK software, I can manually start the code running by forcing a system reset. I understand there is an internal pull-up on the reset pin, but do I need to configure it? Is the 100nF capacitor required for self-start execution? I had a few PCBs made, so if there's a software-only solution I can test (short of forcing a reset with the ST-LINK each time), that's much appreciated as well. Thank you!2015-02-03 08:14 AM
Thanks for all your help, though I am still unable to start the PCB without the ST Link. A simplified schematic appears here:
http://imgur.com/eNiqW8w The startup code I am using is the standard uVision start_stm32f4xx.s: [code] ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP [/code] I understand that a solution might be to add a 0.1uF capacitor to GND on NRST, but I would like to exhaust software options prior to modifying several PCBs. For what it's worth, I used an oscilloscope to examine NRST and the behavior seems appropriate. I'm new to assembler but found a good LED toggle example. I'm trying to work that into my startup code now.2015-03-07 06:24 AM
I'm unfortunately still not able to get this to start reliably. I added a 100K resistor/0.1uF capacitor to the nRST pin and it makes no difference for self-starting. If I momentarily short the pin to GND, then it starts.
What should I test next? The supply rise time looks quite quick on an oscilloscope. I worried about excess capacitance increasing start time - should I put a bigger capacitor on the reset circuit? I'd like to nail down the schematic so I can produce boards with the right components on my next revision.2015-12-30 06:06 AM
Are you sure it's not actually running? ie it's running and stuck in a loop or handler, but not getting to main()
The capacitor delays the rise time of the reset pin as the power supply ramps. Can you not tack a wire to the pin and add other components to see if the absence of the resistor is the problem? I'm not sure it is, things like the analogue supply are more critical. What about the state of BOOT1 ?2015-12-30 06:13 AM
In order:
1. It is not running. I have an LED-blink test program that does not execute on power up, but which does execute after I use a system reset. 2. I thought the resistor was internal to the STM32, and just a capacitor would be needed. I intend to try this, but am reluctant if there is a software-only solution as there is not a lot of opportunity to solder something to the pin. 3. BOOT1 is tied to GND, but my understanding is that this is irrelevant so long as BOOT0 is tied to GND.2015-12-30 08:08 AM
There is an internal pull up, but I'm not sure that's your problem.
Do you have a circuit diagram of what you've created?2015-12-30 12:08 PM
I have a dozen designs with F100 and F429, where nRST's are left floating without any problem. MCU surely has internal pullup on nRST.
regards, Tamas2015-12-31 06:57 AM
Yes, but the schematic is fairly involved. Everything else for the ''minimal circuit'' should follow the STM32 discovery -- is there a section in particular where it would be helpful to see the schematic?
I am also wondering if it is possible that there is an issue with the startup code, but then it seems strange that a manual reset would cause the code to enter when a typical power-up does not.2015-12-31 09:27 AM
Well lets start with the stuff that's immediately attached to the STM32, like the supplies, decoupling caps, VCAP pins, debug headers, LEDs and USARTs?
Assume also that the debugger IS invasive, telling it to reset the chip is not quite the same as an unattached cold start. Yes, it could be the start up code, a LOT of stuff happens before it gets to your main() code, which is why it would be helpful to understand if it's running and stuck someplace else rather than totally non-functional which is how you're characterizing it right now. I would put assembler code at the ResetHandler to modulate a GPIO/LED output.