前回はFT232RLでは書込出来ず、例にCP210xを手配中と書いたが、Amazonから届いたので支那製CP2104(と書いてある)モジュールを接続して再挑戦してみる。
Amazonで支那製のCP210xモジュールと聞くと悪い予感しかしないのだが今回入手したのはコレ:
https://www.amazon.co.jp/gp/product/B01CYBHM26/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1
(前回の続き)
4.BL808でUARTから書込出来るUSB-serialチップとは
結論から言えば書込出来る様になった。原因は・・・FTDI排除とか?
・書込ログ(上記画面下のログウィンドウを丸コピー)
[22:43:44.444] - EFUSE_CFG
[22:43:44.444] - BOOTHEADER_GROUP0_CFG
[22:43:44.445] - BOOTHEADER_GROUP1_CFG
[22:43:44.462] - Create bootheader using /home/naka/chips/bl808/img_create_mcu/efuse_bootheader_cfg.ini
[22:43:44.463] - Updating data according to </home/naka/chips/bl808/img_create_mcu/efuse_bootheader_cfg.ini[BOOTHEADER_GROUP0_CFG]>
[22:43:44.469] - Created file len:352
[22:43:44.474] - Create bootheader using /home/naka/chips/bl808/img_create_mcu/efuse_bootheader_cfg.ini
[22:43:44.474] - Updating data according to </home/naka/chips/bl808/img_create_mcu/efuse_bootheader_cfg.ini[BOOTHEADER_GROUP1_CFG]>
[22:43:44.480] - Created file len:352
[22:43:44.483] - Create efuse using /home/naka/chips/bl808/img_create_mcu/efuse_bootheader_cfg.ini
[22:43:44.484] - Updating data according to </home/naka/chips/bl808/img_create_mcu/efuse_bootheader_cfg.ini[EFUSE_CFG]>
[22:43:44.490] - Created file len:256
[22:43:44.494] - Image create path: /home/naka/chips/bl808/img_create_mcu
[22:43:44.495] - Config file: /home/naka/chips/bl808/img_create_mcu/img_create_cfg.ini
[22:43:44.498] - Image hash is b'05da438a12bfb83fdf552206806a9762f3f30a81f71ffec2f79ccdc610703d0f'
[22:43:44.514] - Header crc: b'8fc2492a'
[22:43:44.515] - Write flash img
[22:43:44.518] - Image hash is b'f0c5a05c44f63168620636145cc5234044d41f61195d8725f0c63c658abbbe07'
[22:43:44.518] - Header crc: b'bec7dd0d'
[22:43:44.518] - Write flash img
[22:43:44.519] - Encrypt efuse data
[22:43:44.520] - ========= eflash loader config =========
[22:43:44.561] - Version: eflash_loader_v2.4.6
[22:43:44.561] - Program Start
[22:43:44.561] - ========= eflash loader cmd arguments =========
[22:43:44.561] - None
[22:43:44.562] - Config file: /home/naka/chips/bl808/eflash_loader/eflash_loader_cfg.ini
[22:43:44.565] - serial port is /dev/ttyUSB0
[22:43:44.565] - cpu_reset=False
[22:43:44.565] - chiptype: bl808
[22:43:44.565] - ========= Interface is uart =========
[22:43:44.566] - com speed: 2000000
[22:43:44.566] - Bootrom load
[22:43:44.566] - ========= get_boot_info =========
[22:43:44.566] - ========= image get bootinfo =========
[22:43:44.691] - ack is
[22:43:44.692] - Not ack OK
[22:43:44.692] - result:
[22:43:44.964] - tx rx and power off, press the machine!
[22:43:44.966] - cutoff time is 0.05
[22:43:45.016] - power on tx and rx
[22:43:45.926] - reset cnt: 0, reset hold: 0.05, shake hand delay: 0.1
[22:43:45.927] - clean buf
[22:43:45.928] - send sync
[22:43:46.430] - ack is 4f4b
[22:43:46.461] - shake hand success
[22:43:46.964] - data read is b'01000808000000000b14c102b31a35cf0eb457002ff4fb18'
[22:43:46.965] - ========= ChipID: b40ecf351ab3 =========
[22:43:46.965] - Get bootinfo time cost(ms): 2398.869873046875
[22:43:46.965] - clock para file: /home/naka/chips/bl808/efuse_bootheader/clock_para.bin
[22:43:46.966] - change bdrate: 2000000
[22:43:46.966] - Clock PLL set
[22:43:46.966] - clock para:
[22:43:46.967] - 5043464707040000030103000102000201010001010101010a894b86
[22:43:46.970] - Set clock time cost(ms): 4.162109375
[22:43:47.085] - Read mac addr
[22:43:47.087] - macaddr: b40ecf351ab3
[22:43:47.088] - flash set para
[22:43:47.088] - get flash pin cfg from bootinfo: 0x04
[22:43:47.088] - set flash cfg: 14104
[22:43:47.089] - Set flash config
[22:43:47.092] - Set para time cost(ms): 2.62841796875
[22:43:47.092] - ========= flash read jedec ID =========
[22:43:47.093] - Read flash jedec ID
[22:43:47.093] - flash jedec id: ef601800
[22:43:47.094] - Finished
[22:43:47.102] - get flash size: 0x01000000
[22:43:47.102] - Program operation
[22:43:47.103] - Dealing Index 0
[22:43:47.103] - ========= programming chips/bl808/img_create_mcu/bootinfo_group0.bin to 0x00000000
[22:43:47.107] - flash para file: /home/naka/chips/bl808/efuse_bootheader/flash_para.bin
[22:43:47.108] - Set flash config
[22:43:47.112] - Set para time cost(ms): 2.85546875
[22:43:47.112] - ========= flash load =========
[22:43:47.112] - ========= flash erase =========
[22:43:47.113] - Erase flash from 0x0 to 0x663
[22:43:47.145] - Erase time cost(ms): 32.3701171875
[22:43:47.159] - Load 1636/1636 {"progress":100}
[22:43:47.160] - Load 1636/1636 {"progress":100}
[22:43:47.161] - Write check
[22:43:47.164] - Flash load time cost(ms): 17.3720703125
[22:43:47.166] - Finished
[22:43:47.167] - Sha caled by host: 360554e468b873db8152439964a9a0e4530711cc7561cb71d02ac5bcb4de29e1
[22:43:47.167] - xip mode Verify
[22:43:47.171] - Read Sha256/1636
[22:43:47.172] - Flash xip readsha time cost(ms): 3.73681640625
[22:43:47.172] - Finished
[22:43:47.173] - Sha caled by dev: 360554e468b873db8152439964a9a0e4530711cc7561cb71d02ac5bcb4de29e1
[22:43:47.173] - Verify success
[22:43:47.174] - Dealing Index 1
[22:43:47.174] - ========= programming chips/bl808/img_create_mcu/bootinfo_group1.bin to 0x00001000
[22:43:47.181] - flash para file: /home/naka/chips/bl808/efuse_bootheader/flash_para.bin
[22:43:47.182] - Set flash config
[22:43:47.185] - Set para time cost(ms): 2.511474609375
[22:43:47.186] - ========= flash load =========
[22:43:47.186] - ========= flash read =========
[22:43:47.208] - Read 4096/4096
[22:43:47.209] - Flash read time cost(ms): 23.0087890625
[22:43:47.210] - Finished
[22:43:47.210] - ========= flash erase =========
[22:43:47.210] - Erase flash from 0x1000 to 0x115f
[22:43:47.238] - Erase time cost(ms): 27.604736328125
[22:43:47.243] - Load 352/352 {"progress":100}
[22:43:47.245] - Load 352/352 {"progress":100}
[22:43:47.245] - Write check
[22:43:47.246] - Flash load time cost(ms): 5.926025390625
[22:43:47.246] - Finished
[22:43:47.246] - Sha caled by host: e37987ddd7a3b96e92c71647267029ea68114abc05df5d605ff2b54f30f41e90
[22:43:47.247] - xip mode Verify
[22:43:47.251] - Read Sha256/352
[22:43:47.252] - Flash xip readsha time cost(ms): 2.27880859375
[22:43:47.252] - Finished
[22:43:47.253] - Sha caled by dev: e37987ddd7a3b96e92c71647267029ea68114abc05df5d605ff2b54f30f41e90
[22:43:47.253] - Verify success
[22:43:47.255] - Dealing Index 2
[22:43:47.256] - ========= programming chips/bl808/img_create_mcu/img_group0.bin to 0x00002000
[22:43:47.262] - flash para file: /home/naka/chips/bl808/efuse_bootheader/flash_para.bin
[22:43:47.262] - Set flash config
[22:43:47.265] - Set para time cost(ms): 2.45556640625
[22:43:47.265] - ========= flash load =========
[22:43:47.266] - ========= flash erase =========
[22:43:47.266] - Erase flash from 0x2000 to 0xb4ef
[22:43:47.545] - Erase time cost(ms): 278.791259765625
[22:43:47.563] - decompress flash load 21584
[22:43:47.593] - Load 4096/21584 {"progress":18}
[22:43:47.623] - Load 8192/21584 {"progress":37}
[22:43:47.653] - Load 12288/21584 {"progress":56}
[22:43:47.693] - Load 16384/21584 {"progress":75}
[22:43:47.733] - Load 20480/21584 {"progress":94}
[22:43:47.773] - Load 21584/21584 {"progress":100}
[22:43:47.773] - Load 21584/21584 {"progress":100}
[22:43:47.773] - Write check
[22:43:47.793] - Flash load time cost(ms): 246.935546875
[22:43:47.794] - Finished
[22:43:47.795] - Sha caled by host: 05da438a12bfb83fdf552206806a9762f3f30a81f71ffec2f79ccdc610703d0f
[22:43:47.796] - xip mode Verify
[22:43:47.829] - Read Sha256/38128
[22:43:47.829] - Flash xip readsha time cost(ms): 33.141845703125
[22:43:47.830] - Finished
[22:43:47.832] - Sha caled by dev: 05da438a12bfb83fdf552206806a9762f3f30a81f71ffec2f79ccdc610703d0f
[22:43:47.832] - Verify success
[22:43:47.833] - Dealing Index 3
[22:43:47.833] - ========= programming chips/bl808/img_create_mcu/img_group1.bin to 0x00052000
[22:43:47.841] - flash para file: /home/naka/chips/bl808/efuse_bootheader/flash_para.bin
[22:43:47.841] - Set flash config
[22:43:47.844] - Set para time cost(ms): 2.810546875
[22:43:47.845] - ========= flash load =========
[22:43:47.845] - ========= flash erase =========
[22:43:47.845] - Erase flash from 0x52000 to 0x5920f
[22:43:48.067] - Erase time cost(ms): 221.859130859375
[22:43:48.083] - decompress flash load 15244
[22:43:48.113] - Load 4096/15244 {"progress":26}
[22:43:48.143] - Load 8192/15244 {"progress":53}
[22:43:48.183] - Load 12288/15244 {"progress":80}
[22:43:48.223] - Load 15244/15244 {"progress":100}
[22:43:48.225] - Load 15244/15244 {"progress":100}
[22:43:48.225] - Write check
[22:43:48.262] - Flash load time cost(ms): 193.56591796875
[22:43:48.262] - Finished
[22:43:48.264] - Sha caled by host: f0c5a05c44f63168620636145cc5234044d41f61195d8725f0c63c658abbbe07
[22:43:48.264] - xip mode Verify
[22:43:48.290] - Read Sha256/29200
[22:43:48.291] - Flash xip readsha time cost(ms): 25.617431640625
[22:43:48.291] - Finished
[22:43:48.292] - Sha caled by dev: f0c5a05c44f63168620636145cc5234044d41f61195d8725f0c63c658abbbe07
[22:43:48.292] - Verify success
[22:43:48.293] - Program Finished
[22:43:48.293] - All time cost(ms): 3731.968017578125
[22:43:48.404] - close interface
[22:43:48.404] - [All Success]
ログ時間の[22:43:46.461] - shake hand success とログられている。手順を反芻するに:
a.USB-serialをFT232RLからCP2104に変更
b.CP2104のRXDをBL808のuart0-txd(BL808のpin1),CP2104のTXDをBL808のuart0-rxd(BL808のpin2)に接続、CP2104のGNDをBL808のGND(pin3)に接続
c.BL808のbootボタンを押下しながら電源Onし、Bootモードに遷移させる
d.BL社の書込ツール(上記)を sudo ./BLDevCube-ubuntu 等で起動
で良いみたいです。上記でファームウェア書込を行ったので次はlinux kernelで
分かりにくいがファームウェアはMCUタブ、Linux kernelはIOTタブで行う。kerenel書込ログは多いので省略(ファームウェア書込が出来ればカーネルも大丈夫そうなので)。
5.書き込めたのは良いのだが
さあ、これでlinux kernel起動と思いきや、マニュアルに以下の記載が:
The default burn-in port will output logs related to E907 operations (UART0:
IO14 TX, IO15 RX); logs for Linux kernel operations and shell terminals will be
output via UART3 (IO5 RX, IO8 TX); the terminal is shown below after kernel
boot.
あのぉ〜、BL808のpinoutにIO5,IO8って無いのですが。。。例のYouTubeを見直したらMicroSDカードからBootしてIO16,17にシリアルポートを接続するらしいのだが。
MicroSDのイメージ何処にあるんだっけか? outファイルにそれらしき物は見当たらない気が、別の処でゲットしたbuildrootは失敗したし、今度はuSDのイメージかrootfs環境(まあ、buildroot的な)を探さねばと言うことで次回に続く(時期未定)。。。