Strange STM32L476RG GPIO behaviour when leaving STOP mode 2. Is it a silicon bug?
I have found the workaround. If I dispable the GPIOA clock just before entering the sleep mode and on exit reenable it everything works fine. Do not know what is causing the problem but the workaround I have found is good enough for me.