cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103VET6: cannot place TIM2CH1 in OC output remapped mode (pin77)

ivainc
Associate III

Trying to use CubeMX v6.2.1 to put timer 2 channel 1 in "OC CH1" mode to pin 77. It looking like pin 77 do not configure to output mode by CubeMX and cannot generate. If I use "OC CH1 no output" with interrupt enabled and preconfigured, the pin signal is OK.

Possible points: 1. Pin77 have default function JTDI, but I use SWD (and checked it in CubeMX). 2. This pin share the functions "TIM2CH1" and "TIM2_ETR". However, I set the pin 77 in "TIM2CH1" mode.

Need help.

6 REPLIES 6
TDK
Guru

Works fine for me. Must be something else in your configuration.

0693W00000ANYreQAH.png

If you feel a post has answered your question, please click "Accept as Solution".
ivainc
Associate III

Yes, it looks right in CubeMX, but actually in my PCB it does not work. Pin 77 got in reset state and cannot generate. If you have the board with STM32F103VET6, can you please check the pin 77 behavior ander the OC output mode with the following config. To start generate I use HAL_TIM_OC_Start(&htim2,TIM_CHANNEL_1) function. Pin 77 stay in reset state.

ivainc
Associate III

Pin 77 must be in output push pull. It is done automatically depending on the mode selected.

When you said cannot generate, I thought you were talking about generating code, which works. I do not have a board, unfortunately.
If you feel a post has answered your question, please click "Accept as Solution".
ivainc
Associate III

This story to be continued. I have a remapping conflict between TIM2CH1 and SPI1. Both peripheral are remapped as shown in IOC file included. Unfortunetely, CubeMX do not manage this remapping issue and do not warn the user. the SPI1 and TIM2CH1 fight for pin77! Those peripherals cannot to win!

The question is: how to prevent this issues it the future projects?

ivainc
Associate III

Chip view for recreate.