logo elektroda
logo elektroda
X
logo elektroda

NiceMCU XH-WB3S BK7238 Flashing, Testing, Pinout, Development, Porting

divadiow 12174 339
ADVERTISEMENT
  • #331 21696066
    divadiow
    Level 36  
    cool. will try it in a mo.

    was thinking maybe EF would benefit from a little info button labelled "Flash Info" or something. It'd bring up a little box with some basic wiring text and a little ASCII diagram maybe, basically what LT has. Sometimes I forget which PAxx for AmebaZ/Z2 so it's kinda handy. I know Ameba Z/Z2 isn't in EF yet, but new users may appreciate a little pointer for all chips. Could bolster each with a link to key thread on Elektroda.

    eg.

    Code: Text
    Log in, to see the code


    Added after 6 [minutes]:

    something jazzier

    Code: Text
    Log in, to see the code
  • ADVERTISEMENT
  • ADVERTISEMENT
  • Helpful post
    #333 21701945
    insmod
    Level 29  
    https://github.com/openshwprojects/BK7231GUIFlashTool/pull/65
    Always overwrite bootloader for BK7238/T1, since we can't ota with default T1 bootloader. And overwrite 7252N, 7236 and 7258 for the future.
    Can now override default 8710_2M key. 8711AM_4M decrypts WRG1 config successfully, and 8721D decrypts 8720DN configs.
    There is some strangeness to WBR1D and T5 configs. Tuya magic is after data, so nothing gets extracted. If manually moved magic before data - extraction is successful.
    Will now extract at least something if no pin/baud data is in the config.
    {
       "uuid":"22527ceacb5223f3",
       "psk_key":"null",
       "auth_key":"pX5PvwBmZ5ATsFbu3oDk8O6LZqKbXwA9",
       "ap_ssid":"SmartLife",
       "ap_passwd":"null",
       "country_code":"null",
       "bt_mac":"null",
       "bt_hid":"null",
       "prod_test":"false",
       "fac_pin":"w57tepkyqlsegcov",
       "psk30_key":"null "
    }
    

    Sorry, no meaningful pins data found. This device may be TuyaMCU or a custom one with no Tuya config data.
    No module information found.
    And the Tuya section starts at 2015232, which is a default LN882H offset.
    

    {
       "uuid":"2bf63b86ce95a65a",
       "psk_key":"nt7Eq07Z0UDOFRZdGKbDADIFbYBos5hyhg0fO",
       "auth_key":"xM5nse6ey9qZBkhDFpfZzt1p4MvWo9yr",
       "ap_sB[rcd-sub_dev_ddintry_code":"null",
       "bt_mac":"null",
       "bt_hid":"null",
       "prod_test":"false",
       "fac_pin":"0",
       "random":"0",
       "wfb64":"1",
       "stat":"0",
       "token":"null",
       "region":"null",
       "reg_key":"null",
       "dns_prio":"2bf63b86ce95a65a",
       "ap_ssid":"SmartLife",
       "ap_passwd":"null",
       "country_code":"null",
       "ssid":"null",
       "passwd":"null",
       "md":"0",
       "dp5":"2",
       "dp30":"1",
       "dp39":"1",
       "dp40":"1",
       "dp44":"100",
       "dp41":"50",
       "dp46":"1",
       "id":"null",
       "swv":"1.7.2",
       "bv":"40.00",
       "pv":"2.2",
       "lpv":"3.4",
       "pk":"keym557nqw3p8p7m",
       "firmk":"null",
       "cadv":"1.0.4",
       "cdv":"1.0.0",
       "dev_swv":"1.7.2",
       "s_id":"null",
       "dtp":"0",
       "sync":"0",
       "attr_num":"1",
       "mst_tp_0":"3",
       "mst_ver_0":"2.4.1",
       "mst_md5_0":"null",
       "mst_tp_1":"0",
       "mst_ver_1":"null",
       "mst_md5_1":"null",
       "mst_tp_2":"0",
       "mst_ver_2":"null",
       "mst_md5_2":"null",
       "mst_tp_3":"0",
       "mst_ver_3":"null",
       "mst_md5_3":"2"
    }
    

    Sorry, no meaningful pins data found. This device may be TuyaMCU or a custom one with no Tuya config data.
    No module information found.
    And the Tuya section starts at 8220672, which is a default 8MB RTL8720D/WBRG1 offset.
    
  • #334 21701969
    p.kaczmarek2
    Moderator Smart Home
    Cool, merged. Let me know what are your next plans for flasher, as I am considering looking into that as well. I am thinking about next RTLs or BL602, or maybe ESP for sport.
    Helpful post? Buy me a coffee.
  • #335 21701974
    divadiow
    Level 36  
    nice. very useful. the pid and pk are useful just themselves. anything extracted is a bonus

    LN
    Screenshot of BK7231 Easy UART Flasher with loaded JSON configuration
  • ADVERTISEMENT
  • #336 21701981
    insmod
    Level 29  
    >>21701969
    I think about moving it to .NET 4.8 (or at least 4.6).
    Some code cleaning, using tasks instead of threads, system.text.json instead of newtonsoft.json etc.
    .NET 8 and Avalonia for the future? This would make it cross-platform without mono, but that would be really hard.
  • ADVERTISEMENT

Topic summary

The discussion centers on the NiceMCU XH-WB3S development board featuring the BK7238 SoC, initially suspected to be BK7231T but confirmed as BK7238. Users share experiences with flashing, testing, and porting firmware, including challenges with encryption keys, flash IDs, and bootloader compatibility. The BK7238 uses 2MB flash with varying encryption keys per chip, complicating universal firmware flashing. Tools like BKFIL and Easy Flasher (EF) are used for backup and restore, with EF supporting full flash erase and restore including bootloader. Flash ID support was extended to include missing flash chips to avoid CRC errors. Arduino SDK and Beken FreeRTOS SDK (version 3.0.70.1 and newer 3.0.76) are referenced for development, with partial support for BK7238 and related chips (BK7231N, BK7231U, BK7252). Porting efforts include adapting delay functions for 160MHz BK7238, resolving flashvars alignment issues due to 64-bit time_t, and addressing HTTP server and TCP socket stability problems in LWIP. OTA updates are functional but require correct image types and bootloader versions. Power save modes and their impact on peripherals like BL0937 energy meter and DS18B20 sensors are discussed, with some instability noted under power save. SPI flashing and UART flashing methods are compared, with SPI preferred for some devices. BK7231U (CC8000 chip) support is emerging, with builds available but some undefined references and boot issues. BK7252 camera module support is experimental, with encrypted flash complicating firmware use. Users report issues with DS18B20 sensor timing on BK7238 due to delay_us inaccuracies, partially fixed by new SDK delay implementations. Logging and MQTT load affect system stability and sensor reading consistency. The community shares flash dumps, toolchain links, and SDK forks to aid development and testing. Overall, the thread provides detailed technical insights into BK7238-based NiceMCU boards' flashing, SDK porting, peripheral support, and firmware development challenges and progress.
Summary generated by the language model.
ADVERTISEMENT