Can't upload to raspberry pi pico

I’m trying to upload to a Raspberry pi pico, but keep getting [upload] Error 1. I have checked that I am using the correct port, and tried uploading with pio run -t upload. This is what my platformio.ini file looks like:

[env:pico]
platform = raspberrypi
board = pico
framework = arduino
upload_protocol = picotool

Have you used Zadig on the Pico in BOOTSEL mode? See here.

thank you! It managed to upload when I held in the bootsel button when plugging it in to the pc