After i upload the code into the arduino, i get the notification that the device has disconnected improperly. Eventhought the code get uploaded into the arduino, the arduino will not be identified anymore. The only way to make it identifiable again is to factory-reset the board, following this guide https://docs.arduino.cc/tutorials/nano-rp2040-connect/rp2040-01-technical-reference#forcing-bootloader. Moreover this problem dosen't seem to happen with the arduino IDE.
Make sure the USB cable is not plugged into your Pico. Press the BOOTSEL button and hold it down while plugging the USB cable into the Pico. Once the USB cable is attached, release the BOOTSEL button.
The Pico should enumerate as a storage device named RPI-RP2 on your computer.
Navigate into your build folder. Copy blink.uf2 (unfortunately, copying files from within VS Code does not work--you will have to do it from a file explorer window). Paste the file into the top level of your RPI-RP2 drive.
Then the code should start every time you power up the Pico RP2040.
No problem, yes i tried this and it makes my arduino i identifiable again but the after i upload the code again i get the same problem again. I think i will compile it with platformIO and upload it using the Arduino IDE