title: Why isn't internal pull-down resistor working on STM32F411CEU6 (Black Pill Board)?
body: <p>I am trying to configure the STM32F411CEU6 onboard button (PA0), but cannot configure it to use the internal pull-down resistor. My current setup allows it to trigger an interrupt when using a pull-up resistor, but when I change it to a pull-down resistor it no longer works. I would appreciate if anyone could guide me on what I did wrong, and could clarify my understanding of the process. I am using the STM32 Standard Peripheral Library. I have put my GPIO initialization code below.</p>
  <pre><code>// enable clocks for the the KEY button (PA0) GPIO and 
  //  the system configuration controller (SYSCFG) for GPIO interrupts
  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);
  RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
  
  // initialize the GPIO pin, PA0, with an internal Pull-Down resistor
  GPIO_InitTypeDef GPIO_Button_InitStructure = { 
          .GPIO_Pin = GPIO_Pin_0,
          .GPIO_Mode = GPIO_Mode_IN,
          .GPIO_PuPd = GPIO_PuPd_DOWN         /* works with GPIO_PuPd_UP... */
  };
  GPIO_Init(GPIOA, &amp;GPIO_Button_InitStructure);
  
  /* ... Other interrupt enabling configuration stuff that is known to work here... */
  </code></pre>