You need a cable (D-CAN for 03/2007 and younger or K+CAN for 1996 to 03/2007), BMW EDIABAS and a laptop.

D-CAN Cable + Software + Manual:
K+CAN Cable + Software + Manual:
(These are affiliate links, if you want to buy a cable and want to support me too, than you can click on one of the links to buy it. So I earn a small commission.)

This is a short tutorial showing how to code a useful function in your BMW. The mirrors on your BMW will fold in by pressing the “lock”-button for one second and they will unfold automatically when you open the car. If you don´t want to fold in your mirrors then press the “lock”-button just briefly.

car / Fahrzeug: 2011 BMW E92 335i
module / Steuergerät: NFRM
funktion / Funktion: “ASP_KOMFORT_EINKLAPP” or
(depending on the year and model of the car)
Important: A condition that it works is that the function “KOMFORTSCHLIESSUNG_FB” from the module “CAS” is active.
You can code this function on the same way.

Here another demonstration: