# How to upload code on Raspberry Pi Zero W

**URL:** <https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768>\
**Category:** Uploading\
**Created:** [August 30, 2023, 9:32pm UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768 "2023-08-30T21:32:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mercala\_eng](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@mercala\_eng](https://forum.arduino.cc/u/mercala_eng)\
**Post date:** [August 30, 2023, 9:32pm UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/1 "2023-08-30T21:32:12Z")

</div>

How can I upload code on Raspberry Pi Zero W by using Arduino IDE?  
I choose the board from the board manager(Raspberry Pi Pico W), but I got on this error:

> Resetting COM6  
> Converting to uf2, output size: 173056, start address: 0x2000  
> Scanning for RP2040 devices  
> No drive to deploy.  
> An error occurred while uploading the sketch

---

<div class="post-metadata">

**Author:** ![westfw](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/westfw/32/213443_2.png) [@westfw](https://forum.arduino.cc/u/westfw)\
**Post date:** [August 30, 2023, 10:40pm UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/2 "2023-08-30T22:40:52Z")

</div>

The first time you load Arduino SW onto an RPi Pico (W or otherwise), you need to manually put the board in bootloader mode by holding down the "bootsel" button as you plug the board into the USB port.  
(after that, the sketches will have code that responds to the "Resetting COM6" procedure, and uploads should work automatically.)

---

<div class="post-metadata">

**Author:** ![mercala\_eng](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@mercala\_eng](https://forum.arduino.cc/u/mercala_eng)\
**Post date:** [August 31, 2023, 11:02am UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/3 "2023-08-31T11:02:29Z")

</div>

Where should I found the bootsel with RPi Pico W? there is no button in this board.

---

<div class="post-metadata">

**Author:** ![mercala\_eng](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@mercala\_eng](https://forum.arduino.cc/u/mercala_eng)\
**Post date:** [August 31, 2023, 11:07am UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/4 "2023-08-31T11:07:28Z")

</div>

I cannot select the port because it's hidden!

---

<div class="post-metadata">

**Author:** ![EmilyJane](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/emilyjane/32/821537_2.png) [@EmilyJane](https://forum.arduino.cc/u/EmilyJane)\
**Post date:** [August 31, 2023, 11:21am UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/5 "2023-08-31T11:21:42Z")

</div>

![IMG_0852](https://europe1.discourse-cdn.com/arduino/original/4X/0/2/b/02b42fb06024d156054cbef39a9ab67f9bb11699.jpeg)  
Top right labeled “BOOTSEL”

---

<div class="post-metadata">

**Author:** ![mercala\_eng](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@mercala\_eng](https://forum.arduino.cc/u/mercala_eng)\
**Post date:** [August 31, 2023, 11:26am UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/6 "2023-08-31T11:26:46Z")

</div>

So sorry, my board is Raspberry Pi Zero W  
not Raspberry Pi pico.

> **[Buy a Raspberry Pi Zero W – Raspberry Pi](https://www.raspberrypi.com/products/raspberry-pi-zero-w/)**
>
> The Raspberry Pi Zero W extends the Pi Zero family and comes with added wireless LAN and Bluetooth connectivity.

---

<div class="post-metadata">

**Author:** ![EmilyJane](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/emilyjane/32/821537_2.png) [@EmilyJane](https://forum.arduino.cc/u/EmilyJane)\
**Post date:** [August 31, 2023, 11:28am UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/7 "2023-08-31T11:28:25Z")

</div>

I don’t think there is an Arduino core for that board. You can program it in C++ though.

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [August 31, 2023, 12:01pm UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/9 "2023-08-31T12:01:49Z")

</div>

> [@EmilyJane](#):
>
> I don’t think there is an Arduino core for that board

There is this one, but I've never tried it so I can't say how useful it is (the creator me-no-dev is very talented though):

> **[GitHub - me-no-dev/RasPiArduino: Arduino Framework for RaspberryPI](https://github.com/me-no-dev/RasPiArduino)**
>
> Arduino Framework for RaspberryPI. Contribute to me-no-dev/RasPiArduino development by creating an account on GitHub.

Even though it is not formally documented, it does supposedly have support for the RPi Zero W:

> <https://github.com/me-no-dev/RasPiArduino/pull/69>
>
> See Issue #63 for details.

---

<div class="post-metadata">

**Author:** ![EmilyJane](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/emilyjane/32/821537_2.png) [@EmilyJane](https://forum.arduino.cc/u/EmilyJane)\
**Post date:** [August 31, 2023, 1:45pm UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/10 "2023-08-31T13:45:14Z")

</div>

That’s encouraging. Then I wont give up on my search for MS-DOS that runs on Apple Silicon M3. 🙃

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [August 31, 2023, 2:26pm UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/11 "2023-08-31T14:26:22Z")

</div>

Seems a shame to try to use the Arduino IDE to program a board that runs full blown linux with surprising responsiveness.

I'm currently using the Pi Zero W as the controller for a [DepthAI OAK-D-Lite 3D camera](https://learnopencv.com/introduction-to-opencv-ai-kit-and-depthai/), and find the overall performance pretty astounding.

---

<div class="post-metadata">

**Author:** ![mercala\_eng](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@mercala\_eng](https://forum.arduino.cc/u/mercala_eng)\
**Post date:** [August 31, 2023, 3:01pm UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/12 "2023-08-31T15:01:28Z")

</div>

> [@anon94801460](#):
>
> Seems a shame to try to use the Arduino IDE to program a board that runs full blown linux with surprising responsiveness.
> 
> I'm currently using the Pi Zero W as the controller for a [DepthAI OAK-D-Lite 3D camera](https://learnopencv.com/introduction-to-opencv-ai-kit-and-depthai/), and find the overall performance pretty astounding

I used Arduino IDE with Rpi pico2040 and it works without any problem. but with Pi Zero W I do not have idea how can use it because the board name is not found and when select from the board manager(Raspberry Pi Pico W) the port was hidden !!

How did you use Pi Zero W with arduino ide, please?

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [August 31, 2023, 3:09pm UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/13 "2023-08-31T15:09:21Z")

</div>

> [@mercala\_eng](#):
>
> How did you use Pi Zero W with arduino ide, please?

That seems completely pointless, and I would not try. I use the Pi Zero W running linux, OpenCV and Python for projects.

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [August 31, 2023, 5:35pm UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/14 "2023-08-31T17:35:06Z")

</div>

> [@mercala\_eng](#):
>
> How did you use Pi Zero W with arduino ide, please?

You can do it by using this boards platform:

> **[GitHub - me-no-dev/RasPiArduino: Arduino Framework for RaspberryPI](https://github.com/me-no-dev/RasPiArduino)**
>
> Arduino Framework for RaspberryPI

Read the documentation at the link above to understand how to do that.

But please understand this is a very advanced thing to do. If you are a beginner with Arduino then you are probably going to have a bad time. Buy a more beginner friendly board to get started. I suggest the classic Nano:

[https://docs.arduino.cc/hardware/nano](https://docs.arduino.cc/hardware/nano)

Once you have gained some experience, and if you still think it is interesting to program the RPi Zero W using Arduino IDE, you can circle back to this project.

---

<div class="post-metadata">

**Author:** ![anon92864395](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@anon92864395](https://forum.arduino.cc/u/anon92864395)\
**Post date:** [August 31, 2023, 5:36pm UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/15 "2023-08-31T17:36:40Z")

</div>

> [@EmilyJane](#):
>
> Apple Silicon M3.

M3????

---

<div class="post-metadata">

**Author:** ![mercala\_eng](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@mercala\_eng](https://forum.arduino.cc/u/mercala_eng)\
**Post date:** [August 31, 2023, 7:00pm UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/16 "2023-08-31T19:00:22Z")

</div>

Yes, Iam trying now.

---

<div class="post-metadata">

**Author:** ![mercala\_eng](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@mercala\_eng](https://forum.arduino.cc/u/mercala_eng)\
**Post date:** [September 1, 2023, 7:47am UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/17 "2023-09-01T07:47:59Z")

</div>

In fact I need to use pi zero w because it has SD card and high memory.

I apply the steps in this video [[https://www.youtube.com/watch?v=lZvhtfUlY8Y](https://www.youtube.com/watch?v=lZvhtfUlY8Y)]  
But there is no board name pi zero w in board manager . ☹

([https://www.youtube.com/watch?v=lZvhtfUlY8Y](https://www.youtube.com/watch?v=lZvhtfUlY8Y))

---

<div class="post-metadata">

**Author:** ![mercala\_eng](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@mercala\_eng](https://forum.arduino.cc/u/mercala_eng)\
**Post date:** [September 1, 2023, 7:59am UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/18 "2023-09-01T07:59:37Z")

</div>

Do you have any info where I found wiring.c file?

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [September 1, 2023, 8:08am UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/19 "2023-09-01T08:08:31Z")

</div>

> [@mercala\_eng](#):
>
> I apply the steps in this video [[https://www.youtube.com/watch?v=lZvhtfUlY8Y](https://www.youtube.com/watch?v=lZvhtfUlY8Y)]

Nice find! For the benefit of others reading this, I'll note that this video is specifically about the "RasPiArduino" boards platform I mentioned in my previous reply.

> [@mercala\_eng](#):
>
> But there is no board name pi zero w in board manager

This is expected. They didn't add a separate board definition to the platform when they added support to the platform for the Raspberry Pi Zero W. So you'll need to select the " **RaspberryPI B+/2**" board instead.

> [@mercala\_eng](#):
>
> where I found wiring.c file?

It is here in the GitHub repository:

> <https://github.com/me-no-dev/RasPiArduino/blob/master/cores/piduino/wiring.c>

but it will be installed on your computer along with the rest of the platform under the `cores/piduino/` subfolder of the platform.

---

<div class="post-metadata">

**Author:** ![mercala\_eng](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@mercala\_eng](https://forum.arduino.cc/u/mercala_eng)\
**Post date:** [September 1, 2023, 8:22am UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/20 "2023-09-01T08:22:29Z")

</div>

Ok, thanks.  
1- When I select the **RaspberryPI B+/2** the port will be hidden, why?  
2- According to this [link](https://github.com/me-no-dev/RasPiArduino/issues/63#issuecomment-308978708) how can I update the lib " **revision detection lib**" ?  
3- How can I complete this code  
`if (info.model == RPI_MODEL_B_PI_3 || info.model == RPI_MODEL_B_PI_2 || info.model == RPI_MODEL_ZERO || info.model == RPI_MODEL_ZERO_W) {`

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [September 1, 2023, 8:31am UTC](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768/21 "2023-09-01T08:31:56Z")

</div>

> [@mercala\_eng](#):
>
> how can I update the lib " **revision detection lib**" ?

You don't need to because it was already done:

> <https://github.com/me-no-dev/RasPiArduino/commit/57c55abf42b089301d0e1620376c3f001ed24ae2>

> [@mercala\_eng](#):
>
> How can I complete this code  
> `if (info.model == RPI_MODEL_B_PI_3 || info.model == RPI_MODEL_B_PI_2 || info.model == RPI_MODEL_ZERO || info.model == RPI_MODEL_ZERO_W) {`

You don't need to because it was already done:

> <https://github.com/me-no-dev/RasPiArduino/pull/69>
>
> See Issue #63 for details.

[Next page](https://forum.arduino.cc/t/how-to-upload-code-on-raspberry-pi-zero-w/1163768.md?page=2)
