logo elektroda
logo elektroda
X
logo elektroda

Easy Flasher: BK7231N/T/BK7238 etc chip ID check for Beken devices?

divadiow 477 15
ADVERTISEMENT
  • Helpful post
    #1 21876721
    divadiow
    Level 38  
    <post moved from here to keep separate>


    @DeDaMrAz suggested a more robust chip ID check in EF so in the cases where mislabelled CB2S may actually be a BK7231T and not a BK7231N, Easy Flasher will flag and stop current operation before starting. This suggestion was based on real recent experience.

    So maybe something like https://github.com/openshwprojects/BK7231GUIFlashTool/pull/118/changes?w=1

    -move chipID stuff into new file Flashers\BKChipIdentity.cs
    -chipid dictionary for supported and a couple of OBK-unsupported BK chips
    -if chip should return chip ID but fails to, log warning to suggest wrong chip may be selected. eg, BK7231N selected, BK7231T device:
    Screenshot of BK7231 Easy UART Flasher showing “Interrupted by user” and read error logs.
    -if chip returns ID not matched to selected chip, log fail and stop. eg, BK7238 selected but BK7231N device:
    Screenshot of BK7231 Easy UART Flasher showing a warning that the selected chip type is wrong.

    -expand use of 'skip key check' to 'skip chip/key check'
    Screenshot of a tool window with tabs “LAN Scanner”, “UART timeouts”, and “BK7231N Decryption”.
    eg, BK7238 selected, BK7231N device, skip checked:
    Screenshot of BK7231 Easy UART Flasher showing “Reading success!” and COM6 settings

    -BK7231M behaviour remains as no key check enabled by default but does log chip ID:
    Screenshot of BK7231 Easy UART Flasher showing “Reading success!” and a flash read log.

    I do not have BK7258/BK7236.



    03/04/2026 - I do now have BK7258 - will check and post again
  • ADVERTISEMENT
  • #2 21877804
    p.kaczmarek2
    Moderator Smart Home
    It looks like you've added override check for BK7231M?
    Screenshot of C# code with MatchesSelected and ShouldWarnSelected methods, with red boxes around if statements
    Helpful post? Buy me a coffee.
  • #3 21877808
    divadiow
    Level 38  
    I'll check it all over. BK7258 behaviour isn't right for checks. Is this even something you'd want added to EF1? I know @DeDaMrAz would like something..
  • ADVERTISEMENT
  • #4 21878046
    p.kaczmarek2
    Moderator Smart Home
    Yes I think we can add it if it works reliably and has no drawbacks.
    Helpful post? Buy me a coffee.
  • #5 21878112
    DeDaMrAz
    Level 22  
    I came across some mislabeled device the other day and was confused AF of what was wrong and since @divadiow is knee deep in flasher tool I asked for that feature.

    Also from my previous life when mobile phones were still not "smart" and I created some software for them it was a general rule to first get the flash chip type/size SW/FW numbers etc, and then phone model, as that then can be used to enable available features for that model only and set up all the rest based on chip geometry etc.
    Basically it was done with one button that would check certain known addresses that would contain those strings and that way cross flashing was avoided and all sorts of things. For example Siemens was my area of interest back then and they had like 18 different models supported by one tool, similar to what we have now.

    7258 is more complicated than I first thought as it is a weird 3 core chip, tried to port OBK to it but was not successful and i gave up to focus on some more "pressing" issues but will revisit at some point.
  • #6 21878434
    divadiow
    Level 38  
    DeDaMrAz wrote:
    7258 is more complicated than I first thought as it is a weird 3 core chip, tried to port OBK to it but was not successful and i gave up to focus on some more "pressing" issues but will revisit at some point.


    cool. existing 3.0.78 SDK or did you give the Armino one a go?
  • ADVERTISEMENT
  • Helpful post
    #7 21878452
    DeDaMrAz
    Level 22  
    divadiow wrote:
    cool. existing 3.0.78 SDK or did you give the Armino one a go?


    Tried both for fun and had more success with 3.0.78 but it requires more time so I had to move on from it. It i doable just time consuming and I am yet to see a device with that chip.
  • #8 21879350
    divadiow
    Level 38  
    p.kaczmarek2 wrote:
    It looks like you've added override check for BK7231M?


    the thinking was that BK7231M should remain free and easy in case it's ever NOT a BK7231N, but I guess that's not ever going to the case? Also, one BK that doesn't do a ChipID check might be useful if a new variant ID is tried on EF. If the checks were for every chipset it would fail at the first hurdle if the device returned an ID not matched. Would you rather BK7231M had ID check to match BK7231N?

    Added after 1 [minutes]:

    divadiow wrote:
    Also, one BK that doesn't do a ChipID check might be useful if a new variant ID is tried on EF


    but that's what the skip key/ID check checkbox can be used for, so .. dunno

    Added after 59 [minutes]:

    reinstated BK7231M key check to match BK7231N -
    7231c


    BK7231M mode with BK7238 connected
    Easy Flasher: BK7231N/T/BK7238 etc chip ID check for Beken devices?
    BK7238 mode with BK7238 connected
    Easy Flasher: BK7231N/T/BK7238 etc chip ID check for Beken devices?
    BK7231M mode with BK7231M (Uascent zero-keys BL2028N) connected
    Easy Flasher: BK7231N/T/BK7238 etc chip ID check for Beken devices?
    BK7231N mode with BK7231M (Uascent zero-keys BL2028N) connected
    Easy Flasher: BK7231N/T/BK7238 etc chip ID check for Beken devices?
    BK7231N mode with BK7231M (Uascent zero-keys BL2028N) connected + skip key/chip ID check selected
    Easy Flasher: BK7231N/T/BK7238 etc chip ID check for Beken devices?
    BK7231N mode with BK7231N (Tuya CB3S) connected
    Easy Flasher: BK7231N/T/BK7238 etc chip ID check for Beken devices?
    BK7231M mode with BK7231N (Tuya CB3S) connected + skip key/chip ID check selected
    Easy Flasher: BK7231N/T/BK7238 etc chip ID check for Beken devices?
    BK7231T mode with BK7231T (Tuya WB3S) connected
    Easy Flasher: BK7231N/T/BK7238 etc chip ID check for Beken devices?
    BK7252 mode with BK7231T (Tuya WB3S) connected
    Easy Flasher: BK7231N/T/BK7238 etc chip ID check for Beken devices?
    BK7258 mode with BK7258 connected
    Easy Flasher: BK7231N/T/BK7238 etc chip ID check for Beken devices?
    BK7231N mode with BK7258 connected
    Easy Flasher: BK7231N/T/BK7238 etc chip ID check for Beken devices?
    BK7231M mode with BK7258 connected
    Easy Flasher: BK7231N/T/BK7238 etc chip ID check for Beken devices?
    BK7231M mode with BK7258 connected + skip key/chip ID check selected
    Easy Flasher: BK7231N/T/BK7238 etc chip ID check for Beken devices?
  • #9 21879872
    p.kaczmarek2
    Moderator Smart Home
    divadiow wrote:
    Also, one BK that doesn't do a ChipID check might be useful if a new variant ID is tried on EF. If the checks were for every chipset it would fail at the first hurdle if the device returned an ID not matched. Would you rather BK7231M had ID check to match BK7231N?

    Added after 1 [minutes]:

    divadiow wrote:
    Also, one BK that doesn't do a ChipID check might be useful if a new variant ID is tried on EF


    but that's what the skip key/ID check checkbox can be used for, so .. dunno


    checkbox is good enough, merge ready?
    Helpful post? Buy me a coffee.
  • #10 21879874
    divadiow
    Level 38  
    p.kaczmarek2 wrote:
    checkbox is good enough, merge ready?

    I put it into draft. Was going to tidy bom/whitespaces. Don't have if you're not bothered about that. PR just looked messy

    Added after 3 [hours] 52 [minutes]:

    OK ready
  • #11 21880175
    p.kaczmarek2
    Moderator Smart Home
    Very nice! What's the next on the list?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #12 21880178
    divadiow
    Level 38  
    basic bootstrapping info in log box when selecting platform?
    TXW?
    RTL-B is bugging me, it doesn't release com port/button after certain failures, stop button often unresponsive
    XR refactor

    Added after 1 [minutes]:

    full erase for other platforms

    Added after 36 [seconds]:

    other ESPs

    Added after 14 [minutes]:

    template parsing unification
  • #13 21880878
    p.kaczmarek2
    Moderator Smart Home
    TXW, yes...

    RTL-B, if it has such bug, it's probably priority... it sounds like obvious mistake...

    XR refactor - why?

    Full erase - low priority but simple

    Other ESPs - good idea

    Template parsing - how and why?

    Also:
    https://github.com/openshwprojects/EasyGUIFlashTool
    Helpful post? Buy me a coffee.
  • #14 21881183
    divadiow
    Level 38  
    p.kaczmarek2 wrote:
    RTL-B, if it has such bug, it's probably priority... it sounds like obvious mistake...


    hmm. I think some stop/closeport/error handling needs standardising. Seems to vary quite a lot between platforms.

    I've playing with Codex and will present possibilities in new branch for analysis, testing etc

    Added after 1 [minutes]:

    lots of mixed line endings too :/ which make any diffs look noisy

    Added after 34 [minutes]:

    oh lord. it started off as an RTL-B tightening but... WIP: https://github.com/openshwprojects/BK7231GUIF...e/main...divadiow:BK7231GUIFlashTool:rtlbstop

    objective is to sort a shared contract for cross-platform behaviour:
    -how worker cleanup finishes
    -how cancellation is surfaced
    -how final read/write/erase states are shown

    centralise messaging. currently:

    BK uses
    Write success!
    and even includes a newline in the state text in BK7231Flasher.cs.
    RTL8710B uses
    Write complete!
    but with Color.Transparent, not a green success color, in RTLFlasher.cs.
    RTL87X0C ends on
    Flash complete!
    in RTLZ2Flasher.cs.
    BL/ECR/RDA/WM/SPI mostly use
    Writing done.

    XR/TR mostly use
    Write complete
    or
    Write done.

    ESP may finish on
    Write complete
    , or
    Write verified
    if MD5 verification runs, in ESPFlasher.cs.

    RTLZ2Flasher:
    Erase complete!

    TR6260Flasher:
    Erase complete!

    XR806/XR809/XR872:
    Erase complete

    BL602Flasher:
    Erase done

    SPIFlasher:
    Erase done


    Added after 7 [hours] 13 [minutes]:

    current state of play on branch:

    -hardens cancellation and COM-port cleanup so stop/cleanup exceptions are less likely to leave the app stuck
    -centralises worker-thread finalisation in the GUI so buttons and state recover more reliably after success, failure, or cancel
    -fixes RTL8710B’s weaker cancel handling by making its blocking read/wait paths cancellation-aware and ensuring its operations close the port more reliably
    -improves BK72xx cancellation handling so stop-triggered serial I/O aborts are treated as cancellation rather than noisy fatal failures
    -standardises final top-banner outcomes for supported read/write/erase operations so they consistently end in clear complete/cancel/error states
    -preserves detailed per-platform information in the log box, including verification success where supported
    -aligns several other platform flashers with the same shared completion/cancellation/status patterns without changing their protocol logic

Topic summary

✨ The discussion focuses on enhancing Easy Flasher (EF) software to implement a more robust chip ID verification process for Beken devices using BK7231N, BK7231T, BK7238, and related chips. The proposed improvement involves relocating chip ID handling into a dedicated file (FlashersBKChipIdentity.cs) and maintaining a dictionary of supported and some unsupported BK chips. This approach aims to detect mislabelled devices, such as CB2S units incorrectly identified as BK7231N when they are actually BK7231T, by flagging mismatches before flashing operations commence. The system logs warnings if the chip ID is expected but not returned, suggesting a possible wrong chip selection, and halts the process if the returned chip ID does not match the selected chip. Additionally, the feature to skip key checks is expanded to skip both chip and key checks, improving flexibility during flashing. Reference is made to a related GitHub pull request that implements these changes and includes example logs and screenshots demonstrating the detection of chip ID mismatches.
Generated by the language model.
ADVERTISEMENT