# Ambd\_flash\_tool.py find bw16 hardware SER

**URL:** <https://forum.amebaiot.com/t/ambd-flash-tool-py-find-bw16-hardware-ser/699>\
**Category:** SDK\
**Tags:** evb-bw16\
**Created:** [July 31, 2021, 1:45pm UTC](https://forum.amebaiot.com/t/ambd-flash-tool-py-find-bw16-hardware-ser/699 "2021-07-31T13:45:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![brcisna](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@brcisna](https://forum.amebaiot.com/u/brcisna)\
**Post date:** [July 31, 2021, 1:45pm UTC](https://forum.amebaiot.com/t/ambd-flash-tool-py-find-bw16-hardware-ser/699/1 "2021-07-31T13:45:22Z")

</div>

Hello,  
Am trying to use Linux version of the ambd\_flash\_tool.py. Not sure where i actually downloaded this seperate tool at? When I run this with the ‘erase’ command i get the following:

‘python3 ambd\_flash\_tool.py erase  
Sorry, the device you should have is not plugged in.’

So it does appear it is seeing A device,albiet not a WIO terminal hardware #

This flash tool is suppose to be used the WIO terminal for the rtl8720dn module

Here is a snippet of the python code trying to determine if hardware is suitable for flashing:  
def getAllPortInfo():  
return comports(include\_links=False)

def getAvailableBoard():  
for info in getAllPortInfo():  
port, desc, hwid = info  
ii = hwid.find(“VID:PID”)  
#hwid: USB VID:PID=2886:002D SER=4D68990C5337433838202020FF123244 LOCATION=7-3.1.3:1.  
if ii != -1:  
for b in BOARD\_IDS:  
(vid, pid) = b[“info”]  
if vid == hwid[ii + 8: ii + 8 + 4] and pid == hwid[ii + 8 + 5 :ii + 8 + 5 + 4]:  
if b[“isbootloader”] == True :  
return port, True  
else:  
return port, False  
return None, False

def stty(port):

```
if port == None:
    _port, _isbootloader = getAvailableBoard()
    if _port == None:
        print(Fore.RED + "Sorry, the device you should have is not plugged in.")
        sys.exit(1)

```

How can i determine with the hardware ID is of my serial connected B&T BW16 rtlduino board is to modify the python script?  
I have 4 of these so if I trash one,i can still try three more.

Thanks

---

<div class="post-metadata">

**Author:** ![xidameng](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/xidameng/32/18_2.png) [@xidameng](https://forum.amebaiot.com/u/xidameng)\
**Post date:** [August 2, 2021, 6:46am UTC](https://forum.amebaiot.com/t/ambd-flash-tool-py-find-bw16-hardware-ser/699/2 "2021-08-02T06:46:56Z")

</div>

Hi @brcisna  
Apparently, this Python script is maintained by Seeed studio just for their own Wio Terminal product. However, we still can copy the underlying mechinsm, which is elaborated here

> [@\[Resources\] BW16 Troubleshooting Guide](https://forum.amebaiot.com/t/resources-bw16-troubleshooting-guide/678#method-3-use-the-command-to-erase-flash-19):
>
> [中文版](https://forum.amebaiot.com/t/bw16/682) | [English Version](https://forum.amebaiot.com/t/resources-bw16-troubleshooting-guide/678)Content [Introduction](#introduction)[How to upload firmware into BW16](#how-to-upload-firmware-into-bw16)[Required Components](#Required-Components)[Connection](#Connection)[Trigger Module Reset](#Trigger-Module-Reset)[Uploading Solution](#Uploading-Solution)[Method 1: OTA (Over The Air)](#Method-1:OTA "Over The Air")[Method 2: Use AmebaD Image Tool to erase flash](#Method-2:Use-AmebaD-Image-Tool-to-erase-flash.)[Method 3: Use the command to erase flash](#Method-3:Use-the-command-to-erase-flash)[Reference](#Reference)Introduction Here is a troubleshooting guide organized by me, there are 3 methods for solving various issues met by our community while using the RTL8720DN (BW16) based development board. Please provide any feedba…
