logo elektroda
logo elektroda
X
logo elektroda

Beken Flash Dump Partition Info Extraction with RT-Threads Partition Tool - Development Thoughts?

divadiow 318 42
ADVERTISEMENT
  • #31 21737582
    divadiow
    Level 36  
    Code: Text
    Log in, to see the code
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #33 21737592
    divadiow
    Level 36  
    wait. what. wtf. i've added rbl to 132000 to first booting BL and it's OTAd and OBK boots.

    insmod wrote:
    same binary crc'ed with old encrypt and 0 0 0 0 flags.


    not uascent key?

    Added after 2 [minutes]:

    >>21737587

    Code: Text
    Log in, to see the code


    M_ALT does not boot btw
  • #34 21737596
    insmod
    Level 29  
    >>21737592
    First with encrypt_n with uascent keys, then added partitions and then crc'ed it with zero keys.
    OTA works because i've changed tuya keys to uascent at 0x3c, 16 bytes length in bk7231n_bootloader.bin (not encrypted one).
  • #35 21737601
    divadiow
    Level 36  
    ooh ok. ok.

    ah, linking to ..?
    insmod wrote:
    Tuya keys are at 0x48-0x57


    I didn't follow that up
  • ADVERTISEMENT
  • #36 21737604
    insmod
    Level 29  
    >>21737601
    Oops, i've changed it at wrong address, 0x48-0x57 is correct.
    If OTA completes, does it boot?
  • ADVERTISEMENT
  • #37 21737608
    divadiow
    Level 36  
    insmod wrote:
    If OTA completes, does it boot?


    yes.

    with the BL from here + rbl at 12A000 =

    Code: Text
    Log in, to see the code
  • #39 21737612
    divadiow
    Level 36  
    insmod wrote:
    Here's a fixed one


    same experience

    Code: Text
    Log in, to see the code
  • Helpful post
    #41 21737626
    divadiow
    Level 36  
    M_ALT does boot on zero-keys BK7231N module. OTA does work

    Code: Text
    Log in, to see the code


    OpenBK7231M_ALT_QIO_1.18.206.bin -> OpenBK7231N_1.18.204.rbl

    old-SDK M QIO does not boot still because of this: https://www.elektroda.com/rtvforum/viewtopic.php?p=21725511#21725511

    PR not submitted for change yet

    These are test devices btw

    Uascent key = blue CB3S from Matter mini switch
    Zero key = white UAM026 from Uascent bulb (yes a Uascent with zero keys)

    Two NiceMCU WB3S_V1 modules on a blue background with yellow labels. Two microcontroller boards on a blue surface, with USB-C ports and wireless modules

    Added after 4 [minutes]:

    >>21737614

    this does not boot on M

    Added after 2 [minutes]:

    UAM026 = BL2028N https://www.elektroda.com/rtvforum/topic4111089.html#21477454
  • #43 21737644
    divadiow
    Level 36  
    Ok cool. We'll feed that into the build for the uascent section and can finally, hopefully, release Uascent QIO in the BK7231N zip?

    Added after 1 [hours] 51 [minutes]:

    I'll give that a go. I should be almost there a with a branch only 10 days ago I think.

    @p.kaczmarek2 partition detection is still a useful thing in itself though? This doesn't affect that adventure?

    I can imagine using partition detection on backups mostly, but maybe it'd be useful for when a user reports OTA not working and they've flashed app, but not QIO, maybe to a BK7238 or a non-Tuya BK-T?

Topic summary

The discussion focuses on extracting partition offset and length information from Beken flash dumps to facilitate OpenBK* firmware conversions, particularly to ensure OTA updates function correctly by aligning bootloader expectations with fixed OTA file offsets. The main challenge involves interpreting the partition table starting with the "01PE" signature, which requires understanding little-endian byte order. The RT-Threads Partition Tool is explored as a means to edit or add partitions in a virgin bootloader binary (e.g., bootloader_bk7231n_uart2_v1.0.13.bin). Comparisons are made with the FlashDumps project, which identifies RBL (ROM Boot Loader) identifiers but does not parse the "01PE" partition table. Attempts to catalog known bootloader versions via RBL extraction have been inconclusive, highlighting the potential utility of the partition table approach for better firmware analysis and modification.
Summary generated by the language model.
ADVERTISEMENT