How to load BW16 program with Arduino

I bought a RTL8720DN EVB (RTLDunio)
jump PB1 to PA7 and PB2 to PA8
and use Blink example and change the GPIO to PA12 output, but I keep having problems downloading the program.

i make sure enteries download mode

The following message as below
"
All images are sent successfully!
Image tool closed!
Upload Image done.
"

But the program does not seem to load successfully, the LED is not blinking

Arduino : 1.8.13
Arduino SDK: 3.0.9 build20210420
BW16 FW Version: version:v2.4.1,amebaD v6.0a(Aug 14 2019)

did any suggest?

I just tried the same method, it worked normally for me.

did you connect any other circuits to the pins? After reset, can you see the calibration_ok message in the serial monitor?

Dear @wyy
i only jump PB01 to PA07 and PB02 to PA08 and press reset button , i not got calibration_ok message only B&T message


as blew picture is only jump LOG_UART to CH340

Thank you help. but I don’t know why not work normal, other people same as the problem

The B&T message should only appear after reset if the board is still using the default B&T firmware.
after uploading a firmware from Arduino, the clibration_ok message should appear after each reset.

@wyy we try press the reset button again, got B&T message, not got calibration_ok message from LOG_UART port and LP_UART got “AT COMMAND READY”

and tried 5pcs RTLDunio same as the problem…

Is there anything I have not noticed or need to modify RTLDunio hardware?

That seems to be normal behavior for a RTL8720DN with the BW16 firmware.
you need to press and hold the burn/download button, press and release the reset button, then release the burn/download button to put the chip into download mode

@wyy yes, I follow your suggestion, but the same problem, and use logic analyzer capture waveform it’ll seems in download mode?

if not in download mode, why got blew message
"
All images are sent successfully!
Image tool closed!
Upload Image done.
"
shall be print
Uploading…error: Enter Uart Download Mode
Image tool closed!
Upload Image done.

can you try removing the jumper wires, connect an external FTDI to the PA7/PA8 pins, and upload through the external FTDI COM port?

I change use FT232H module to connect PA7 & PA8, same problem.

I am not sure why this is not working.
I have tried both methods of uploading, and both worked for me.
Are there any lights that blink when the FT232H receives UART data from the BW16? If you use a logic analyzer to capture the UART data, the BW16 LOG_UART should output 0x15 repeatedly while waiting for the upload to start.
If you capture the entire upload process, you should also be able to see if there is any data uploaded using the logic analyzer

no any LED flashing in upload process. I will capture waveform again…
from logic analyzer capture TX has send 0x15 (but baudrate is 115200 is right?)

Image 2

yes, baud rate is 115200.

Can you capture the entire image upload process? should be around 10-20 seconds duration. This will help verify if the image upload is sucessful

I capture the upload process waveform, and the upload process only takes 9.84 seconds to finish receiving. and TX stills sending 0x15

last tx data packet

last rx data packet

we try to use DW command to read flash context compare to km4_image2_all.bin, seems not to match

use linkscript 0x0E00000+0x20

seems data not write to SPI flash…

1 Like

I found that I can wash out the B&T factory program through OTA so that I can update the FW through the Ardunio UART process without failing to load it successfully.

我發現透過OTA方式可以將B&T出廠程式洗掉,這樣之後就可以透過Ardunio UART process 去更新FW而不會無法載入成功.

事先準備
請下載ambd_sdk,連結如下
ambd_sdk

step 1:
connect to AP
連接上AP

#ATPN=myAP,12345678

Wait ATPN response OK
等待ATPN 回應OK
#ATPN OK

Step2
use ambd_sdk image_tools generate OTA.bin ,path:
ambd_sdk\tools\AmbaD\Image_tool\image_tool.exe
Ardunio binray file as below
C:%USER%\AppData\Local\Arduino15\packages\realtek\tools\ameba_d_tools\1.0.5\km0_km4_image2.bin

使用ambd_sdk image_tools 產生OTA bin檔,路徑為
ambd_sdk\tools\AmbaD\Image_tool\image_tool.exe, 並將bin3選擇為Ardunio產生的bin檔案
Ardunio 所產生出的Binary File路徑在C:%USER%\AppData\Local\Arduino15\packages\realtek\tools\ameba_d_tools\1.0.5\km0_km4_imag2.bin


select Arduino geneate bin file
選擇Ardunio 產生的bin檔案
select source binary file
選擇來源檔案

press generate button save to binary to download_server directory and rename to ota.bin
點選generate 按鈕將檔案存在download_server資料夾,並且檔名為ota.bin

Step3
BW16 startup OTA process
BW16 開始進行OTA程序
set OTA Server IP & port (ex: 192.168.88.92, port: 8092)
輸入OTA 主機IP (例如我的為192.168.99.92,port: 8092)

#ATSO=192.168.88.92,8082

You can see that the terminal shows OTA status, when OTA finish, please press the reset button again
[可以看到終端機顯示OTA狀態,當完成之後就可以壓Reset 按鈕

Step4

Now we can download the program via UART in Ardunio, but since the RTLDuino USB chip is connected to LP_UART instead of LOG_UART, we need to jump the cable, please refer to the below picture
PB01->PA07
PB02->PA08

現在我們可以在Ardunio下透過UART 下載程式,但是由於RTLDuino USB晶片是接LP_UART而不是LOG_UART所以我們必須要跳線,請參考下圖
PB01->PA07
PB02->PA08

If entries UART download process, first hold the burn button and reset button and then release the reset button and burn button
要進入UART模式,必須先壓Burn 按鈕然後壓著Reset 再放開Reset 在放開Burn 按鈕

3 Likes

謝謝分享!! :+1:

把先全片擦除 然后再下载新的程序 就可以了。

1 Like

也是使用Alphi的方法吗?

看起來是image tools將整個flash清除,不需要透過OTA Tools

我使用你的OTA的方法已經燒錄成功了,看來雖然沒有防護袋,module的質量還是可以的,是我之前用的3D打印底座質量不行,導致接觸不良,所以我這次直接焊接在一起就ok了

2 Likes