How to load BW16 program with Arduino

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

謝謝 Alphi,用你的方法也成功燒錄了。但是不知道你有沒有遇到 “AT Command 聯網時模組會自動reset” 的情況呢?我和 @xidameng 都遇到過,不知道是模組的質量問題還是什麽?

看起來是FT232RL 輸出3.3V 驅動電流不夠. 其規格書上寫3.3V Vout 只有50mA 輸出.
建議不要用其他模塊IC內建輸出的3.3V給BW16.除非是電源模組
直接用5V + LDO 輸出3.3V

USB (4.75V~5.25V)-> LDO (3.3V) → BW16 (VCC)

2 Likes

如果我直接從 USB 5v 接到板子上,然後再放一個 5->3v3的 voltage regulator

這樣可以解決問題嗎?

這樣應該是ok , 我就是類似作法

1 Like

Alphi_Jiang,
I wasted a LOT of time,trying to get these modules BW16 , (B & T rtlduino),to take an upload. Finally figured it out,after much researching these forums. Until you get an actual succesful upload to device,you never really know what you should be seeing.
The ‘upload sequence’ is even kind of tricky trying to get the correct sequence,and even know the correct sequence it fails if the thiming isnt right with you relase the RST & BURN momentary buttons.

3 Likes

Yes, the release time of the reset and burn buttons is very important in determining whether to enter download mode.

@Alphi_Jiang Do you think there is a chance to simulate these button pressing operation with electric signal? with the help of TTL to USB module or some BJT/MOSFET?