cancel
Showing results for 
Search instead for 
Did you mean: 

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 correctly

JMene.1
Associate II
 
5 REPLIES 5
Imen.D
ST Employee

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
JMene.1
Associate II

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

> 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
Associate II

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.

@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