Update: The Windows version of this firmware update is now available (formerly only the Mac version was available).
Important Update (thanks Andy): "For the following post that you made, I just wanted to make sure you're aware that a lot of people are having issues updating their firmware. It would update and then get stuck at around 66% or sometimes even jumps to close to 3000% and hang. Users have no choice but to remove the battery and then try again but it would constantly fail and brick the lens. The solution to this is to clear all the registered batteries from the camera and to try and update with a full battery. Not sure why this is but it's been working for a lot of people, including me."
Here is a forum post discussing the Canon EF 40mm f/2.8 STM Lens firmware update problem.
Canon EF 40mm f/2.8 STM Lens firmware v1.2.0 is now available for download.
Firmware Version 1.2.0 addresses the following phenomenon
1. 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.
A Canon EOS-1D X, 5D III (at v1.1.3 or later) or a Rebel T4i/650D is needed to install the upgrade. Alternatively, the lens can be sent to Canon Service to have the firmware upgrade installed.
How to determine if this firmware update is needed:
If the third digit in the EF 40mm STM Lens serial number is a 0, 1 or 2, the firmware update is needed:
xx0xxxxxxx, xx1xxxxxxx, xx2xxxxxxx
Otherwise, firmware version 1.2.0 or later has already been installed in the lens.