Try updating your Motherboard BIOS to the latest version and see if that helps. If not then you can have two possible reasons for the CPU not being recognized.
The motherboard is defective or the Processor is defective.
If you can install the Ryzen on another compatible Motherboard and get the same results pretty much indicates a bad Processor. You should also physically check the Processor for any bent or missing pins or physical damage.
Otherwise, I suggest to open a AMD Warranty request and see what they suggest on how to check your Processor to see if it is defective and needs to be RMAed.
If your new Ryzen 7 1700 was purchased new from a Retailer in a box, I would first try to get a replacement from the place you purchased from.
If that fails then I would open a AMD WARRANTY REQUEST online form and RMA the Processor for AMD to check and verify if it is defective and possible replacement from here : AMD Warranty Request Form | AMD
Here is where to get the information to fill out the Warranty request in case you don't have the box: