AnsweredAssumed Answered

GPIO strange behaviour STM32F427

Question asked by anton.bogdan on Jun 4, 2018
Latest reply on Jun 5, 2018 by T J

Hello,

 

i have a simple code where i just init some GPIO ports on a STM32F427VI  ( 100pin package).

 

The application controls via pin PA8 some transistor which switches on/off a relay after some delay...

 

I have noticed  if i configure PE2,  then PA8 does not work ( does not switch to HI).

 

If i comment out the red code shown bellow,  then PA8 works fine. Why is this? I have never encounter such problems with stm devices.

 

 

int main()
{

 

SystemInit();
GPIO_InitTypeDef GPIO_InitStruct;

RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOC| RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_GPIOB |RCC_AHB1Periph_GPIOE, ENABLE);// GPIOA & GPIOB clock enable

GPIO_InitStruct.GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_8;
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOA, &GPIO_InitStruct);

GPIOA->BSRRL = GPIO_Pin_3 ; // PA3 Hi 
GPIOA->BSRRH = GPIO_Pin_8; // PA8 Low 

 

for(uint32_t o=0; o<0xFFFFFF; o++) { } // some delay
for(uint32_t o=0; o<0xFFFFFF; o++) { } // some delay
GPIOA->BSRRL = GPIO_Pin_8; // PA8 hi


GPIO_InitStruct.GPIO_Pin = GPIO_Pin_2;
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStruct.GPIO_OType = GPIO_OType_OD;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOE, &GPIO_InitStruct);

 

return 0;

}

Outcomes