Skip to main content
AGeis.4
Associate II
February 7, 2024
Question

STM32U599 PA11 as input

  • February 7, 2024
  • 4 replies
  • 1978 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();
.
.

 

4 replies

Associate
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: 

gbm
Lead III
February 7, 2024

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

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
AGeis.4
AGeis.4Author
Associate II
February 7, 2024

then the voltage only goes up to 0.7V.

AGeis.4
AGeis.4Author
Associate 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.  

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
AGeis.4
AGeis.4Author
Associate II
February 7, 2024

USB is not activated

Screenshot 2024-02-07 113733.png