You can try to add this to your bootloader entry under options*:
idle=nomwait rcu_nocbs=0-7
This fixed system freezes for me with a R5 2500U.
*I do not remember 100% how to do that in Ubuntu/Debian and Grub. I use systemd-boot, and just put it under “options” in the appropriate loader config file and update.