Flashing guide:

1. Download and extract a zip file containing your desired firmware.
2. Open Odin Tool.
3. Boot your device in the “Download Mode”:
    Press Volume Down, Power and Home buttons at same time for 5-8 seconds until download mode is active.

4. Connect your device to PC via the USB cable while in download mode.
5. Next, check the “Auto Reboot” and “F. Reset Time” options in Odin Tool.
6. Hit the AP/PDA button then browse and select a tar.md5 file from the extracted folder.
7. Finally press the start button to begin flashing the firmware update on your device.

Samsung M40 Firmware Details

HOME_CSC_OMC_ODM_M405FODM1ASG2_CL16269353_QB24673588_REV00_user_low_ship_MULTI_CERT.tar.md5
CSC_OMC_ODM_M405FODM1ASG2_CL16269353_QB24673588_REV00_user_low_ship_MULTI_CERT.tar.md5
CP_M405FDDU1ASG1_CP13172503_CL16269353_QB24587965_REV00_user_low_ship_MULTI_CERT.tar.md5
BL_M405FDDU1ASG2_CL16269353_QB24673588_REV00_user_low_ship_MULTI_CERT.tar.md5
AP_M405FDDU1ASG2_CL16269353_QB24673588_REV00_user_low_ship_MULTI_CERT_meta_RKEY_OS9.tar.md5

Download Here

Fahim MahmudSamsung Stock RomSamsung Firmware,Samsung Stock RomFlashing guide: 1. Download and extract a zip file containing your desired firmware.2. Open Odin Tool.3. Boot your device in the 'Download Mode':    Press Volume Down, Power and Home buttons at same time for 5-8 seconds until download mode is active. 4. Connect your device...Android Help,Troubleshooting  & Stock Rom