AnsweredAssumed Answered

STM32F4xx: PD2 cannot use it as GPIO

Question asked by serretti.enrico on Nov 10, 2016
Latest reply on Nov 10, 2016 by waclawek.jan
Hello all,

I have a problem that driving me crazy. I'm using STM32F446 with case LQFP64. I'm not able to use PD2 as output digital even if with others PIN I can do it (PC0, PC1, PC2, ...). This is my code to set PD2 as general GPIO output:

     // LedS - Red
     GPIOD->MODER   = (GPIOD->MODER  & 0xFFFFFFCF) | 0x00000010U;
     GPIOD->OTYPER  = (GPIOD->OTYPER & 0xFFFFFFCF);
     GPIOD->OSPEEDR = (GPIOD->OSPEEDR & 0xFFFFFFCF) | 0x00000030U;
     GPIOD->PUPDR = (GPIOD->PUPDR & 0xFFFFFFCF);
     GPIOD->ODR = (GPIOD->ODR & 0xFFFFFFFB);

I've attached a LED to this pin, then I try to switch on the led in this way:

     GPIOD->BSRR = 0x00000010U;

Where I'm wrong ? Please help me.

Thanks and regards,
Enrico.

Outcomes