cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103 - Use of PWM (Timer1) without the debugger

samuel23
Associate II
Posted on January 24, 2017 at 07:58

Hi,

We configure the timer 1 to run a PWM signal on PA8 & PA9.

It works well with the debugger, but when we power the MCU directly, the PWM is not running ! (We can confirm that the main is running... with a manual GPIO toggle).

We are using HAL software, with System Workbench for STM32 + arm-none-eabi-gdb.

Any idea?

Maybe openocd or arm-none-eabi-gdb are setting some register during the debugging process...which make our timer running...

Thanks,

Samuel.

4 REPLIES 4
Khouloud GARSI
Lead II
Posted on January 24, 2017 at 11:18

Hi

Samuel.Poiraud.005

,

but when we power the MCU directly, the PWM is not running !

Could you please configure:

  • a LED to toogle after the PWM signal generation.
  • a second LED in the while() loop.

Are the LEDs toggling conveniently?

Khouloud.

Posted on January 24, 2017 at 11:26

This is strange. What about some other timer?

JW

Olivier GALLIEN
ST Employee
Posted on January 24, 2017 at 11:32

https://community.st.com/0D50X00009XkhieSAB

looks similar problem ?

Olivier GALLIEN
In order 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.
samuel23
Associate II
Posted on January 24, 2017 at 12:02

Thanks for your answers...

Khouloud G‌ : the leds are toggle, after the PWM generation and in the while(1) loop. We can consider the code is running the entire main... (which is reduced at the minimum to avoid the risk of not understandable things)

HAL_Init();

SYS_ClockConfig();          //home made HAL_RCC_OscConfig + HAL_RCC_ClockConfig + SystemCoreClockUpdate

HAL_GPIO_Init (...);                //for each leds pins / ...

UART_init(...);                   //for fun...

and the config of timer with pwm

while(1)

{

   toggle of led...

}

Olivier GALLIEN‌ : interesting article. I my first fast review not find the same error in my source code... but i need to check in details... (not know, i must go...) I keep this track.

I will test with another timer...

to be continued...