But I don't boot on recovery mode. Whether I press it for a few seconds or two minutes, it stays frozen on the Samsung logo and then the screen goes black and the tablet shuts down.
- IMMEDIATELY the screen goes blank, hold down Home+VolUp+Power.
- Keep holding down until you see the TWRP home page.
The only thing I can think of is that the battery doesn't have enough charge. If the battery's at a very low level but not completely drained, the tab can do as you've described above: show the Samsung splash page for a bit, then just shut down instead of booting.
I tried to change the name of the file .img:
heimdall flash --RECOVERY recovery.img --no-reboot
The name of the file doesn't matter.