Need to get the latest BIOS from the Motherboard's Support Site that supports the new CPU.
Then you are going to need to request a AMD BOOT KIT to flash the new BIOS on your Motherboard. Unable to Boot New Desktop System Configured with AMD 2nd Generation Ryzen™ Desktop Processor, and A... .
In the above link it has a link to AMD RMA form for you to start the process to get a Boot kit: AMD Warranty Request Form
The AMD BOOT KIT provides a Ryzen that the motherboard supports thus you then are able to flash the new BIOS to the version that supports the new Ryzen CPU.
You need BIOS version F22 and up which supports your CPU on your motherboard: GA-AX370-Gaming 5 (rev. 1.0) | Motherboard - GIGABYTE U.S.A.
|AMD||Ryzen 7 2700X||8C/16T||3.7GHz / 4.35GHz||4MB||16MB||N/A||Pinnacle Ridge||12nm||B2||105W||F22|
Your Motherboard also supports Ryzen APU with Vega so the CPU from the AMD BOOT KIT would work on your Motherboard enough for you to update your BIOS to at least Version F22.
If you have any problems from AMD Support, Post here immediately so that one of the AMD Forum's Moderators can take a look at the problem. This User has the same problem with the same CPU on a current thread: Why is the Ryzen 7 2700x not eligible for the boot kit loaner?