Skip to main content
Jim Rodrian
Associate II
September 28, 2017
Solved

STM32L051 Port PH1 Initialization Error

  • September 28, 2017
  • 7 replies
  • 1838 views
Posted on September 29, 2017 at 00:23

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. 

    This topic has been closed for replies.
    Best answer by Jim Rodrian
    Posted on September 29, 2017 at 17:35

    It was a hardware problem!  Removed solder short between PH1 pin and NRST pin and now the code executes as expected.

    Jim R.

    7 replies

    Tesla DeLorean
    Guru
    September 28, 2017
    Posted on September 29, 2017 at 01:06

    What are you doing about clocks? HSE, HSE BYPASS? Where is your code actually stuck or hanging up?

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Jim Rodrian
    Associate II
    September 29, 2017
    Posted on September 29, 2017 at 01:47

    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.

    Tesla DeLorean
    Guru
    September 29, 2017
    Posted on September 29, 2017 at 02:14

    Is this a custom board?

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