Run the following command:
sudo update-grub2
For x86, check whether ttyS0 is contained in the file. For ARM64, check whether ttyAMA0 is contained in the file. If they are not, add them.