Skip to main content
Visitor II
June 21, 2024
Question

Can't pull up a GPIO pin set as AF QSPI I/O

  • June 21, 2024
  • 1 reply
  • 1372 views

Hi,

I am working on a project on STM32H750. I set up the QSPI I/O pins on PD11, PD12, PD13 and PE2. 

Because PE2 (IO2) also serves as the WP# pin for the external flash, I would like to set it to have an internal pull-up, so the GPIO definitions are like:

    //PE2-- QUADSPI_BK1_IO2
    GPIO_Initure.Pin=GPIO_PIN_2;
    GPIO_Initure.Mode=GPIO_MODE_AF_PP;  
    GPIO_Initure.Pull=GPIO_PULLUP;             
    GPIO_Initure.Speed=GPIO_SPEED_FREQ_VERY_HIGH;
    GPIO_Initure.Alternate=GPIO_AF9_QUADSPI;  
    HAL_GPIO_Init(GPIOE,&GPIO_Initure);
 
However, even with GPIO_PULLUP, the pin still stays low after initialization. Did I miss some other set up? How can I set it to have an internal pull-up?
 
Appreciate any pointers. 
 
Zhi
 
    This topic has been closed for replies.

    1 reply

    Graduate II
    June 21, 2024

    You probably did set it successfully, but that's only going to help if the peripheral tri-states it's pins.

    If it remains in push/pull mode that's always going to determine the start of the pin.

    You'd have to reconfigure the pin to an input for it to tri-state. see GPIOE->MODER

    ZhiFengAuthor
    Visitor II
    June 21, 2024

    Hi, 

    Thanks for the reply. I tested out the pin without connecting to any peripheral. That is how I find out it is not pulled up.

    I also tried the open drain option, GPIO_MODE_AF_OD, it also stays low. I don't know why the GPIO_PULLUP setting does not seem to be effective. 

    Thanks,

    Zhi

     

    Graduate II
    June 21, 2024

    No, again that would suggest it's trying to output a LOW state.

    Configure the pin as an INPUT

    If it's still LOW, check what else is wired to that Net.