Skip to main content
JMene.1
Associate II
March 15, 2021
Question

I'm using theNucleo STM32L152 and I want to remap PC13 on timer 4 IC2. But on the ICR register, I can set all the bits except bit 17 to select timer 4 (I can set it 16). I configued PC13 as Alternate function AF14. Do you have an example working corr

  • March 15, 2021
  • 3 replies
  • 1597 views

..

This topic has been closed for replies.

3 replies

Technical Moderator
March 16, 2021

Hello @JMene.1​ ,

Have a look on the HAL examples run on STM32L152xD devices within STM32CubeL1 MCU package:

\STM32Cube_FW_L1_V1.10.2\Projects\STM32L152D-EVAL\Examples\TIM\

You may re-use sections available in the examples or get inspired from them to achieve your goal.

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
JMene.1
JMene.1Author
Associate II
March 16, 2021

Imen, the input capture works correctly. My problem is the ICR register of the RI peripheral. When, with the debug, I try to set bit 17 and 16 to 1 in order to Timer4, I get an error: value out of range. Can I route PC13 to the Timer 4 IC2?

Thanks

waclawek.jan
Super User
March 16, 2021

> When, with the debug, I try to set bit 17 and 16 to 1 in order to Timer4,

>I get an error: value out of range.

This sounds to be the debugger's limitation (what debugger, btw?).

What happens if you try to set it in code? What is the read out value of given register after the write?

JW

JMene.1
JMene.1Author
Associate II
March 17, 2021

I tried with cubeIDE and Keil.

If I write the code below, bit 16 is set and not bit 17.

 *((uint32_t *) 0x40007C08) = 1<<16 | 1<<17;

 value = *((uint32_t *) 0x40007C08);

I tried to set ICx bits and ICOS bits first too, but nothing changed. bit17 is the only one in the ICR register that I cannot modify.

waclawek.jan
Super User
March 18, 2021

@JMene.1​ ,

What exactly is written on the STM32L152 you are experimenting with?

@Imen DAHMEN​ ,

to me, this sounds like a relatively serious hardware limitation. I believe this is worth further investigation.

JW