This started as yet another black screen of death post and I read the other posts where things basically fell into two camps;
- your image is corrupt and reflash.
- your hdmi is not being detected correctly use safe hdmi option.
I spent days reflashing images (different ones for retropie) and they all behaved the same. They would boot the first time, then once I took out the sdcard brought it my Ubuntu computer and added a
wifikeyfile.txt, safely ejected it and put it back into the PI4, I'd get the dreaded black screen of death (without of without a blinking cursor depending on the retropie image I was using).
I also spent days editing the
config.txt and playing with different HDMI options, including forcing safe hdmi. Nothing worked. Every boot would still show a flashing cursor and just sit there.
Something that I noticed when troubleshooting this is that retropie images show no boot logging at all, and I found several posts online with people asking how to completely disable all boot logging. It's that revelation that finally led me to a solution.
In comparing a standard PI image with a retropie image I noticed that the PI boot shows lots of logging (which is what I would expect from Linux). I also noticed that on the standard PI image, after I mounted the SD card in my Ubuntu computer and then re-inserted it on the PI it would do a filesystem check on the SD card. I could see it progressing, slowly, on my 64G card, and it would take about 20 seconds. My retropie image is 256G so my thinking here, is that the flashing cursor or blank screen is the boot process checking my 256G card.