cancel
Showing results for 
Search instead for 
Did you mean: 

HAL timer problem

elec_st
Associate III
Posted on March 27, 2017 at 23:37

i want use timer1 with external trigger to enable the counter.

but when stm32cubemx  generate code the mcu crash and stop working and debug stop

and after long time i found the problem in this line

  __HAL_AFIO_REMAP_TIM1_ENABLE();

how to solve it ???

i use stm32f103

7 REPLIES 7
Imen.D
ST Employee
Posted on March 28, 2017 at 15:54

Hi,

Could you please precise which version are you using and if possible share your .ioc file ? This will help us to verify this issue.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on March 28, 2017 at 20:45

i use stm32cubemx v4.20

here is my stm32cubemx and i generate code for keil mdk v5

________________

Attachments :

ahmed.rar : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HykJ&d=%2Fa%2F0X0000000bBq%2FUFHoqtw25FRwvJAgZlWRaeKJVEU9F2_rPNqIH2pW8EE&asPdf=false
Posted on March 29, 2017 at 23:02

Remap depends on AFIO clock being enabled

F1 design remaps multiple pins related to the TIM at once, make sure those don't conflict with other uses of those other pins.

Not digging through Cube/HAL stuff, sorry.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on March 29, 2017 at 22:04

i can't solve it.

elec_st
Associate III
Posted on March 30, 2017 at 17:10

i just want to know that's my personally problem or  Stm32Cubemx HAl problem ??

Posted on March 30, 2017 at 19:08

I think you get to own it until you can demonstrate otherwise.

Could be the hardware/board you haven't described. Does the same code work on an STM3210-EVAL board?

You'll need to come up with a more definitive reason why/where it 'crashed'.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
elec_st
Associate III
Posted on March 31, 2017 at 22:52

thank you

i solve my problem and now my project work fine

by the following

1- i uninstall hal Stm32Cubemx .

2 - download st  std standard peripherals library and it's work fine .