S3 mini Teamwin boot loop I was running Novafusion's LineageOS 14.1 on my Samsung SIII mini but it was slow, so I decided to go back to Android 6.0.1.

I booted into recovery, formatted the cache partition to ext4, but left the data partition in f2fs, flashed Resurrection Remix 6.0.1.

When it booted I got an error "Encryption interrupted… you have to factory reset your phone" and I accepted. But I never enabled encryption on my phone.

Now it is stuck at teamwin logo screen flashing every 5 seconds or so. I can access download mode so:

I tried:


Flashing TWRP recovery using heimdall
Flashing LOS 14.1 using heimdall
Flashing Param.lfs using heimdall (reference https://android.stackexchange.com/a/130061/25234)


Now if I try to boot normally, it gets stuck on the Samsung Galaxy SIIImini logo. If I try booting to recovery I get the same boot loop as before.

Please help.
I'm posting an answer for the benefit of others that might end up in a similar situation.
Download Stock firmware
This was the first hurdle. There are many sites and many versions. Finally I used the firmware from sammobile.com for the gt-I8190 for Italy.
Boot in Download mode
Next step was to boot in download mode by pressing Vol-, HOME and Power until it vibrates. Then release the buttons and connect the USB cable to the PC.
Flash stock firmware
I'm using Linux so I installed heimdall, opened the heimdall GUI and flashed: Kernel (boot.img), Kernel2 (recovery.img), System and Cache. (Windows users would have to install Samsung drivers and ODIN from what I read but never actually used.)
First boot
The first boot informed me of the same problem that the custom ROM had found about encryption of the Data partition and asked for a reset. This time the reset worked perfectly and on the second boot I was presented with the initial setup screen.