What are you using to cool your 3400g? If you don't have adequate cooling, you are less likely to hit higher boost clocks nor sustain those clocks.
..that also included good air flow in your case. You have to keep your VRM's and memory cool too.
What is the rated speed of your RAM? 3200 would be ideal for your chip. I ran a 3400g in my wife's setup with 4 x 8gb sticks at their rated 3200 speed (ASUS B350 Prime Plus) . I even ran 2 x 16GB 2666 rated stuff at 3200 with her current 5600x (ASRock B550m Phantom Gaming 4).
Updating your BIOS to latest may help with RAM compatibility
AMD recommends "Balanced Mode" for their chips for best performance
Your Asrock A320M HDV R.4 is not the most robust board out there either as far as VRM's and build quality.. of which can come into play with how your CPU and memory performs