logo elektroda
logo elektroda
X
logo elektroda

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

divadiow 27894 382
ADVERTISEMENT
  • Suggesting a flash info button with wiring diagram

    #331 21696066
    divadiow
    Level 38  
    Posts: 5234
    Help: 449
    Rate: 918
    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
  • Helpful post

    Bootloader overwrite and config extraction fixes for BK7238/T1

    #333 21701945
    insmod
    Level 31  
    Posts: 1432
    Help: 168
    Rate: 455
    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
    Posts: 14793
    Help: 659
    Rate: 12938
    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 38  
    Posts: 5234
    Help: 449
    Rate: 918
    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 31  
    Posts: 1432
    Help: 168
    Rate: 455
    >>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.
  • #339 21703751
    divadiow
    Level 38  
    Posts: 5234
    Help: 449
    Rate: 918
    PLNPLN ouch
  • #340 21714675
    divadiow
    Level 38  
    Posts: 5234
    Help: 449
    Rate: 918
    maybe interesting
    Screenshot of file explorer showing a .bin file and debugging error messages.
    Attachments:
    • bk7258_video_lock_ty_kiwi_lvgl_tx_uvc_QIO_1.0.74_tx_1.0_4.5.bin (3.83 MB) You must be logged in to download this attachment.
  • #341 21750908
    divadiow
    Level 38  
    Posts: 5234
    Help: 449
    Rate: 918
    Search results page for WB5E development boards on AliExpress

    ESP32 development board with two loose pin headers beside it
  • #342 21750930
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14793
    Help: 659
    Rate: 12938
    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 38  
    Posts: 5234
    Help: 449
    Rate: 918
    still not as attractively priced as NiceMCU XH-WB3S BK7238 though!
  • #344 21750999
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14793
    Help: 659
    Rate: 12938
    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.
  • How external SRAM accesses are translated on ESP32

    #346 21751027
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14793
    Help: 659
    Rate: 12938
    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.
  • UART RX pin appears stuck high on the board

    #347 21777597
    max4elektroda
    Level 24  
    Posts: 758
    Help: 49
    Rate: 189
    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 ?!?
  • ADVERTISEMENT
  • #348 21777598
    insmod
    Level 31  
    Posts: 1432
    Help: 168
    Rate: 455
    >>21777597
    Did you start any driver that uses uart?
  • #349 21777601
    max4elektroda
    Level 24  
    Posts: 758
    Help: 49
    Rate: 189
    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 31  
    Posts: 1432
    Help: 168
    Rate: 455
    TuyaMCU works fine for me on UART1 BK7238 with debug assistant
  • #351 21777616
    divadiow
    Level 38  
    Posts: 5234
    Help: 449
    Rate: 918
    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.
  • ADVERTISEMENT
  • #352 21777629
    max4elektroda
    Level 24  
    Posts: 758
    Help: 49
    Rate: 189
    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.
  • P0/P1 with flag 26 enabled gives readings

    #353 21777657
    divadiow
    Level 38  
    Posts: 5234
    Help: 449
    Rate: 918
    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 24  
    Posts: 758
    Help: 49
    Rate: 189
    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
    Posts: 14793
    Help: 659
    Rate: 12938
    So many pins, nice. Did they actually route out all of them?
    Helpful post? Buy me a coffee.
  • Bootloader version differences between RTT and FreeRTOS SDKs

    #358 21832723
    divadiow
    Level 38  
    Posts: 5234
    Help: 449
    Rate: 918
    3.0.78 but different https://dl.bekencorp.com/SDK/bk_7252n/

    BK7251 default target, libs scattered about, RTT, older toolchain, newer/different bootloaders

    Code: Text
    Log in, to see the code


    Added after 58 [minutes]:

    up_boot_rtt_bootloader_34be6bf.rar - RTT bootloader source? but still some precompiled libs in there
  • #359 21834153
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14793
    Help: 659
    Rate: 12938
    Link doesn't work for me, can you attach up_boot_rtt_bootloader_34be6bf?
    Helpful post? Buy me a coffee.
  • #360 21834161
    divadiow
    Level 38  
    Posts: 5234
    Help: 449
    Rate: 918
    p.kaczmarek2 wrote:
    Link doesn't work for me, can you attach up_boot_rtt_bootloader_34be6bf?
    Attachments:
    • up_boot_rtt_bootloader_34be6bf.rar (9.17 MB) You must be logged in to download this attachment.
    • beken_rtt_sdk_release-SDK_3.0.X_Windows_env.tar.gz (277.06 MB) You must be logged in to download this attachment.

Topic summary

LABEL_AI_GENERATED
Discussion centers on NiceMCU XH-WB3S dev boards/modules, initially suspected to be BK7231T but confirmed to use BK7238. Participants identify flash IDs, per-chip encryption keys, and note that OTA flashing is blocked for unencrypted images, while BKFIL and factory restore methods can still recover devices. The thread evolves into porting OpenBeken/OpenBK7231T to the BK7238/new Beken SDK, including Arduino-based builds, makefile/HAL adjustments, flashvars alignment fixes, timing/delay_us implementation, HTTP/TCP server stability fixes, UART logging routing, power-save handling, and sensor support such as DHT11 and DS18B20. Later posts cover BK7231N/BK7231U compatibility, bootloader behavior, flash chip detection, and flashing tool fixes for unsupported flash MID values.
AI summary based on the discussion. May contain errors.
ADVERTISEMENT