cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Timer Function library

ankhola
Visitor

Hi Guys, I am completely new in the world of ST Microcontroller. I have worked with PIC Microcontrollers using MikroC Compiler. After studying various tutorials on this topic, I am getting it slowly. While going through  code of generation of PWM, I came across a function " HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1);" which, I assume, starts PWM. My question, Is it a library function? If so, how can it be accessed. Incidentally it is stated that I have installed STM32 CubeMX and STM32 Cube IDE.

16 REPLIES 16

@ankhola wrote:

I got the issue. So, for such functions, I shall have to go through the examples. Right? 


You need to start with the examples provided in the STM32Cube HAL. This is to speed up the development.

But if you have an issue you need to open a new thread and provide the complete project: code and ioc file.

Meanwhile as said by @Peter BENSCH , we can suspect that you are using Blue Pill board. Which frankly we don't support as 99% contains a counterfeit STM32 MCU.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

I have downloaded the UM. Yes, I have found the functions there. Thanks.

I have not yet started in Hardware. Right now trying to grasp the ideas.


@ankhola wrote:

I am using STM32F103C8T6.


Ok. So if you are planning to use STM32F103, you can use NUCLEO-F103RB board.

All STM32 family has at least one NUCLEO board provided by ST (contain genuine chips). So it's up to you to choose the suitable board that fits your needs/application.

So I don't recommend to use any of Blue/Black pills boards available in the market.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

@mƎALLEm wrote:

@ankhola wrote:

I got the issue. So, for such functions, I shall have to go through the examples. Right? 


You need to start with the examples provided in the STM32Cube HAL. This is to speed up the development.

But if you have an issue you need to open a new thread and provide the complete project: code and ioc file.

Meanwhile as said by @Peter BENSCH , we can suspect that you are using Blue Pill board. Which frankly we don't support as 99% contains a counterfeit STM32 MCU.


Then what is the way of getting genuine one?

Already answered that question in my previous comment ;)

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

@ankhola wrote:

I have not yet started in Hardware. 


In that case, when you do, I would strongly suggest that you get a Nucleo-F103RB.

This is a genuine, supported ST board featuring the STM32F103RB microcontroller.

It is widely used, so you will easily find plenty of people familiar with it to help you.

There are ready-to-use examples published by ST, and available via CubeMX.

And it comes complete with a genuine ST-Link built in.

 

For getting started with STM32, see:

https://community.st.com/t5/stm32-mcus-products/for-better-learning-stm32-programming-and-debugging/m-p/719468/highlight/true#M260690

Also:

https://community.st.com/t5/stm32-mcus-products/for-better-learning-stm32-programming-and-debugging/m-p/719485/highlight/true#M260696

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.