STM32CubeMX v4.22 fails to merge L4 v1.8.1 patch with existing L4 v1.8.0 source tree. Instead it creates two distinctive trees, one for v1.8.0 and one for v1.8.1 when they are installed one after another, i.e. when you install v1.8.1 patch on top of existing v1.8.0 tree. Solution is to delete existing v1.8.0 repository entirely and install v1.8.1 from the scratch. I don't know it applies to other patches.