cancel
Showing results for 
Search instead for 
Did you mean: 

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

ZhiFeng
Associate II

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
 
4 REPLIES 4

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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

 

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hi,

Because this pin is the IO2 pin on the Quad SPI bus, I can't configure it as INPUT, right? It is supposed to be an I/O pin. 

Thanks,

Zhi