Power Mac G5 2005 boots with flashing question mark
More than likely the hard drive in the upper bay is failing.


Failing hard drives often make loud clicking sounds.  It's not as common, but is far from uncommon to hear beep error tones from failing hard drives as well.
The gray screen with an flashing folder icon occurs when the Mac cannot find a valid OS X system to boot to.  This can be a result of a badly corrupted operating system (often resulting from impending hard drive failure), a failed hard drive or a new unformatted hard drive.
The AHT error code more than likely stands for SATA Function or something similar, and since it references "upper" I would interpret that as the upper of two items.  Depending on your G5 PowerMac you might have dual processors but these are usually referred to as A or B and would throw a CPU error rather than STF.  Since there are two drive bays, where the two SATA disks are aligned vertically, I would interpret the error as meaning the upper disk is having the problem.



To diagnose the issue you could try this...


Power your Mac on while holding command+V (Apple + V if an older keyboard).
Assuming the disk isn't completely failed this should boot the Mac in verbose mode, where you can read what is occurring as the Mac is attempting to boot.
I would be on the lookout for "Disk I/O" errors, these will indicate a hardware failure with the hard drive itself.  If the Mac doesn't boot to verbose mode and instead only shows the flashing folder icon again then I would again assume a hardware failure.  With AHT (the diagnostic you ran) already reporting an error this is likely the scenario.




More than likely replacing the startup disk WILL fix the issue.  Most any 3.5" SATA disk will work although I would keep it relatively small (less than 250GB) as some of the earlier PowerMac G5s had firmware limitations on hard drive capacity.  You will need to partition/format the disk using "Apple Partition Map" and re-install Mac OS X.

Hope that helps!