Skip to main content
Visitor II
March 25, 2024
Solved

Problem with Pin A11 on STM32U595VJ

  • March 25, 2024
  • 4 replies
  • 3744 views

Hello,

I've migrated an application from STM32L496VG to STM32U595VJ.
Pin A11 is used as capture input TIM1_CH4.
With U5 device the input on PA11 couldn't reach full level at 3.3V. I have the same behavior with 5 MCUs STM32U595VJT6 and PA11 is connected directly with an external comparator output.
Is there any special new function with this pin PA11 (USB stuff) that has to be switched off on U5 series first other than L4 series (e.g. in option bytes)?

 

Here the input level on PA11 (reach only half level 1.6V and doesn't trigger the capture input):

STM32U595VJT6_PA11_NIOSTM32U595VJT6_PA11_NIO

On PA10 (TIM1_CH3) input level is ok and also triggers capture input:

STM32U595VJT6_PA10_IOSTM32U595VJT6_PA10_IO

Thank you in advance for any ideas about this problem!

    This topic has been closed for replies.
    Best answer by SStor

    Finally I've found a solution to configure and use PA11 (and probably also PA12) as normal GPIO (instead USB):

    SET_BIT(PWR->SVMCR, PWR_SVMCR_USV);
    SET_BIT(PWR->VOSR, PWR_VOSR_USBPWREN | PWR_VOSR_VDD11USBDIS);

    It is important to set also the PWR_SVMCR_USV bit (this is not mentioned in reference manual unfortunately :frowning_face:)!

    4 replies

    Graduate
    March 25, 2024

    Looks like port's power is not physically connected or not enabled in PWR->CRx.

    ST Employee
    March 25, 2024

    Hello @SStor ,

    Please note that PA11 and PA12 provide OTG_HS additional functions. There are constraints to use PA11 and PA12 as standard GPIOs or alternate functions. Refer to 10.7.12 USB power management in low-power modes
    (STM32U59x/5Ax/5Fx/5Gx only) in the RM0456 REV 5

    Link : https://www.st.com/resource/en/reference_manual/rm0456-stm32u5-series-armbased-32bit-mcus-stmicroelectronics.pdf

     

    Kind regards,

    Nissrine.

     

     

     

    SStorAuthor
    Visitor II
    March 25, 2024

    Hello @NesrynELMK,

    thank you for your answer!

    I've played with bits in VOSR register (value 0x0027C000), but with no success:

     CLEAR_BIT(PWR->VOSR, (PWR_VOSR_USBPWREN | PWR_VOSR_USBBOOSTEN));
     SET_BIT(PWR->VOSR, PWR_VOSR_VDD11USBDIS);

    I've toggled only the bit PWR_CR1_FORCE_USBPWR from CR1 register in debug mode manually (set and reset), then it was ok and A11 works korrekt as GPIO-AF. But this works only with debugger and not in software unfortunately?!

    I suppose there are further conditions for correct configuration.

    Is there any documentation/example about the exact initialization procedure to use A11/A12 as GPIOs with alternate functions?

    Otherwise there might be anything wrong with used MCU revision X...

     

    ST Employee
    April 5, 2024

    Hello @SStor 

    Can you provide me with a schematic of his board? We're particularly interested in what's on the PA11 and PA12 pins.

    Regards

    Diane

    SStorAuthor
    Visitor II
    April 5, 2024

    Hello @Diane POMABIA,

    PA11 is directly connected with comparator output pin 14 of MAX9144 (4 comp IC), nothing else.
    PA12 is grounded and configured as analog input, because it's not used.

    You can see the hardware connections in attached layout. There are 5 STM32U595 placed on one PCB in total (together in JTAG daisy chain). Same behavior with PA11 input on all devices.

    With previous type STM32L496VG there were no problems with same periperal components and connections (only PB11 has to be replaced due to VCAP now).

    I've attached also the CubeMX configuration file.

    Any ideas are welcome!

    SStorAuthorAnswer
    Visitor II
    April 10, 2024

    Finally I've found a solution to configure and use PA11 (and probably also PA12) as normal GPIO (instead USB):

    SET_BIT(PWR->SVMCR, PWR_SVMCR_USV);
    SET_BIT(PWR->VOSR, PWR_VOSR_USBPWREN | PWR_VOSR_VDD11USBDIS);

    It is important to set also the PWR_SVMCR_USV bit (this is not mentioned in reference manual unfortunately :frowning_face:)!

    Graduate
    November 10, 2024

    Thank you @SStor for sharing this solution, works a treat in my system as well.

    Got stuck with same issue on PA12, I've somehow managed to guess that it was related to the USB, but figuring out how to actually properly set register was out of my skill.