logo elektroda
logo elektroda
X
logo elektroda

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

divadiow 14196 355
ADVERTISEMENT
  • #331 21696066
    divadiow
    Level 37  
    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.
  • ADVERTISEMENT
  • #335 21701974
    divadiow
    Level 37  
    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
  • #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
  • #342 21750930
    p.kaczmarek2
    Moderator Smart Home
    Wow so BK7258 has reached Aliexpress?
    https://www.elektroda.com/rtvforum/find.php?q=wb5e
    Helpful post? Buy me a coffee.
  • #343 21750945
    divadiow
    Level 37  
    still not as attractively priced as NiceMCU XH-WB3S BK7238 though!
  • #344 21750999
    p.kaczmarek2
    Moderator Smart Home
    How big flash is it?

    Btw, from datasheet:
    Beken memory specifications including Flash, PSRAM, ROM, and eFuse
    I wonder if we could attach external flash (or RAM) to Beken easily? It would be great, especially for BK7231.
    Helpful post? Buy me a coffee.
  • #346 21751027
    p.kaczmarek2
    Moderator Smart Home
    Interesting, I only used external SRAM on ESP32 ( https://www.elektroda.pl/rtvforum/topic4126144.html ), I don't know how it works under the hood. I assume there is also possible to have a pointer to block of memory in external SRAM, so, how does it get translated, when I access it? Like buff[1] = 1; ? Is it done by C driver, or by hardware? Does it send/write to chip via SPI on every access, or does it cache? Just curious.
    Helpful post? Buy me a coffee.
  • #347 21777597
    max4elektroda
    Level 22  
    insmod wrote:
    Nearly finished porting 3.0.78 SDK.
    Plus fixed UART.

    Yes, I know it was some time ago, but could you explain how to use UART?
    I was trying to get some input from uart, but won't get any.
    I tried with an USB uart "in parallel" to see, if there is any input, but as soon as I connect the line to RX of the board, there is even no more input visible on the "external uart" (this works fine with other boars).
    RX input pin seems "always high" for me. Is there anything else to do to use uart? Or maybe my board is simply broken ?!?
  • #348 21777598
    insmod
    Level 29  
    >>21777597
    Did you start any driver that uses uart?
  • #349 21777601
    max4elektroda
    Level 22  
    Yes, used my NEO6 driver (https://github.com/openshwprojects/OpenBK7231T_App/pull/1890). At least it works on other Beken platforms.
    Uart is started with:

    UART_InitUART(NEO6M_baudRate, 0, 0);

    NEO6M_baudRate = 9600
  • #350 21777612
    insmod
    Level 29  
    TuyaMCU works fine for me on UART1 BK7238 with debug assistant
  • #351 21777616
    divadiow
    Level 37  
    insmod wrote:
    TuyaMCU works fine for me on UART1 BK7238 with debug assistant


    same. will try NEO6M on BK7238 as soon as I can, unless solved before.
  • #352 21777629
    max4elektroda
    Level 22  
    So if I start TuyaMCU driver and then connect something on UART1, I should also see "non-Tuya" input in Log?
    Seems the same in this case: as soon as input is connected, input (on the parallel connected UART) "stops".
    So maybe it's really my board having a problem here, sorry for bothering you.
  • #353 21777657
    divadiow
    Level 37  
    hmm.

    I don't seem to have got a reading yet.

    USB-C is power only - ie no P10/P11 UART with PC.

    1890_merge_73e135eabfe4
    Code: Text
    Log in, to see the code


    Code: Text
    Log in, to see the code


    ? character is when flag26 is unchecked.

    NiceMCU WB3S microcontroller board with wired modules on cardboard surface

    same if using the second RX/TX labelled headers on NiceMCU by GND/3V3

    WB3S module with color-coded pin labels for GPIO, UART, I2C, SPI, and power

    Added after 4 [minutes]:

    but using P0/P1 and flag 26 CHECKED = readings

    Screenshot of the OpenBK7238 interface with GPS data and driver status
  • Helpful post
    #354 21777679
    max4elektroda
    Level 22  
    Thanks for reminding me on flag 26 - works here with P0/P1, too!

    User interface of OpenBK7238 system with sensor readings and control buttons
  • #356 21788276
    p.kaczmarek2
    Moderator Smart Home
    So many pins, nice. Did they actually route out all of them?
    Helpful post? Buy me a coffee.

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