Thank you for contacting Cypress Community Forum. Please send us the screen shot of the failure and all the steps you are issuing for the erase.
Thanks for the screenshot. The log says that "Erased 64 sectors" so erase is working.
I have some questions and requests below.
1) Full part number of the Flash like S29GL512N11FFI010
2) You said "it was working ok initially...". Does it mean you could erase/program several times or just one time?
3) Could you run the "md" command to check if the Flash is really erased after erase command (Flash content should be all 0xFF)
4) Could you run the "cmp" to check where the "cp.b" command stopped
Thanks for the info. Your md command result shows that the device is in ID-CFI read mode instead of main Flash array read mode. I think U-Boot issues ID/ CFI entry command and then read device IDs to identify the Flash. To return to the main Flash array, Reset or Exit command is required. Please make sure your Flash driver in U-Boot issues Reset/Exit after reading device IDs.