Skip to main content
Visitor II
February 7, 2024
Question

STM32U599 PA11 as input

  • February 7, 2024
  • 4 replies
  • 1977 views

Hey,

I have a U599 and would like to use the PA11 pin as an input with a pull-up. I've set the CR1_FORCE_USBPWR, USBPWREN, and VDD11USBDIS bits. However, the pull-up voltage only reaches 1.21V in this configuration. The pin works fine as an output.

 

 /* USER CODE BEGIN SysInit */
 SET_BIT(PWR->CR1 , PWR_CR1_FORCE_USBPWR);
 SET_BIT(PWR->VOSR , PWR_VOSR_USBPWREN);
 SET_BIT(PWR->VOSR , PWR_VOSR_VDD11USBDIS);
 /* USER CODE END SysInit */

 /* Initialize all configured peripherals */
 MX_GPIO_Init();
.
.

 

    This topic has been closed for replies.

    4 replies

    Explorer II
    February 7, 2024

    Hi,the same question happened at U595.If you have solved this problem, please let me know.

    But I got the pull-up voltage only 0.2V...:flushed_face: 

    Graduate
    February 7, 2024

    What happens if you remove al the code related to USB and PWR and leave just the GPIO programming?

    AGeis.4Author
    Visitor II
    February 7, 2024

    then the voltage only goes up to 0.7V.

    AGeis.4Author
    Visitor II
    February 7, 2024

    .

    ST Employee
    February 7, 2024

    Hello @AGeis.4

    Could you give us more information about the USB config when it was enabled?

    I'm asking this because suspect that this is related to the limitation when USB is enabled (OTG_GCCFG.PWRDWN=1) the GPIO pin with the OTGx_ID function enables an internal pull-up for ID pin detection and when that function is no anymore required and you want to re-program it as GPIO, this will not disable the “ID” pull-up already described and this could corrupt the expected level.  

    AGeis.4Author
    Visitor II
    February 7, 2024

    USB is not activated

    Screenshot 2024-02-07 113733.png