2020-08-11 07:41 AM
I am faced with an interesting problem. The code I have seems to run only after I press the reset button. If I somehow remove power, and put it back, it will not run until the reset button is pressed. HAS ANYONE ever had this problem ?
All my power rails are fine, NRST is pulled high and Boot0 is pulled Low.
I set the peripherals with CubeMX, I am using STMCubeIDE and my device is STM32F401RE.
I saw someone on Stack overflow was having the same issue while using KEIL, link below, and he solved by changing a few things in the IDE. HOW CAN I DO THE SAME with CubeIDE??
Link to Same problem from Stack overflow: https://stackoverflow.com/questions/43036256/stm32f4-program-will-only-run-after-pressing-reset-button
2020-08-11 08:19 AM
Code probably is running. Most likely in an unhelpful while(1) loop. Need to report status/function early within Reset_Handler(), and instrument Error_Handler() and HardFault_Handler() to be able to output some actionable data. Use GPIO or UART to check-point various places the code gets to as it starts.
Problem of not starting most frequently BOOT0 floating, but you seem to have addressed that.
Other would be expectation that clocks or other hardware starts as quickly as the MCU when power first applies/ramps.
If you have multiple supplies, you'd want an effective POR circuit to ensure everything is ready prior to starting.
Sorry not using CubeMX or CubeIDE here, you'll have to debug your situation to understand what is actually happening.
2020-08-12 02:21 AM
> NRST is pulled high
Maybe with unnecessary external pull-up resistor, but without a necessary capacitor? If yes, then read AN4488.
2023-11-14 11:29 PM
I am using stlinkv2 just check the jumper position it will solve the issue