A communication apparatus to which a battery can be detachably attached, the communication apparatus comprising: detection means configured to detect whether or not the battery is attached; setting means configured to set the communication apparatus to an on state or an off state; storage means configured to store firmware; first communication means that includes memory means (104, 105) different from the storage means and configured to hold the firmware, and the first communication means being configured to communicate with an external apparatus by executing the firmware held in the memory means; and transfer means configured to transfer the firmware stored in the storage means to the first communication means for holding in the memory means and power control means configured to control power supply to units of the communication apparatus from the battery; wherein the power control means is further configured to control power supply to the units of the communication apparatus from the battery in accordance with the on state or the off state set by the setting means, and is further configured to perform control such that power is supplied to at least a part of the units of the communication apparatus including the detection means, the storage means, the first communication means, and the transfer means in a case where the communication apparatus is set to the off state, and wherein, in the case that the detection means detects that the battery is attached, even in a case that the communication apparatus is set to the off state by the setting means, the power control means supplies power to the transfer means, and the transfer means is able to execute the transfer of the firmware. detection means configured to detect whether or not the battery is attached; setting means configured to set the communication apparatus to an on state or an off state; storage means configured to store firmware; first communication means that includes memory means (104, 105) different from the storage means and configured to hold the firmware, and the first communication means being configured to communicate with an external apparatus by executing the firmware held in the memory means; and transfer means configured to transfer the firmware stored in the storage means to the first communication means for holding in the memory means and power control means configured to control power supply to units of the communication apparatus from the battery; wherein the power control means is further configured to control power supply to the units of the communication apparatus from the battery in accordance with the on state or the off state set by the setting means, and is further configured to perform control such that power is supplied to at least a part of the units of the communication apparatus including the detection means, the storage means, the first communication means, and the transfer means in a case where the communication apparatus is set to the off state, and wherein, in the case that the detection means detects that the battery is attached, even in a case that the communication apparatus is set to the off state by the setting means, the power control means supplies power to the transfer means, and the transfer means is able to execute the transfer of the firmware.