Welcome to IoTForums.com Community
Register now to participate in discussions, ask questions and share your knowledge on internet of things and automation! Feel free to sign up today.
Register Now

Modules [Resources] BW16 Troubleshooting Guide (3)

Dakamaster

Just Hatched
May 10, 2021
13
1
11
Singapore
Note:
Original post in AmebaIoT Forum:
Please, Log in or Register to view URLs content!

Click here for
[Resources] BW16 Troubleshooting Guide (1)
Click here for[Resources] BW16 Troubleshooting Guide (2)


Content

Method 2: Use AmebaD Image Tool to erase flash
Alternatively, without using OTA that only allows the module upload program after connecting to Wi-Fi. Another way is using Image Tool to erase the flash image memory starting from memory address: 0x8000_0000 till the end of 2MB memory location, later on, we need to upload Realtek’s image back to the module again using Arduino IDE.



Please, Log in or Register to view URLs content!



Follow Method 1 Step 1 to download ambd_sdk and do the necessary setup preparation before moving on to using this method.

Step 1 - Open Image Tool
Set the Baudrate to “115200”, then select the Flash Erase range from Memory Address of 0x0800 0000, with a specific address of 2MB (2048 KB). Set the module or development board to “Download mode”, then click the Erase button.



Please, Log in or Register to view URLs content!



Upon finishing the above image erase, and press the reset button, we could find that the #calibration will no longer pop out, only # will appear.

Please, Log in or Register to view URLs content!



Step 2 - Download Image using Arduino IDE
Download the Arduino program following the instruction in Method 1 Step 5, the image will be installed back again.

Special thanks to
Please, Log in or Register to view URLs content!
who tabulated documentation of this method in Traditional Chinese which can be found in this link:
Please, Log in or Register to view URLs content!
Method 3: Use the command to erase flash.
Since Realtek’s Amebad Image Tool is designated for Windows Systems. For users using other Operating Systems, please refer to
Please, Log in or Register to view URLs content!
's method provided in this link:
Please, Log in or Register to view URLs content!


which is a simplified version of Method 2. He suggested using the command to execute the erase and upload of an image instead of executing the “amebad_image_tool.exe”.
I haven’t tested out for this method, anyone who has tried this method could share his/her experience in the comment below.

Step1 - Create a folder that contains the following files
2-14


Step2 - Generate a 2M file size of km0_km4_image2.bin
You have to generate a 2M file size of km0_km4_image2.bin to replace the original file. and then use ambad_image_tool. For example:
$ambed_image_tools /dev/ttyUSB0

Please, Log in or Register to view URLs content!
has attached a python script to generate the 2M file for reference:

========================== gen_bin.py ===========================================

Python:
# -*- coding: UTF-8 -*-

import sys

import os

def main():

    if len(sys.argv) < 4 :

        print('gen.py <file> <size> <pat>')

        print('example: gen.py km0_km4_image2.bin 200000 ff')

        sys.exit(1)

    else:

        target_name = sys.argv[1]

        target_size = int(sys.argv[2],base=16)

        target_pat  = int(sys.argv[3],base=16)

       

        print('name: {0} size: {1} pat: {2}'.format(target_name,target_size,target_pat))

        with open(sys.argv[1],"wb") as file:

            buff = [target_pat]*target_size

            target_context = bytearray(buff)  

            file.write(target_context)

            file.close()

   

if __name__ == '__main__':

    main()
Step 3 – Execute Command “amebad_image_tool.exe COM_PORT_NUM”
2-15


References
  1. For more information, please visit the following websites:
  2. Since RTL8720DN BW16 is not officially supported by Realtek, alternatively if you want to know more about our AmebaD Family (RTL8722DM & RTL8722DM-MINI) and ambd_arduino opensource SDK, please also visit:
    • AmebaIoT official website:
      Please, Log in or Register to view URLs content!
      for more examples supported;
    • Join our FB Forum (English version) to further discuss with us:
      Please, Log in or Register to view URLs content!
      ;
  3. If you would like to know more about the BW16 development board, please refer to the websites below:
    1. Introduction of RTL8720DN on Instructable:
      Please, Log in or Register to view URLs content!
    2. Load Arduino image into BW16:
      Please, Log in or Register to view URLs content!
    3. RTL8720DN (BW16) IMG2 SIGN Invalid Solution:
      Please, Log in or Register to view URLs content!
    4. B&T “RTL8720D AT Command User Manual”:
      Please, Log in or Register to view URLs content!
    5. FTDI Driver Download from here:
      Please, Log in or Register to view URLs content!
 

Log in

or Log in using