Skip to main content
Visitor II
January 10, 2024
Solved

Unusable STM32L01 MCU pins?

  • January 10, 2024
  • 2 replies
  • 3305 views

Hello, all.

I'm trying to design and build my first STM32 project, a timer. I'm using the STM32L101K4 and have it configured as illustrated in the attached screenshot. The pins are configured in STM32CubeIDE as:

External LSE on 2 & 3

LCD connections on 7-13, 25-27. Pins 8 and 25 are PWM pins to control the LCD's backlight and contrast.

A rotary encoder and push-button switch on 19-21.

Some LEDs on 22, 28 & 29.

SWD on 23 & 24.

And, an unassigned GPIO pin on 30.

I also have configured:

System Core->RCC->LSE

System Core->SYS->Debug Serial Wire

Timers->TIM2->Channel 1 PWM Generation and Channel 3 PWM

All of these are configured without conflict, I think.

I'm puzzled now that I can't assign a role like GPIO_Output to unused pins, such as 6, 14, 15, 18 or 31. Assigning a role such as GPIO_Output (I didn't try other roles) generates a conflict in the configuration, with yellow triangles and magenta backgrounds.

Is it true that, because of the configuration I've chosen, these pins must remain unused? Can anyone explain why?

Second question, mostly unrelated to the main question of this post: What's the difference between 'pinned' pins (such as 13 or 19-22) and 'unpinned' pins (such as 9-12)? What does 'pinning' control?

As always, thanks for any advice or guidance. I really appreciate the expertise in this group.

-Kevin

 

 

 

    This topic has been closed for replies.
    Best answer by TDK

    That is saying you cannot enable Master Clock Output 1 because the pin is already used. It's not an error or something you need to fix.

    2 replies

    Super User
    January 10, 2024

    Can you attach your IOC file?

    "Pinned" pins will not be automatically re-assigned to prevent a conflict.

    > STM32L101K4

    This chip doesn't exist. STM32L010K4Tx perhaps?

    KevinZAuthor
    Visitor II
    January 10, 2024

    Hi, @TDK, thanks for responding.

    Where would I find a .ioc file? I see "KitchenTimer_L010K4.ioc" as a tab at the top of the window, and "KitchenTimer_L010K4.ioc" in the list of items under Project Explorer, but I can't find a file that starts with "KitchenTimer" using my file explorer (Linux Ubuntu 22.04).

    Thanks for the 'pinned' explanation.

    Yep, it's a STML010K4. Thanks.

    -Kevin

    Super User
    January 10, 2024

    If you open up a file explorer, it should be in the project directory, or a parent directory. Can also drag/drop from within CubeIDE to the desktop, perhaps. You can on Windows.

    I wasn't able to duplicate the issue you're describing.

    TDKAnswer
    Super User
    January 10, 2024

    That is saying you cannot enable Master Clock Output 1 because the pin is already used. It's not an error or something you need to fix.

    KevinZAuthor
    Visitor II
    January 12, 2024

    @TDK, okay, thanks. I'll note that for the future.

    -Kevin