logo elektroda
logo elektroda
X
logo elektroda

Bouffalo Lab BL616/Ai-Thinker Ai-M62-32S-Kit: OpenBL616

divadiow 132 8
ADVERTISEMENT
  • #1 21880795
    divadiow
    Level 38  
    insmod wrote:
    BL chip detection by bootrom version. BL602 - 1, BL702 - 0x7020001, BL616 - 0x6160001. Not known for BL704/706/618.
    Added BL702 and BL616 read. For some reason BL702 write is not working. Didn't bother to fix it. BL616 will read if BL602 or BL702 is selected and BL616 rom version is detected.


    A little topic on my BL616 experiences and some pics of OpenBL616 (in development, general release disabled) and maybe as a place for any future BL616-specific points.

    BL616/BL618 is Wi-Fi 6 + Bluetooth 5.3 + 802.15.4(Zigbee/Thread) combo chipset for ultra-low-power applications


    Ai-Thinker Ai-M62-32S-Kit from Ali Express
    Bouffalo Lab BL616/Ai-Thinker Ai-M62-32S-Kit: OpenBL616Bouffalo Lab BL616/Ai-Thinker Ai-M62-32S-Kit: OpenBL616

    https://en.ai-thinker.com/pro_view-128.html

    Bouffalo Lab BL616/Ai-Thinker Ai-M62-32S-Kit: OpenBL616



    Easy Flasher dump 4mb
    Bouffalo Lab BL616/Ai-Thinker Ai-M62-32S-Kit: OpenBL616

    boot log 115200
    Code: Text
    Log in, to see the code


    dump + efuse: https://github.com/divadiow/FlashDumps/tree/main/IoT/BL616


    @insmod how are you getting your OpenBL616 to boot? I don't seem to be able to nail the combinations as if AIO or multi-part

    Bouffalo Lab BL616/Ai-Thinker Ai-M62-32S-Kit: OpenBL616
  • ADVERTISEMENT
  • #2 21880816
    insmod
    Level 31  
    >>21880795
    4M partition table, boot2, firmware and dts.
    Not single download.


    SDK needs to be updated to last version to make AP work, but i can't do it (i'm on windows, and there's one bugged commit with trailing whitespace in file name).
    Flasher for BL616 must also be fixed (replace https://github.com/openshwprojects/BK7231GUIF...3/BK7231Flasher/Flashers/BL602Flasher.cs#L390 with real flash setup thingy).
  • ADVERTISEMENT
  • #3 21880831
    divadiow
    Level 38  
    insmod wrote:
    4M partition table, boot2, firmware and dts.
    Not single download.


    yeh, image was last-ditch try single download anyway check.

    boot log currently:
    Code: Text
    Log in, to see the code


    insmod wrote:
    and there's one bugged commit with trailing whitespace in file name).


    where's this? this can be fixed in Windows though surely?

    Added after 6 [minutes]:

    Code: Text
    Log in, to see the code
  • #4 21880851
    insmod
    Level 31  
    >>21880831
    An assert is hit somewhere. Breakpoint -> ebreak, usually called via asserts.
    I'll build a new version to check what mepc points to
    My log
    boot2_lp:0
    r ef:0x2f
    psram:13 
    custom 0x5f
    flash init 0
    Boot2 start:May 29 2024,20:22:19
    Group=1,CPU Count=1
    ver:6.6.2
    user_fw 
    lp_fw not found
    Active PT:0,Age 0
    read mfg flag addr:212000
    entry ID 0 found
    Boot start
    Media boot main
    R header from 10000
    Cal hash addr 0x11000,len 1134400
    Hash Success
    ps_mode 0,efuse hbn_check_sign 0
    group[0] offset 11000 ,core[0] offset 0 bootentry a0000000
    Counter value=98
    dynamic memory init success
      ocram heap size: 242 Kbyte 
    
      ____               __  __      _       _       _     
     |  _ \             / _|/ _|    | |     | |     | |    
     | |_) | ___  _   _| |_| |_ __ _| | ___ | | __ _| |__  
     |  _ < / _ \| | | |  _|  _/ _` | |/ _ \| |/ _` | '_ \ 
     | |_) | (_) | |_| | | | || (_| | | (_) | | (_| | |_) |
     |____/ \___/ \__,_|_| |_| \__,_|_|\___/|_|\__,_|_.__/ 
    
    Build:09:49:09, Mar 31 2026
    Copyright (c) 2022 Bouffalolab team
    Version of used components:
    	Version: component_version_macsw_1.7.10
    	Version: 2025-11-19 0feb8e5
    	Version: component_version_fhost_1.7.10
    	Version: component_version_lhal: 2956644f
    	Version: component_version_sdk: 2.3.19 2956644f
    	Version: component_version_boot2: 6.6.2
    ======== chip info ========
    package          QFN56
    flash_info       EXTERNAL
    psram_info       WB_4MB
    version          A0
    ======== flash cfg ========
    flash clock      40MHz
    flash delay      0,0,0
    flash size       0x00800000
    jedec id         0x1740C8
    mid              0xC8
    iomode           0x04
    clk delay        0x01
    clk invert       0x01
    read reg cmd0    0x05
    read reg cmd1    0x35
    write reg cmd0   0x01
    write reg cmd1   0x31
    qe write len     0x01
    cread support    0x01
    cread code       0x20
    burst wrap cmd   0x77
    ===========================
    uart  sig1:ffffffff, sig2:0000f32f
    clock gen1:9dfffffd, gen2:0fff0c11
    xtal:40000000Hz(crystal)
    board init done
    ===========================
    Active Partition[0] consumed 596 Bytes
    ======= PtTable_Config @0x62fcd71c=======
    magicCode 0x54504642; version 0x0000; entryCnt 8; age 0; crc32 0xE38928F3
    idx  type device active_index     name   Address[0]  Address[1]  Length[0]   Length[1]   age
    [00]  16     0         0        Boot2  0x00000000  0x00000000  0x0000e000  0x00000000  0
    [01]  00     0         0           FW  0x00010000  0x00210000  0x00200000  0x00168000  0
    [02]  10     0         0          mfg  0x00210000  0x00000000  0x00168000  0x00000000  0
    [03]  02     0         0        media  0x00378000  0x00000000  0x00071000  0x00000000  0
    [04]  03     0         0          PSM  0x003e9000  0x00000000  0x00008000  0x00000000  0
    [05]  04     0         0          KEY  0x003f1000  0x00000000  0x00002000  0x00000000  0
    [06]  05     0         0         DATA  0x003f3000  0x00000000  0x00005000  0x00000000  0
    [07]  06     0         0      factory  0x003f8000  0x00000000  0x00008000  0x00000000  0
    [I][rfparam] xtal value 40000000
    [I][rfparam] dcdc_trim value 3
    [I][rfparam] icx value 24
    [I][rfparam] iptat value 20
    [I][rfparam] tmp_mp use default value 35
    [I][rfparam] RF_PARAM TLV ADDRESS: 0xA0000400
    [I][rfparam] pwr_mode is bf
    Empty slot:0
    No written slot found
    [I][rfparam] no pwr_offset in efuse
    [I][rfparam] tlv wlan pwr_offset[14]: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    [I][rfparam] wlan pwr_offset[14]: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    Empty slot:0
    No written slot found
    [I][rfparam] no lp pwr_offset in efuse
    [I][rfparam] tlv wlan lp pwr_offset[14]: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    [I][rfparam] wlan lp pwr_offset[14]: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    Empty slot:0
    No written slot found
    [I][rfparam] no bz pwr_offset in efuse
    [I][rfparam] tlv bz pwr_offset[5]: 0,0,0,0,0,
    [I][rfparam] bz pwr_offset[5]: 0,0,0,0,0,
    [I][rfparam] pwr_11b[4]: 20,20,20,20,
    [I][rfparam] pwr_11g[8]: 18,18,18,18,18,18,16,16,
    [I][rfparam] pwr_11n_ht20[8]: 18,18,18,18,18,16,15,15,
    [I][rfparam] pwr_11n_ht40[8]: 18,18,18,18,18,16,15,14,
    [I][rfparam] pwr_11ac_vht20[10]: 18,18,18,18,18,16,15,15,15,14,
    [I][rfparam] pwr_11ac_vht40[10]: 18,18,18,18,18,16,15,14,14,13,
    [I][rfparam] pwr_11ax_he20[12]: 18,18,18,18,18,16,15,15,15,14,13,13,
    [I][rfparam] pwr_11ax_he40[12]: 18,18,18,18,18,16,15,14,14,13,12,12,
    [I][rfparam] capcode mode is MF
    Empty slot:1
    [I][rfparam] efuse capcode_in 32,capcode_out 32
    [I][rfparam] capcode_in 32,capcode_out 32
    [I][rfparam] tcal.en_tcal = 0
    [I][rfparam] tcal.linear_or_follow = 1
    [I][rfparam] tcal.Tchannels[5]: 2412,2427,2442,2457,2472,
    [I][rfparam] tcal.Tchannel_os[5]: 180,168,163,160,157,
    [I][rfparam] tcal.Tchannel_os_low[5]: 199,186,170,165,160,
    [I][rfparam] tcal.Troom_os = -1
    [I][rfparam] pwr_ble = 13 
    [I][rfparam] pwr_bt[3]: 10,8,8,
    [I][rfparam] pwr_zigbee = 13 
    [I][rfparam] country_code = CN 
    [I][rfparam] en_tcap = 0 
    [I][rfparam] tcap_tsen[10]: -3,-4,20,39,39,40,41,42,43,44,
    [I][rfparam] tcap_cap[11]: 28,29,30,31,32,33,34,35,36,37,38,
    OpenBL616, version bl616_7ce9a5a5e55b
    Entering initLog()...
    Commands registered!
    initLog() done!
    Main_Init_Before_Delay
    [MTD] >>>>>> Hanlde info Dump >>>>>>
          name PSM
          id 0
          offset 0x003e9000(4100096)
          size 0x00008000(32Kbytes)
          xip_addr 0xa03d8000
    [MTD] <<<<<< Hanlde info End <<<<<<
    ENV AREA SIZE 32768, SECTOR NUM 8
    *default_env_size = 0x00000001
    Info:MAIN:Main_Init_Before_Delay
    addr@0xa01020ac is xip flash, size 6
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 4 changes count.
    [MTD] >>>>>> Hanlde info Dump >>>>>>
          name media
          id 0
          offset 0x00378000(3637248)
          size 0x00071000(452Kbytes)
          xip_addr 0xa0367000
    [MTD] <<<<<< Hanlde info End <<<<<<
    Main_Init_Before_Delay done
    Main_Init_Delay
    Main_Init_Delay done
    Info:NTP:CLOCK driver initialized.
    Error:CMD:lfs is absent
    Info:GEN:PIN_SetupPins pins have been set up.
    Info:MAIN:Main_Init_Before_Delay done
    Info:MAIN:Main_Init_Delay
    Info:MAIN:Main_Init_Delay done
    Info:MAIN:Main_Init_After_Delay
    Info:MAIN:Using SSID []
    Info:MAIN:Using Pass []
    Info:HTTP:TCP server listening
    Info:MQTT:MQTT_RegisterCallback called for bT bl616CF392881/ subT bl616CF392881/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT obks/ subT obks/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/bl616CF392881/ subT cmnd/bl616CF392881/+
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/obks/ subT cmnd/obks/+
    Info:MQTT:MQTT_RegisterCallback called for bT bl616CF392881/ subT bl616CF392881/+/get
    Info:MQTT:MQTT_RegisterCallback called for bT homeassistant/ subT homeassistant/+
    Info:CMD:CMD_StartScript: started @startup at the beginning
    Error:CMD:LFS_ReadFile: lfs is absent
    Info:CMD:CMD_StartScript: failed to get file autoexec.bat
    Info:MAIN:Main_Init_After_Delay done
    Info:MAIN:Time 1, idle 18692628/s, free 280476, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0 
    Info:MAIN:Time 2, idle 18777421/s, free 280476, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 0/0 
    


    Added after 4 [minutes]:

    Here
    Attachments:
    • dev_20260410_001910.zip (1.33 MB) You must be logged in to download this attachment.
  • #5 21880855
    divadiow
    Level 38  
    insmod wrote:
    Here

    cheers. same breakpoint thing for me with this. it's not important, just playing.
  • ADVERTISEMENT
  • #6 21880857
    insmod
    Level 31  
    Another try, i've updated SDK via WSL
    Attachments:
    • dev_20260410_002336.zip (1.33 MB) You must be logged in to download this attachment.
  • #7 21880858
    divadiow
    Level 38  
    cheers. breakpoint still though.

    Screenshot of Buffalo Lab Dev Cube 1.9.0 showing flashing settings and a 100% progress bar

    Added after 8 [minutes]:

    I see our hardware differs
    QFN56 / 8 MB flash / 4 MB PSRAM vs QFN40 / 4 MB / no PSRAM
  • ADVERTISEMENT
  • #8 21880867
    insmod
    Level 31  
    It triggers in bflb_gpio_pad_check. Considering that OBK is not yet initialized, SDK side bug?

    Added after 2 [minutes]:

    Here's a build without it

    I'm using BL618, not 616
    Attachments:
    • dev_20260410_004845.zip (1.33 MB) You must be logged in to download this attachment.
  • #9 21880870
    divadiow
    Level 38  
    insmod wrote:
    I'm using BL618, not 616


    ah!

    insmod wrote:
    Here's a build without it


    :)
    Code: Text
    Log in, to see the code


    Added after 1 [minutes]:


    Screenshot of the OpenBL616 panel with Config, Restart, and Launch Web Application buttons

Topic summary

✨ Discussion of Bouffalo Lab BL616/OpenBL616 development on an Ai-Thinker Ai-M62-32S-Kit board, including flash dumps, efuse data, boot logs, and early firmware bring-up. The board is identified as QFN40 with 4 MB flash and no PSRAM, while another tested configuration is noted as QFN56 with 8 MB flash and 4 MB PSRAM. The main issue is a breakpoint/assert failure during boot, traced to bflb_gpio_pad_check before OpenBL616 initialization. Suggested actions include updating the SDK to the latest version, fixing the BL616 flasher flash-setup code, and rebuilding with WSL; after removing the problematic check, boot proceeds further and the chip reports successful dynamic memory initialization and flash configuration.
Generated by the language model.
ADVERTISEMENT