cancel
Showing results for 
Search instead for 
Did you mean: 

Some doubts on CubeMX

SS.Sagar
Associate III
Posted on December 19, 2015 at 12:58

Hi,

I am using Nucleo board and Keil 5. I am using cubemx to configure the nucleo (STM32F103Rxx). 

My doubts are

1. if i configured USART then, do i need to configure the pins (for USART) manually in code?

2. If i configure USRAT then, can i use interrupt which are already defined?

#nucleo #!stm32-!cubemx
3 REPLIES 3
hbarta
Associate II
Posted on December 19, 2015 at 15:18

1) The initialization code produced by MX for the UART will configure all pins according to the settings you specify.

2) Not sure I understand this. MX generates stubs for the interrupts which call into library functions. The library functions issue callbacks to your application. I don't recall if MX produces stubs for the callbacks or if you have to figure that out yourself. Then you just need to use the _IT() version of the API calls to read or write the UART.

SS.Sagar
Associate III
Posted on December 19, 2015 at 17:21

Thanks.

i have one more doubt on timer setting in cubemx.There is setting called slave mode. what is slave mode option?

i have attached the screen shot of the same.

________________

Attachments :

cubemx_doubts.PNG : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hto2&d=%2Fa%2F0X0000000aX9%2FeISwhvJPXYL9TDFUnkYX0.Wqf4qJCL0wh.RjUqVAGM0&asPdf=false
Posted on December 22, 2015 at 11:45

Hi hobb.epy,

As indicated in 

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/reference_manual/CD00171190.pdf?s_searchtype=keyword

 (section 14.3.19-TIMx and external trigger synchronization)

''The TIMx timer can be synchronized with an external trigger in several modes..''.

 

So, user can configure one timer as a slave of another master timer (by default, timers are in master mode) according to the value of TIMx_SMCR) register (refer to table-82-TIMx Internal trigger connection).

In STM32CubeMx pinout view, enable the ''Slave Mode'' of the timer and enable ''Trigger Source'' with the value that corresponds to the master timer.

-Shahrzad-