# Upload program from openmv Board to PC

**URL:** <https://forums.openmv.io/t/upload-program-from-openmv-board-to-pc/1559>\
**Category:** OpenMV Boards\
**Created:** [January 5, 2020, 7:55am UTC](https://forums.openmv.io/t/upload-program-from-openmv-board-to-pc/1559 "2020-01-05T07:55:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![huucuong0890](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@huucuong0890](https://forums.openmv.io/u/huucuong0890)\
**Post date:** [January 5, 2020, 7:55am UTC](https://forums.openmv.io/t/upload-program-from-openmv-board-to-pc/1559/1 "2020-01-05T07:55:42Z")

</div>

Hi everyone, I use OpenMV H7 On my company project.  
I have some question for OpenMV: **How upload program from openmv Board to PC?**  
Because at current i don’t have original code for current OpenMV board, i want to get code from board to modify program instead of have to build new code for this project.

Thanks & Best Regard!

---

<div class="post-metadata">

**Author:** ![iabdalkader](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/iabdalkader/32/1169_2.png) [@iabdalkader](https://forums.openmv.io/u/iabdalkader)\
**Post date:** [January 5, 2020, 10:34am UTC](https://forums.openmv.io/t/upload-program-from-openmv-board-to-pc/1559/2 "2020-01-05T10:34:11Z")

</div>

Do you mean the running script ? You can copy main.py from the camera.

---

<div class="post-metadata">

**Author:** ![huucuong0890](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@huucuong0890](https://forums.openmv.io/u/huucuong0890)\
**Post date:** [January 5, 2020, 1:09pm UTC](https://forums.openmv.io/t/upload-program-from-openmv-board-to-pc/1559/3 "2020-01-05T13:09:43Z")

</div>

Hi You,  
My mean: At my company have a machine using OpenMV H7 Board to detect color of production. And at current the OpenMV H7 Board for this machine was not stable and need to replace new. So i bought new the OpenMV H7 Board to replace and i intended that upload code of old the OpenMV H7 Board and download this code for new the OpenMV H7 Board.  
**But i don’t know how to upload the code from old the OpenMV H7 Board.**  
Could you please advise for me,

Thanks & best regard,

---

<div class="post-metadata">

**Author:** ![iabdalkader](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/iabdalkader/32/1169_2.png) [@iabdalkader](https://forums.openmv.io/u/iabdalkader)\
**Post date:** [January 5, 2020, 2:29pm UTC](https://forums.openmv.io/t/upload-program-from-openmv-board-to-pc/1559/4 "2020-01-05T14:29:40Z")

</div>

Which code ? If you want the Python code, copy main.py. If you want the C/firmware you could use dfu-util or a debugger to read the flash, please google how to do that.

---

<div class="post-metadata">

**Author:** ![huucuong0890](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@huucuong0890](https://forums.openmv.io/u/huucuong0890)\
**Post date:** [January 7, 2020, 2:49pm UTC](https://forums.openmv.io/t/upload-program-from-openmv-board-to-pc/1559/5 "2020-01-07T14:49:32Z")

</div>

H You,  
Yes, i want the Python code. Follow with your instruction, i already copy main.py in old Openmv board (that is running with color detection application) and i open file main.py with OpenMV IDE. But may be the file main.py is not true, becasue it not suitable with color detection application.  
This is code in main.py, could you please check:  
_# main.py – put your code here!  
import pyb, time  
led = pyb.LED(3)  
usb = pyb.USB\_VCP()  
while (usb.isconnected()==False):  
led.on()  
time.sleep(150)  
led.off()  
time.sleep(100)  
led.on()  
time.sleep(150)  
led.off()  
time.sleep(600)_

---

<div class="post-metadata">

**Author:** ![iabdalkader](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/iabdalkader/32/1169_2.png) [@iabdalkader](https://forums.openmv.io/u/iabdalkader)\
**Post date:** [January 7, 2020, 3:21pm UTC](https://forums.openmv.io/t/upload-program-from-openmv-board-to-pc/1559/6 "2020-01-07T15:21:59Z")

</div>

Maybe the filesystem was erased, there’s no way to get that code back.

---

<div class="post-metadata">

**Author:** ![huucuong0890](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@huucuong0890](https://forums.openmv.io/u/huucuong0890)\
**Post date:** [January 8, 2020, 2:49pm UTC](https://forums.openmv.io/t/upload-program-from-openmv-board-to-pc/1559/7 "2020-01-08T14:49:58Z")

</div>

Thanks for your support.  
May be i will build a new program.
