Raspberry Pi 

How to use GPIO pins with external module AND internal bluetooth interface (tested with Raspberry Pi Zero W)

 

raspi-config 

Run raspi-config and enable the hardware serial. In the current version as of May 2020 you will find this setting under:

5 - Interface options
P6 - Serial

Answer the questions as:
- Would you like a login shell to be accessible over serial: NO
- Would you like the serial port hardware to be enabled: YES

 

/boot/cmdline.txt

remove console=serial0,115200

Example result:

console=tty1 root=PARTUUID=738a4d67-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

 

/boot/config.txt

dtoverlay=pi3-miniuart-bt
enable_uart=1
# requires a static CPU frequency
# use force_turbo=1 for 400Mhz or core_freq=250 for 250Mhz
core_freq=250

 

Optional

If bluetooth isn't installed yet, run:

sudo apt-get install pi-bluetooth