2024-01-10 05:31 AM
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
Solved! Go to Solution.
2024-01-10 08:06 AM
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.
2024-01-10 05:50 AM - edited 2024-01-10 05:53 AM
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?
2024-01-10 06:27 AM
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
2024-01-10 06:32 AM
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.
2024-01-10 06:45 AM
2024-01-10 07:18 AM
Your IOC didn't show any errors when I opened it, and I'm able to assign unused pins as output without seeing any errors.
I am on an updated CubeMX version compared to you. I doubt that's the problem but it could be.
2024-01-10 07:56 AM
This is what I see, if I try to map PA8:
2024-01-10 08:06 AM
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.
2024-01-12 11:39 AM
@TDK, okay, thanks. I'll note that for the future.
-Kevin