User 6.xx and Danish, thank you very much for your replies. Yes, I think exactly about possible corruption of the variable to which uwTick is reading. I am very new in ARM (all my previous experience is about PIC and MSP430). So, I got some further q...
Thank you for your answer. No, I really do not know such IDE. But in STMCubeIDE description page there is a statement :"STM32CubeIDE integrates all STM32CubeMX functionalities".