HELP- 600 f4i stalls then won't restart
I replaced my battery last year, had the battery on a trickle charger over the winter, started up and rode the other day. Stopped to get gas and barely started back up, got down the road and stopped again, wouldn't restart, the fuel pump primed but just made a rapid clicking sound, wouldn't turn over. Today I rode it for 20 minutes and it stalled out while sitting in neutral at a light. Then it wouldn't not restart, making the same clicking noise. Then I lost all power to the dash, a couple seconds later it came back on then cut out. Pop started it and rode it to my house, checked the battery while no power and had 12.5 volts, when running it was 14.1. I've also checked the stator which came back fine. I cleaned the terminals on starter relay and battery terminals. Still stalling out and won't restart, it's an intermittent problem. Any suggestions would be appreciated.