Before updating the bios, enter the bios and go to the M.I.T menu. Go to the Advanced Memory Settings menu and change Memory Timing Mode to Advanced Manual. This will allow you to change memory timings and other settings so you can manually set your ram to 2666 to see if it will work. It may automatically use the timings for that speed programmed into the modules, but for no leave the timings on default or automatic. If 2666 fails, then you should flash the bios to a newer version.
Edit - I would also suggest either resetting the bios by removing the battery or jumping the cmos reset pins or try loading optimized defaults in the bios (F7 key) before flashing the bios.
Flashing the bios is easy and is only a problem if you have a corrupted bios file (not really an issue if you have no hard drive issues) or if the system loses power during the flashing process. Your motherboard has duel bios, so if something goes wrong during the flashing process you should be able to recover without issue and start the flashing process again.
I would recommend starting with Bios F22a before moving on to F22f, if ever. You need a good USB flash drive formatted to FAT32 and you place the bios file directly on the drive. Reboot the system and press the END key on the keyboard when booting to enter the Q-Flash flashing utility.
Follow the instructions on screen to select the bios file (the file should still be named Z170XG5.F22a) and complete the flashing process. After it completes it will either reboot for you or prompt you to reboot. After rebooting, enter the bios and pres F7 on the keyboard to load optimized defaults, then press F10 to save and exit the bios.
Let the system boot to Windows and make sure everything is working fine before rebooting again to enter the bios and enable XMP to see if it works now.