When you try to upgrade your iphone from firmware 3.x to iOS 4.0 then you would have the error 3002.
The easiest solution to solve this problem is to use restore instead of upgrade.The restore will do the same thing as upgrade but this error will not come in case of restore.
If you are using windows or mac then you can download the ipsw for your iPhone and then restore by shift restore on windows or alt restore on mac.