Problems while flashing onto Samsung Galaxy A40


New member
Nov 14, 2020
Visit site

The last week or so I have been trying to flash TWRP onto my Samsung Galaxy A40 (SM-A405FN) to install LineageOS. However, as I started following different guides and methods I have run into several problems that I can't get around and I was wondering if anyone here has had a similar experience or knows the solution.

The first problem I ran into was that when trying to flash onto the phone, neither ADB nor Fastboot detected the phone in download mode (when it was turned on normally they did). I tried various things to solve it: uninstalling and reinstalling different drivers, trying to find the device in device manager (it wasn't there) and nothing worked. I got around it, however, using Odin to flash. Odin did recognize the phone. I had already unlocked the bootloader and made sure VaultKeeper didn't lock it again. I believe it is fully unlocked now, I have even waited the week period to remove the RMM thing (I'm not entirely sure what it is and if I've done it properly, it's been a while since I've messed with android, but it used to display "KG state: checking" and now it's gone).

So, with Odin recognizing the phone I tried to flash the official TWRP recovery for it, following the instructions on the website. However, after flashing it, the phone bricks and boots into download mode all the time, with the error "Error validating footer (6)" on the top left corner. I have googled far and wide and the only solution I find is to reflash the stock ROM. Of course, this works, but I would like to be able to install LineageOS on the phone.

After doing some more reading, I decided to try with the Magisk method (rooting the system, installing TWRP with the app and then flashing Lineage) but, again, I have run into several problems that I cannot find a solution to on Google nor are they documented. I followed the Magisk guide from the official website and after flashing with Odin the previously patched ROM with the Magisk Manager app, the phone is stuck in download mode with the message "Error verifying vbmeta image HASH_MISMATCH (3)". In the TWRP guide there was a link to a vbmeta image file to flash onto to prevent problems, so I decided to try that, however, since ADB on my computer still doesn't recognize the phone in download mode even after downloading the latest platform tools, several USB drivers and formatting the whole computer, I couldn't flash the vbmeta.img file directly with fastboot, so I transformed it into a tar file to use with Odin. I flashed it and it still got stuck in download mode, but this time with the message "No sign info".
Flashing the stock ROM fixes everything, but of course it doesn't root the system.
Is there anything I can do to solve them? I would also like to solve the ADB issue which I think is causing me a lot of problems in the first place since I can't flash .img files directly, and I have no idea why it's happening.

Thanks in advance and please let me know if you need more information or any pictures.