If the screen is freezing, turning black, then going to back to normal. It almost sounds like what happens when you install the graphics drivers. You always get screen flashes and a black screen during this.
I would start by reinstalling the chipset driver for your board first then after that reinstall the graphics drivers for the 5700G. This time when you reinstall it, instead of using the auto detect. Try installing the driver version 21.6.1. It can be found on the same site here: https://www.amd.com/en/support/apu/amd-ryzen-processors/amd-ryzen-7-5000-g-series-desktop-processors-radeon-graphics/amd
After doing this then restarting the PC, it should resolve the issue for you. Let us know the results.
When was the RAM purchased? If purchased from us, it can be returned within 30 days of purchase.
Submit photos and a description of your PC to our build showcase
See other custom PC builds and get some ideas for what can be done
Services starting at $149.99