Quantcast
Viewing all articles
Browse latest Browse all 16

STM32 F205VCT6: GPIO B Port 6 and 7 do not work?

I’m using the STM32 F205VCT6. I have a simple blinking LED program written in C++ with VisualGDB (and VS 2013 Community). It works fine for pins like A1 and E2, but it doesn’t for B6 and B7, where I want to plug in USART. Does the processor block it somehow? I have really no idea. Please help, thanks.

UPDATE: Link to the full project on Dropbox: https://www.dropbox.com/s/jk9r9avg276k6l3/LF-3.rar?dl=1

My program’s code:

#include <stm32f2xx_gpio.h>
#include <stm32f2xx_rcc.h>

void Delay()
{
    int i;
    for (i = 0; i < 1000000; i++)
        asm("nop");
}

int main()
{
  GPIO_InitTypeDef GPIO_InitStructure;

  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  GPIO_Init(GPIOB, &GPIO_InitStructure);

  for (;;)
  {
      GPIO_WriteBit(GPIOB, GPIO_Pin_6, Bit_SET);
      Delay();
      GPIO_WriteBit(GPIOB, GPIO_Pin_6, Bit_RESET);
      Delay();
  }
}

Viewing all articles
Browse latest Browse all 16

Trending Articles