From Canon USA:
To Users of the EF40mm f/2.8 STM Interchangeable Lens for Canon Digital SLR Cameras
Thank you for using Canon products.
It has been confirmed that the autofocusing function of the EF40mm f/2.8 STM lens, which was released in June 2012, may not operate correctly.
The details of this phenomenon are described below. Affected Product
EF40mm f/2.8 STM Phenomenon
If pressure is applied to the lens barrel while the lens is mounted to the camera (pressure can be applied even while attaching the lens cap or while carrying the camera with the lens attached in a bag), the autofocusing function of the lens may stop working.
*This phenomenon does not occur during normal shooting.
*This phenomenon does not result in a malfunction of the lens. Workaround
When the above phenomenon occurs, detach and reattach the lens, or remove and reinsert the camera battery to restore the operations. Market Support
The firmware to address this phenomenon will be available for download in late August, 2012.
Once this firmware is ready, we will make an announcement on our Web site. Support
This information is for residents of the United States and Puerto Rico only. If you do not reside in the USA or Puerto Rico, please contact the Canon Customer Support Center in your region. Note From the Review
This problem does not appear to affect all lenses - I tried to force my 40 STM to create this problem while creating the Canon EF 40mm f/2.8 STM Lens Review
, but could not induce the issue.