Help! I've bought a Creality CR-10S4 and assembled it.

Help! I’ve bought a Creality CR-10S4 and assembled it. However, I’m having major problems with auto-home and bed levelling. Although the 2-wire limit switches all seem to work (they all show open circuit or 5V depending on position), I have a problem with the Y axis. When autohoming the plate will roll back, hit the limit switch, move forwards a few mm then back again. At this point the control unit gets the blue screen of death and becomes unresponsive.

There are similar problems when trying to level the bed.

Am I doing something stupid or is there a problem with the control unit?

Thanks

Martyn