BOOT0 and BOOT1 are used to set the boot mode of STM32:
In general, if we want to use the serial port to download code, we must configure BOOT0 to 1, BOOT1 to 0, and if we want STM32 to press the reset key to start running code, we need to configure BOOT0 to 0, BOOT1 can be set at will.