cancel
Showing results for 
Search instead for 
Did you mean: 

STM32-MAT-TARGET Can not find which APB timer TIM1 is connected to.

antonio rueda
Associate II

Posted on February 04, 2018 at 11:08

Hi, I've been following the manual STM32-MAT/TARGET Hands On Rev 2.2 (see attached) and I am not able to get the timer 1 working (everything is working except this). I did everything like in the manual but when I load the .ioc file into simulink I get the next error:

♯♯♯ TIMERS_Config function : Can not find which APB timer TIM1 is connected to.Default preference value STM32TIMAPB set to APB1 is used.

I am using the STM32F767ZI nucleo.

Anybody knows how to solve this issue? Am I missing something?

Thanks in advance!

10 REPLIES 10
Posted on February 04, 2018 at 15:12

The Reference Manual is an authoritative source for such information.

The Data Sheet also has a diagram, Figure 2 Page 19

http://www.st.com/content/ccc/resource/technical/document/datasheet/group3/c5/37/9c/1d/a6/09/4e/1a/DM00273119/files/DM00273119.pdf/jcr:content/translations/en.DM00273119.pdf

 

APB2 (the faster bus)

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
antonio rueda
Associate II
Posted on February 04, 2018 at 17:04

Thanks for the quick response. Now I am able to use the tim1 but only if I configure it from the STMCubeMX tool. If I change the configuration using the STM Simulink blocks, the generated code doesn't match the Simulink configuration.

I need to output a PWM signal with a variable duty cycle, but since the code generation from Simulink is not properly working, how can I configure that externally and after that use Simulink to change the duty cycle? Any ideas or any examples? 

Thanks in advance.

henry.dick
Senior II
Posted on February 04, 2018 at 18:01

'

I am using the STM32F767ZI nucleo.'

the right way is to look up the RCC section of the datasheet and find out where TIMEN bit is.

the quick way is to search TIM1EN in the device header file.

Posted on February 04, 2018 at 17:34

The pulse width on channel one can be modulated via TIM1->CCR1

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on February 04, 2018 at 18:10

Isn't Simulink supposed to configure this? 

Posted on February 04, 2018 at 18:24

One might hope automated tools will handle all the details, but I wouldn't rely on it.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on February 04, 2018 at 18:25

don't know - I was simply trying to provide a means for you to find out which bus tim1 is connected to.

Sebastian K.
Associate II
Posted on February 05, 2018 at 22:05

Hello,

I also played around with the STM32 MAT Target in Simulink, and in my humble opinion it is hopelessly buggy and non-functional. I could not get even simple examples to work (that was about a year ago already though).

What I would recommend is keep the non-microcontroller-specific code in Simulink with a well-defined input and output interface, and generate C code from it with the generic Embedded Target in Simulink that you call as a function in your C project generated with CubeMX or whatever. That way you can manage all your peripheral settings in CubeMX or directly in C, which usually works pretty well.

Let me know if you want more detailed explanations.

Posted on February 06, 2018 at 15:38

Hello, 

Thanks for the info, I found a couple of bugs but I've managed to run some basic examples with the timers. I am really interested in using the generic Embedded Target for Simulink since STM MAT Target is just giving me headaches. I've been looking for some examples to use CubeMX+Embedded Target but I can't find anything. I have some manuals from mathworks but they are only useful to configure Simulink and to generate the code.

Do you know where I can find tutorials or examples to configure the I/O interface?

Thanks in advance!