Let's be a bit logical here.
The bike cranks fine, but would not fire. So, it's not the battery.
You either don't get a spark or you don't get fuel. If there was a fuel problem, you would feel a loss of power especially under load or at high rpm. This is not happening, so this is not fuel related.
What's left is - you don't have a spark. Possible reason - your connectors start going bad. Additional evidence supporting this suspicions: 1) you got FI code momentarily; 2) poor connections are prone to pop up when the bike is subjected to vibration and/or heat; 3) your bike is 7 years old and probably has seen it's share of humidity, you probably didn't take your connectors apart for a long time.
Before you know it, you may get an engine dying momentarily while you ride.
So, I would recommend to clean all or most of your connectors. Get a can of contact cleaner and a tube of dialectric grease from an autoparts store. Open every freaking connector on the bike - including the ECU, FI (under the tank), wiring, spark plug connectors, etc. and do the following.
Look in every one of them with a flashlight and see if any grease/oil or other junk got in there. Spray the contact cleaner and let dry (a minute or two -it's drying fast). Lube both connectors with dialectric grease and close them up for good. This will take you a couple of hours, but it's the preventive maintenance time well spent.
Be careful not to break the connectors - some of them are a bit hard to open, so take your time. They were designed to not open easily.
Let us know how it goes.
One more thought, you don't have an alarm with hijack feature installed by any chance, do you? This might cut the ignition. But also because of poor connection.