2024-03-25 06:36 AM - edited 2024-03-26 05:02 AM
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):
On PA10 (TIM1_CH3) input level is ok and also triggers capture input:
Thank you in advance for any ideas about this problem!
Solved! Go to Solution.
2024-04-10 01:52 PM
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:)!
2024-03-25 07:10 AM
Looks like port's power is not physically connected or not enabled in PWR->CRx.
2024-03-25 07:22 AM
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
Kind regards,
Nissrine.
2024-03-25 09:11 AM
Hello @NEL M.1,
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...
2024-04-05 06:50 AM
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
2024-04-05 07:50 AM
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!
2024-04-10 01:52 PM
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:)!