2017-09-28 03:23 PM
I used STM32CubeMX to generate code for a STM32L051R8xx microcomputer. All I/O ports initialize correctly except PH1. If I delete the PH1 initialization code, the program executes correctly. With the PH1 code the microcomputer resets when it attempts to initialize PH1 as a push-pull output. This error occurs for code that uses either HAL or LL code. Is there a bug in the silicon or very low level firmware?
Jim R.
Solved! Go to Solution.
2017-09-29 10:35 AM
It was a hardware problem! Removed solder short between PH1 pin and NRST pin and now the code executes as expected.
Jim R.
2017-09-28 04:06 PM
What are you doing about clocks? HSE, HSE BYPASS? Where is your code actually stuck or hanging up?
2017-09-28 06:47 PM
I've tried two clock configurations. (1) HSI RC selected to drive HSI 16, 16 MHz SYSCLK. (2) HSI RC with PLLCLK, 24 MHz SYSCLK. In either case, the result is the same. Attempt to initialize PH1 causes a uC reset. The code continues to execute but in a 'continuous loop', always resetting when attempting to initialize PH1. Port PH0 initializes correctly as a push-pull output just prior to PH1 initialization which causes the uC reset. Clock LSI RC is also enabled.
Jim R.
2017-09-28 07:14 PM
Is this a custom board?
2017-09-28 08:16 PM
Yes, it is a custom board with no external crystals. I'm using the IAR ARM KickStart compiler and ST-Link tool.
Jim R.
2017-09-28 08:43 PM
Could it be something external, like causing the supply to brown out, or a cross connection with another pin? Can you replicate the behaviour on an equivalent NUCLEO or DISCO board?
I've configured PH1 (HSE_OUT) on a L072CZ without the system imploding.
2017-09-28 09:04 PM
Thanks Clive One! I just realized that PH1 (pin 6) is physically next to the NRST (pin 7) signal. It looks like there is a very small solder bridge between the two pins. I will remove the solder bridge and report my findings, tomorrow.
Jim R.
2017-09-29 10:35 AM
It was a hardware problem! Removed solder short between PH1 pin and NRST pin and now the code executes as expected.
Jim R.