logo elektroda
logo elektroda
X
logo elektroda

Unable to flash with errors on TH01 Sensor (Green PCB and White CBU Module)

viktorpot 300 6
ADVERTISEMENT
  • #1 21331513
    viktorpot
    Level 2  
    I am trying to convert this sensor (Green PCB and White CBU module)
    Close-up of two circuit boards connected by wires on a wooden surface.

    I had success doing so with similar sensor that is Blue PCB and White module.

    The same method fails here as I get random errors reading or writing:

    $ ~/.venvs/ltchiptool/bin/python -m ltchiptool flash write -d /dev/ttyUSB0 OpenBK7231N_QIO_1.17.780.bin
    I: Detected file type: Beken QIO Firmware
    I: Connecting to 'Beken 72xx' on /dev/ttyUSB0 @ 115200
    I: |-- Success! Chip info: BK7231N
    I: Writing 'OpenBK7231N_QIO_1.17.780.bin'
    I: |-- Start offset: 0x11000 (auto-detected)
    I: |-- Write length: 1.1 MiB (auto-detected)
    I: |-- Skipped data: 68 KiB (auto-detected)
    [##--------------------------------------------------------------] 3% 00:01:53W: Writing 4k failure @ 0x1c000 (No response received), retrying (attempt 0)
    ...
    W: Erasing failure @ 0x1c000 (No response received), retrying (attempt 0)
    W: Erasing failure @ 0x1c000 (No response received), retrying (attempt 1)


    I am quite beginner to this kind of hacking so I am wondering whether there is something else to try out before going ahead desoldering the CBU module which in my case is almost guaranteed kill of the device?
    AI: Could you provide the exact model and version of the TH01 sensor you are trying to flash?
    CBU with AHT20
    AI: What operating system and additional hardware or software are you using in your setup?
    Linux and ltchiptool
  • ADVERTISEMENT
  • #2 21331600
    insmod
    Level 24  
    >>21331513 This is a TuyaMCU device, so to flash it you must at first try to connect RX and TX directly to module, and if that didn't work - then you must either remove the module or cut traces.
    I have the same device, and wiring directly to CBU worked for me.
  • ADVERTISEMENT
  • #3 21331753
    viktorpot
    Level 2  
    >>21331600
    I tried to resolder to CBU directly, but no change.

    One note though, I am able to flash the bootloader
    
    $ ./python -m bk7231tools write_flash -d /dev/ttyUSB0 -s 0 -S 0 -l 0x11000 --bootloader flash/OpenBK7231N_QIO_1.17.780.bin 
    <frozen runpy>:128: RuntimeWarning: 'bk7231tools.__main__' found in sys.modules after import of package 'bk7231tools', but prior to execution of 'bk7231tools.__main__'; this may result in unpredictable behaviour
    BK72xx connected - protocol: FULL, chip: BK7231N, bootloader: BK7231N_1_0_1, chip ID: 0x7231c, boot version: None
    Connected! Chip info: BK7231N / Flash ID: eb 60 15 / Flash size: 0x200000 / Protocol: FULL
    Writing 69632 bytes to 0x0
    Trying to unprotect flash memory...
    Erasing and writing at 0x0 (0.00%)
     - Checking block pre-erase @ 0x0
     - Trying to erase block @ 0x0
     - Checking block post-erase @ 0x0
     - Erase succeeded @ 0x0
    Erasing and writing at 0x1000 (5.88%)
    Erasing and writing at 0x2000 (11.76%)
    Erasing and writing at 0x3000 (17.65%)
    Erasing and writing at 0x4000 (23.53%)
    Erasing and writing at 0x5000 (29.41%)
    Erasing and writing at 0x6000 (35.29%)
    Erasing and writing at 0x7000 (41.18%)
    Erasing and writing at 0x8000 (47.06%)
    Erasing and writing at 0x9000 (52.94%)
    Erasing and writing at 0xA000 (58.82%)
    Erasing and writing at 0xB000 (64.71%)
    Erasing and writing at 0xC000 (70.59%)
    Erasing and writing at 0xD000 (76.47%)
    Erasing and writing at 0xE000 (82.35%)
    Erasing and writing at 0xF000 (88.24%)
    Erasing and writing at 0x10000 (94.12%)
    Verifying CRC
    OK!
    


    Any chance I can boot the device and use other means to upload the rest of the firmware? Or Can I attempt to flash bit by bit? This way it might upload the whole firwmare if started several times.

    EDIT: Looks like I kind of managed to achieve to flash in chunks:
    
    $ ./python -m bk7231tools write_flash -d /dev/ttyUSB0 -s 0x2A000 -S 0x2A000 flash/OpenBK7231N_QIO_1.17.780.bin 
    <frozen runpy>:128: RuntimeWarning: 'bk7231tools.__main__' found in sys.modules after import of package 'bk7231tools', but prior to execution of 'bk7231tools.__main__'; this may result in unpredictable behaviour
    BK72xx connected - protocol: FULL, chip: BK7231N, bootloader: BK7231N_1_0_1, chip ID: 0x7231c, boot version: None
    Connected! Chip info: BK7231N / Flash ID: eb 60 15 / Flash size: 0x200000 / Protocol: FULL
    Writing 1048432 bytes to 0x2A000
    Trying to unprotect flash memory...
    Erasing and writing at 0x2A000 (0.00%)
     - Checking block pre-erase @ 0x2a000
     - Deferring, block @ 0x2a000 is already erased
    Erasing and writing at 0x2B000 (0.39%)
     - Checking block pre-erase @ 0x2b000
     - Trying to erase block @ 0x2b000
     - Checking block post-erase @ 0x2b000
     - Erase succeeded @ 0x2b000
    Erasing and writing at 0x2C000 (0.78%)
    Erasing and writing at 0x2D000 (1.17%)
    Erasing and writing at 0x2E000 (1.56%)
    Erasing and writing at 0x2F000 (1.95%)
    Erasing and writing at 0x30000 (2.34%)
    Erasing and writing at 0x31000 (2.73%)
    Erasing and writing at 0x32000 (3.13%)
    Erasing and writing at 0x33000 (3.52%)
    Erasing and writing at 0x34000 (3.91%)
    Erasing and writing at 0x35000 (4.30%)
    Erasing and writing at 0x36000 (4.69%)
    Erasing and writing at 0x37000 (5.08%)
    Erasing and writing at 0x38000 (5.47%)
    Erasing and writing at 0x39000 (5.86%)
    Erasing and writing at 0x3A000 (6.25%)
    Erasing and writing at 0x3B000 (6.64%)
    Erasing and writing at 0x3C000 (7.03%)
    Erasing and writing at 0x3D000 (7.42%)
    Writing 4k failure @ 0x3d000 (No response received), retrying (attempt 0)
    Erasing failure @ 0x3d000 (No response received), retrying (attempt 0)
    Erasing failure @ 0x3d000 (No response received), retrying (attempt 1)
    Erasing failure @ 0x3d000 (No response received), retrying (attempt 2)
    Erasing failure @ 0x3d000 (No response received), retrying (attempt 3)
    ...
    $ ./python -m bk7231tools write_flash -d /dev/ttyUSB0 -s 0x3d000 -S 0x3d000 flash/OpenBK7231N_QIO_1.17.780.bin 
    <frozen runpy>:128: RuntimeWarning: 'bk7231tools.__main__' found in sys.modules after import of package 'bk7231tools', but prior to execution of 'bk7231tools.__main__'; this may result in unpredictable behaviour
    BK72xx connected - protocol: FULL, chip: BK7231N, bootloader: BK7231N_1_0_1, chip ID: 0x7231c, boot version: None
    Connected! Chip info: BK7231N / Flash ID: eb 60 15 / Flash size: 0x200000 / Protocol: FULL
    Writing 970608 bytes to 0x3D000
    Trying to unprotect flash memory...
    Erasing and writing at 0x3D000 (0.00%)
     - Checking block pre-erase @ 0x3d000
     - Trying to erase block @ 0x3d000
     - Checking block post-erase @ 0x3d000
     - Erase succeeded @ 0x3d000
    Erasing and writing at 0x3E000 (0.42%)
    Erasing and writing at 0x3F000 (0.84%)
    Erasing and writing at 0x40000 (1.27%)
    Erasing and writing at 0x41000 (1.69%)
    Erasing and writing at 0x42000 (2.11%)
    Erasing and writing at 0x43000 (2.53%)
    Erasing and writing at 0x44000 (2.95%)
    Erasing and writing at 0x45000 (3.38%)
    Erasing and writing at 0x46000 (3.80%)
    Erasing and writing at 0x47000 (4.22%)
    Erasing and writing at 0x48000 (4.64%)
    Erasing and writing at 0x49000 (5.06%)
    Erasing and writing at 0x4A000 (5.49%)
    Erasing and writing at 0x4B000 (5.91%)
    Erasing and writing at 0x4C000 (6.33%)
    Erasing and writing at 0x4D000 (6.75%)
    Erasing and writing at 0x4E000 (7.17%)
    Erasing and writing at 0x4F000 (7.60%)
    Writing 4k failure @ 0x4f000 (No response received), retrying (attempt 0)
    Erasing failure @ 0x4f000 (No response received), retrying (attempt 0)
    Erasing failure @ 0x4f000 (No response received), retrying (attempt 1)
    Erasing failure @ 0x4f000 (No response received), retrying (attempt 2)
    Erasing failure @ 0x4f000 (No response received), retrying (attempt 3)
    
    $ ./python -m bk7231tools write_flash -d /dev/ttyUSB0 -s 0x4f000 -S 0x4f000 flash/OpenBK7231N_QIO_1.17.780.bin 
    <frozen runpy>:128: RuntimeWarning: 'bk7231tools.__main__' found in sys.modules after import of package 'bk7231tools', but prior to execution of 'bk7231tools.__main__'; this may result in unpredictable behaviour
    BK72xx connected - protocol: FULL, chip: BK7231N, bootloader: BK7231N_1_0_1, chip ID: 0x7231c, boot version: None
    Connected! Chip info: BK7231N / Flash ID: eb 60 15 / Flash size: 0x200000 / Protocol: FULL
    Writing 896880 bytes to 0x4F000
    Trying to unprotect flash memory...
    Erasing and writing at 0x4F000 (0.00%)
     - Checking block pre-erase @ 0x4f000
     - Trying to erase block @ 0x4f000
     - Checking block post-erase @ 0x4f000
     - Erase succeeded @ 0x4f000
    Erasing and writing at 0x50000 (0.46%)
    Erasing and writing at 0x51000 (0.91%)
    Erasing and writing at 0x52000 (1.37%)
    Erasing and writing at 0x53000 (1.83%)
    Erasing and writing at 0x54000 (2.28%)
    Erasing and writing at 0x55000 (2.74%)
    Erasing and writing at 0x56000 (3.20%)
    Erasing and writing at 0x57000 (3.65%)
    Erasing and writing at 0x58000 (4.11%)
    Erasing and writing at 0x59000 (4.57%)
    Erasing and writing at 0x5A000 (5.02%)
    Erasing and writing at 0x5B000 (5.48%)
    Erasing and writing at 0x5C000 (5.94%)
    Erasing and writing at 0x5D000 (6.39%)
    Erasing and writing at 0x5E000 (6.85%)
    Erasing and writing at 0x5F000 (7.31%)
    Erasing and writing at 0x60000 (7.76%)
    Erasing and writing at 0x61000 (8.22%)
    Erasing and writing at 0x62000 (8.68%)
    Erasing and writing at 0x63000 (9.13%)
    Erasing and writing at 0x64000 (9.59%)
    Erasing and writing at 0x65000 (10.05%)
    Erasing and writing at 0x66000 (10.50%)
    Erasing and writing at 0x67000 (10.96%)
    Writing 4k failure @ 0x67000 (No response received), retrying (attempt 0)
    Erasing failure @ 0x67000 (No response received), retrying (attempt 0)
    Erasing failure @ 0x67000 (No response received), retrying (attempt 1)
    Erasing failure @ 0x67000 (No response received), retrying (attempt 2)
    Erasing failure @ 0x67000 (No response received), retrying (attempt 3)
    .....
    .....
    .....
    
    $ ./python -m bk7231tools write_flash -d /dev/ttyUSB0 -s 0xCC000 -S 0xCC000 flash/OpenBK7231N_QIO_1.17.780.bin 
    <frozen runpy>:128: RuntimeWarning: 'bk7231tools.__main__' found in sys.modules after import of package 'bk7231tools', but prior to execution of 'bk7231tools.__main__'; this may result in unpredictable behaviour
    BK72xx connected - protocol: FULL, chip: BK7231N, bootloader: BK7231N_1_0_1, chip ID: 0x7231c, boot version: None
    Connected! Chip info: BK7231N / Flash ID: eb 60 15 / Flash size: 0x200000 / Protocol: FULL
    Writing 384880 bytes to 0xCC000
    Trying to unprotect flash memory...
    Erasing and writing at 0xCC000 (0.00%)
     - Checking block pre-erase @ 0xcc000
     - Trying to erase block @ 0xcc000
     - Checking block post-erase @ 0xcc000
     - Erase succeeded @ 0xcc000
    Erasing and writing at 0xCD000 (1.06%)
    Erasing and writing at 0xCE000 (2.13%)
    Erasing and writing at 0xCF000 (3.19%)
    Erasing and writing at 0xD0000 (4.26%)
    Erasing and writing at 0xD1000 (5.32%)
    Erasing and writing at 0xD2000 (6.39%)
    Erasing and writing at 0xD3000 (7.45%)
    Erasing and writing at 0xD4000 (8.51%)
    Erasing and writing at 0xD5000 (9.58%)
    Erasing and writing at 0xD6000 (10.64%)
    Erasing and writing at 0xD7000 (11.71%)
    Erasing and writing at 0xD8000 (12.77%)
    Erasing and writing at 0xD9000 (13.83%)
    Erasing and writing at 0xDA000 (14.90%)
    Erasing and writing at 0xDB000 (15.96%)
    Erasing and writing at 0xDC000 (17.03%)
    Erasing and writing at 0xDD000 (18.09%)
    Erasing and writing at 0xDE000 (19.16%)
    Erasing and writing at 0xDF000 (20.22%)
    Erasing and writing at 0xE0000 (21.28%)
    Erasing and writing at 0xE1000 (22.35%)
    Erasing and writing at 0xE2000 (23.41%)
    Erasing at 0xE3000 (24.48%)
    Erasing at 0xE4000 (25.54%)
    Erasing at 0xE5000 (26.61%)
    Erasing at 0xE6000 (27.67%)
    Erasing at 0xE7000 (28.73%)
    Erasing at 0xE8000 (29.80%)
    Erasing at 0xE9000 (30.86%)
    Erasing at 0xEA000 (31.93%)
    Erasing at 0xEB000 (32.99%)
    Erasing at 0xEC000 (34.06%)
    Erasing at 0xED000 (35.12%)
    Erasing at 0xEE000 (36.18%)
    Erasing at 0xEF000 (37.25%)
    Erasing at 0xF0000 (38.31%)
    Erasing at 0xF1000 (39.38%)
    Erasing at 0xF2000 (40.44%)
    Erasing at 0xF3000 (41.50%)
    Erasing at 0xF4000 (42.57%)
    Erasing at 0xF5000 (43.63%)
    Erasing at 0xF6000 (44.70%)
    Erasing at 0xF7000 (45.76%)
    Erasing at 0xF8000 (46.83%)
    Erasing failure @ 0xf8000 (No response received), retrying (attempt 0)
    Erasing failure @ 0xf8000 (No response received), retrying (attempt 1)
    Erasing failure @ 0xf8000 (No response received), retrying (attempt 2)
    Erasing failure @ 0xf8000 (No response received), retrying (attempt 3)
    
    $ ./python -m bk7231tools write_flash -d /dev/ttyUSB0 -s 0xF8000 -S 0xF8000 flash/OpenBK7231N_QIO_1.17.780.bin 
    <frozen runpy>:128: RuntimeWarning: 'bk7231tools.__main__' found in sys.modules after import of package 'bk7231tools', but prior to execution of 'bk7231tools.__main__'; this may result in unpredictable behaviour
    BK72xx connected - protocol: FULL, chip: BK7231N, bootloader: BK7231N_1_0_1, chip ID: 0x7231c, boot version: None
    Connected! Chip info: BK7231N / Flash ID: eb 60 15 / Flash size: 0x200000 / Protocol: FULL
    Writing 204656 bytes to 0xF8000
    Trying to unprotect flash memory...
    Erasing at 0xF8000 (0.00%)
     - Checking block pre-erase @ 0xf8000
     - Deferring, block @ 0xf8000 is already erased
    Erasing at 0xF9000 (2.00%)
     - Checking block pre-erase @ 0xf9000
     - Trying to erase block @ 0xf9000
     - Checking block post-erase @ 0xf9000
     - Erase succeeded @ 0xf9000
    Erasing at 0xFA000 (4.00%)
    Erasing at 0xFB000 (6.00%)
    Erasing at 0xFC000 (8.01%)
    Erasing at 0xFD000 (10.01%)
    Erasing at 0xFE000 (12.01%)
    Erasing at 0xFF000 (14.01%)
    Erasing at 0x100000 (16.01%)
    Erasing at 0x101000 (18.01%)
    Erasing at 0x102000 (20.01%)
    Erasing at 0x103000 (22.02%)
    Erasing at 0x104000 (24.02%)
    Erasing at 0x105000 (26.02%)
    Erasing at 0x106000 (28.02%)
    Erasing at 0x107000 (30.02%)
    Erasing at 0x108000 (32.02%)
    Erasing at 0x109000 (34.02%)
    Erasing at 0x10A000 (36.03%)
    Erasing at 0x10B000 (38.03%)
    Erasing at 0x10C000 (40.03%)
    Erasing at 0x10D000 (42.03%)
    Erasing at 0x10E000 (44.03%)
    Erasing at 0x10F000 (46.03%)
    Erasing at 0x110000 (48.03%)
    Erasing at 0x111000 (50.04%)
    Erasing at 0x112000 (52.04%)
    Erasing at 0x113000 (54.04%)
    Erasing at 0x114000 (56.04%)
    Erasing at 0x115000 (58.04%)
    Erasing at 0x116000 (60.04%)
    Erasing at 0x117000 (62.04%)
    Erasing at 0x118000 (64.05%)
    Erasing at 0x119000 (66.05%)
    Erasing at 0x11A000 (68.05%)
    Erasing at 0x11B000 (70.05%)
    Erasing at 0x11C000 (72.05%)
    Erasing at 0x11D000 (74.05%)
    Erasing at 0x11E000 (76.05%)
    Erasing at 0x11F000 (78.05%)
    Erasing at 0x120000 (80.06%)
    Erasing at 0x121000 (82.06%)
    Erasing at 0x122000 (84.06%)
    Erasing at 0x123000 (86.06%)
    Erasing at 0x124000 (88.06%)
    Erasing at 0x125000 (90.06%)
    Erasing at 0x126000 (92.06%)
    Erasing at 0x127000 (94.07%)
    Erasing at 0x128000 (96.07%)
    Erasing and writing at 0x129000 (98.07%)
    Verifying CRC
    OK!
    


    Connected RX2/TX2 and watching the boot shows this:
    
    [23:30:02]SYS:000000df          0040192c	�������j
    [23:30:02][ARM(ANOMALY][2]
    [23:30:02][ARM ANOMALY][2]
    [23:30:02][ARM ANOMALY][2]
    [23:30:02][ARM ANOMALY][2]
    [23:30:02][ARM ANOMALY][2]
    [23:30:02][ARM ANOMALY][2]
    [23:30:02][ARM ANOMALY][2]
    [23:30:03][ARM aNOMALY][2]
    [23:30:03]GIR:000000d1 00000010 00401ffc 36240005 
    [23:30:03][ARM ANOMALY][2]
    [23:30:03][ARM ANOMALY][2]
    [23:30:03][ARM ANOMALY][2]
    [23:30:03]�
    [23:30:03][ARM ANOMALY][2]
    [23:30:03]V:BK7231N_1	r�j
    [23:30:03][ARM ANOMALY][2]
    [23:30:03][ARM ANOMALY][2]
    [23:30:03][ARM ANOMALY][2]
    [23:30:03][ARM ANOMALY][2]
    [23:30:03][ARM ANOMALY][2]
    [23:30:04][ARM AOOMALY][2]
    [23:30:04]REG:cpsr     spsr     r13>     r14�
    [23:30:04][ARM ANOMALY][2]
    [23:30:04][ARM ANOMAlY]�2]
    [23:30:04][ARM ANOMALY][2]
    [23:30:04][ARM ANOMALY][2]
    [23:30:04][ARM ANOMALY][2]
    [23:30:04][ARM ANOMALY][2]
    [23:30:04][ARM ANOMALY][2]
    [23:30:04][ARM ANOMALY][2]
    [23:30:04][ARM ANOMALY][2]
    [23:30:04][ARM ANOMALY][2]
    [23:30:04][ARM ANOMALY][2]
    [23:30:05][ARM ANOMALY][2]
    [23:30:05][ARM ANOMALY][2]
    [23:30:05][ARM ANOMALY][2]
    [23:30:05][ARM ANOMALY][3]
    [23:30:05][ARM ANOMALY][2]
    [23:30:05][ARM ANOMALY][2]
    [23:30:05][ARM A~OMALY][2]
    [23:30:05][ARM ANOMALY][2]
    [23:30:05]V:CK7231N_L	r�j
    [23:30:05][ARM ANOMALY][2]
    [23:30:05][ARM ANOMALY][2]
    [23:30:06][ARM ANOMALY][2]
    [23:30:06][ARM ANOMALY][2]
    [23:30:06][ARM ANOMALY][2]
    [23:30:06]FIR:000000d1 00000010 00401ffc 36����j
    [23:30:06][ARM ANOMALY][2]
    [23:30:06][ARM ANOMALY][2]
    [23:30:06][ARM ANOMALY][�]
    [23:30:06][ARM ANOMALY][2]
    [23:30:06][ARM ANOMALY][2]
    [23:30:06][ARM ANOMALY][2]
    [23:30:06][ARM ANOMALY][2]
    [23:30:06]IRQ:000000d2 00000010?00401e0c 00005334 
    [23:30:06][ARM ANOMALY][2]
    [23:30:06][ARM ANOMALY][2]
    [23:30:07][ARM ANOMALY][2]
    [23:30:07][ARM$ANOMALY][2]
    [23:30:07]V:BK7231�r�r�j
    [23:30:07][ARM ANOMALY][2]
    [23:30:07][ARM ANOMALY][2]
    [23:30:07][ARM ANOMALY][2]
    [23:30:07][ARM ANOMALY][2]
    [23:30:07][ARM AOOMALY][2]
    [23:30:07][ARM AOOMALY][2]
    [23:30:07]FIR:000000d1 00000010 00401ff 3624000Mj
    [23:30:07][ARM ANOMALY][2]
    [23:30:07][ARM ANOMALY][2]
    [23:30:07][ARM ANOMALY][2]
    [23:30:08][ARM ANOMALY][2]
    [23:30:08][AR} ANOMALY][2]
    [23:30:08]REG:cpsr    0sp{r     r13      r14�
    [23:30:08][ARM"ANOMALY][2]
    [23:30:08][ARM ANOMALY][2]
    [23:30:08][ARM ANOMALY][2]
    [23:30:08][ARM ANOMALY][2]
    [23:30:08][ARM ANOMALY][2]
    [23:30:08]IRQ:000000f2 00000010 00401e0c80000M&j
    [23:30:08][ARM ANOMALY][2]
    [23:30:08][ARM ANOMALY][2]
    [23:30:08][ARM ANOMALY][2]
    [23:30:08][ARM<ANOMALY][2]
    [23:30:08]SYS:000000df<         0040192c 0000015j
    [23:30:08][ARM ANOMALY][2]
    [23:30:09][ARM ANOMALY][2]
    [23:30:09][ARM ANOMALY][2]
    [23:30:09][ARM ANOMALY][2]
    [23:30:09]V:BK7231N_1	r�j
    [23:30:09]J 0x10000CC��I5�ANOMALY][2]
    [23:30:09][ARM ANOMALY][2]
    [23:30:09][ARM ANOMALY][2]
    [23:30:09][ARM ANOMALY][2]
    [23:30:09][ARM ANOMALY][2]
    [23:30:09][ARM ANOMALY][2]
    [23:30:09][ARM ANOMALY][2]
    [23:30:09][ARM ANOMALY][2]
    [23:30:09]SVC:000000D3          00401C1C 000033ACM
    [23:30:09][ARM ANOMALY][2]
    [23:30:09][ARM ANOMALY][2]
    [23:30:10][ARM ANOMALY][2]
    [23:30:10][ARM ANOMALY][2]
    [23:30:10][ARM ANOMALY][2]
    [23:30:10][ARM ANOMALY][2]
    [23:30:10][ARM ANOMALY][2]
    [23:30:10][ARM ANOMALY][2]
    [23:30:10]SYS:000000df          0040192c 00000158j
    [23:30:10][ARM�P�*1eum�]
    [23:30:10][ARM ANOMALY][2]
    [23:30:10][ARM ANOMALY][2]
    [23:30:10][ARM ANOMALY][2]
    [23:30:10][ARM ANOMALY][2]
    [23:30:10][ARM/ANOM�LY][2]
    [23:30:11][ARM ANOMALY][2]
    [23:30:11][ARM ANOMALY][2]
    [23:30:11][ARM ANOMALY][2]
    [23:30:11][ARM ANOMALY][2]
    [23:30:11][ARM ANOMALY][2]
    [23:30:11][ARM ANOMALY][2]
    [23:30:11][ARM ANOMALY][2]
    [23:30:11][ARM ANOMALY][2]
    [23:30:11][ARM ANOMALY][2]
    [23:30:11][ARM ANOMALY][2]
    [23:30:12][ARM ANOMALY][2]
    [23:30:12][ARM ANOMALY][2]
    [23:30:12][ARM ANOMALY][�]
    [23:30:12][ARM ANOMALY][2]
    [23:30:12][ARM ANOMALY][2]
    [23:30:12]FIR:000000d1 00400010 00401ffc 36����j
    [23:30:12][ARM ANOMALY][2]
    [23:30:13][ARM ANOMALY][2]
    [23:30:13][ARM ANOMALY][2]
    [23:30:13][ARM ANOMALY][2]
    [23:30:13][ARM ANOMALY][2]
    [23:30:13][ARM>ANOMALY][2]
    [23:30:13][ARM ANOMALY][2]
    [23:30:13][ARM ANOMALY][2]
    [23:30:13][ARM ANOMALY][2]
    [23:30:13][ARM ANOMALY][2]
    [23:30:13]J 0�L���j
    [23:30:13][ARM�ANOMALY][2]
    [23:30:13][ARM ANOMALY][2]
    [23:30:14][ARM ANOMALY][2]
    [23:30:14][ARM ANOMALY][2]
    [23:30:14][ARM ANOMALY][2]
    [23:30:14][ARM ANOMALY][2]
    [23:30:14][ARM ANOMALY][2]
    [23:30:14][ARM ANOMANY][2]
    [23:30:14][ARM ANOMALY][2]
    [23:30:14][ARM ANOMALY][2]
    [23:30:14][ARM ANOMALY][2]
    [23:30:14][aRM ANOMALY][2]
    [23:30:15]FIR:000000d1 00000010 004�1ffc 37250105 -
    [23:30:15][ARM }NOMALY][2]
    [23:30:15]SYS:000000d������ʒ�0������j
    [23:30:15][ARM ANOMALY][2]
    [23:30:15][ARM ANOMALY][2]
    [23:30:15][ARM ANOMALY][2]
    [23:30:15][ARM ANOMALY][2]
    [23:30:15][ARM ANOMALY][2]
    [23:30:15][ARM ANOMALY][2]
    [23:30:15][qRM ANOMALY][2]
    [23:30:15][ARM ANOMALY][2]
    [23:30:15]J 0x10000
    [23:30:15][ARM ANOMALY][2]
    [23:30:15][ARM ANOMALY][2]
    [23:30:16][ARM ANOMALY][2]
    [23:30:16][ARM ANOMALY][2]
    [23:30:16][ARM ANOMALY][2]
    [23:30:16][ARM ANOMAMY][�]
    [23:30:16][ARM ANOMALY][2]
    [23:30:16][ARM ANOMALY][2]
    [23:30:16][ARM ANOMALY][2]
    [23:30:16][ARM ANOMALY][2]
    [23:30:16][ARM ANOMALY][2]
    [23:30:16][ARM ANOMALY][2]
    [23:30:16][ARM ANOMALY][2]
    [23:30:16][ARM ANOMALY][2]
    [23:30:17][ARM ANOMALY][2]
    [23:30:17][ARM ANOMALY][2]
    [23:30:17][ARM ANOMALY][2]
    [23:30:17][ARM ANOMALY][2]
    [23:30:17][ARM ANOMALY][2]
    [23:30:17][ARM ANOMALY][2]
    [23:30:17]ST:0001AD12
    [23:30:17][ARM ANOMALY][2]
    [23:30:17][qRM ANOMALY][2]
    [23:30:17]REG:cpsr     spsr     r13      r14�
    [23:30:17][ARM ANOMALY][2]
    [23:30:17][ARM ANOMALY][2]
    [23:30:17][ARM ANOMALY][2]
    [23:30:18][ARM ANOMALY][2]
    [23:30:18][ARM ANOMALY][2]
    [23:30:18][ARM ANOMALY][2]
    [23:30:18][ARM ANOMALY][2]
    [23:30:18]SYS:000000df          0040192,��������j
    [23:30:18][ARM ANOMALY][2]
    [23:30:18][ARM ANOMALY][2]
    [23:30:18][�SM ANOMALY][2]
    [23:30:18][A�M ANOMALY][2]
    [23:30:18][ARM ANOMALY][2]
    [23:30:18]ST:000LPT�j
    [23:30:18][ARM ANOMALY][2]
    [23:30:18][ARM ANOMALY][2]
    [23:30:18][ARM ANOMALY][2]
    [23:30:19][ARM ANOMALY][2]
    [23:30:19][ARM ANOMALY][2]
    [23:30:19][ARM ANOMALY][2]
    [23:30:19][ARM aNOMALY][2]
    [23:30:19][ARM ANOMALY][2]
    [23:30:19][ARM ANOMALY][2]
    [23:30:19]FIR:000000d1 00000010 00401ffc 37�M���j
    [23:30:19][ARM ANOMALY][2]
    [23:30:19][ARM ANOMALY][2]
    [23:30:19][ARM ANOMALY][2]
    [23:30:19][ARM ANOMALY][2]
    [23:30:19][ARM ANOMALY][2]
    [23:30:19][ARM ANOMALY][2]
    [23:30:20][ARM ANOMALY][2]
    [23:30:20][ARM ANOMALY][2]
    [23:30:20][ARM ANOMALY][2]
    [23:30:20][ARM ANOMALY][2]
    [23:30:20][ARM ANOMALY][2]
    [23:30:20][ARM ANOMALY][2]
    [23:30:20]REG:cpsr     spsr     r13      r14�
    [23:30:20][ARM ANOMALY][�]
    [23:30:20][ARM ANOMALY][2]
    [23:30:20][ARM ANOMALY][2]
    [23:30:21][ARM ANOMALY][2]
    [23:30:21][ARM ANOMALY][2]
    [23:30:21][ARM ANOMALY][2]
    [23:30:21][ARM ANOMALY][2]
    [23:30:21]V:BK7��r}�.0.1
    [23:30:21][ARM ANOMALY][2]
    [23:30:21][ARM ANOMALY][2]
    [23:30:21]SYS:000p00df          0040192c 00�����j
    [23:30:21][ARM ANOMALY][2]
    [23:30:21][ARM ANOMALY][2]
    [23:30:21][ARM ANOMALY][2]
    [23:30:21]SVC:000000D3          00601C1C 000033ACM
    [23:30:21][ARM ANOMALY][2]
    [23:30:21][ARM ANOMALY][2]
    [23:30:21][ARM ANOMALY][2]
    [23:30:22][ARM ANOMALY][2]
    [23:30:22][ARM ANOMALY][2]
    [23:30:22]IRQ:000000d2 00000010 00401e0c 0������j
    [23:30:22][ARM ANOMALY_[2]
    [23:30:22][ARM ANOMALY][2]
    [23:30:22][AZM ANOMALY][2]
    [23:30:22][ARM ANOMALY][2]
    [23:30:22]FIR:000000d1 00000010 00401ffc �������j
    [23:30:22][ARM ANOMANY][2]
    [23:30:22][ARM ANOMALY][2]
    [23:30:22]IRQ:000000d2 00000010 00401e0c 0000531c �
    [23:30:22][ARM ANOMALY][2]
    [23:30:22][ARM ANOMALY][2]
    [23:30:22][ARM ANOMALY][2]
    [23:30:23][ARM ANOMALY][2]
    [23:30:23][ARM ANOMALY][2]
    [23:30:23][ARM ANOMALY][2]
    [23:30:23][ARM ANOMALY][2]
    [23:30:23][ARM ANOMALY][2]
    [23:30:23]REG:cpsr     spsr (   r13      r14M
    [23:30:23][ARM ANOMALY][2]
    [23:30:24][ARM ANOMALY][2]
    [23:30:24][ARM ANOMALY][2]
    [23:30:24][A^M ANOMALY][2]
    [23:30:24][ARM ANOMALY][2]
    [23:30:24][ARM ANOMALY][2]
    [23:30:24][ARM ANOMALY][2]
    [23:30:24][ARM ANOMALY][2]
    [23:30:24][ARM ANOMALY]�2]
    [23:30:24][ARM ANOMALY][2]
    [23:30:24][ARM ANOMALY][2]
    [23:30:24][ARM ANOMALY][2]
    [23:30:24]FIR:00000�d1 00000010 00401ffc 3625�NLMj
    [23:30:25][�RM ANOMALY][2]
    [23:30:25][ARM A��*1eum�]
    [23:30:25]J 0x10��j
    [23:30:25][ARM ANOMALY][2]
    [23:30:25]�'�����r}�.0.1�
    [23:30:25][ARM ANOMALY][2]
    [23:30:25][ARM ANOMALY][2]
    [23:30:25][ARM ANOMALY][2]
    [23:30:25]FIR:00000"� 00000010 00401ffc 3625ʊ�j
    [23:30:25][ARM ANOMALY][2]
    [23:30:25][ARM ANOMALY][2]
    [23:30:25][ARM ANOMALY][2]
    [23:30:25][ARM ANOMALY][2]
    [23:30:25][ARM ANOMALY][2]
    [23:30:25][ARM0ANOMALY][2]
    [23:30:26][ARM ANOMALY][2]
    [23:30:26][ARM ANOMALY][2]
    [23:30:26][ARM ANOMALY][2]
    [23:30:26]FIR:000000d1 00000010 00401ffc 36250915 �
    [23:30:26][ARM ANOMALY][2]
    [23:30:26][ARM ANOMALY][2]
    [23:30:26]V:BK723L�r�r�j
    [23:30:26][ARM ANOMALY][2]
    [23:30:26][ARM ANOMALY][2]
    [23:30:26][ARM ANOMALY][2]
    [23:30:26][ARM ANOMALY][2]
    [23:30:26][ARM ANOMALY][2]
    [23:30:26][ARM ANOMALY][2]
    [23:30:26][ARM ANOMALY][2]
    [23:30:27][ARM ANOMALY][2]
    [23:30:27]FIR:000000d1 00000010 00401ffc 3625091Mj
    [23:30:27][ARM ANOMALY][2]
    [23:30:27][ARM ANOMALY][2]
    [23:30:27][ARM ANOMALY][2]
    [23:30:27]V:BK7231Nr�r�j
    [23:30:27][ARM ANOMALY][2]
    [23:30:27][ARM ANOMALY][2]
    [23:30:27]V;BK7231N_1.0)j
    [23:30:27][ARM ANOMALY][2]
    [23:30:27][ARM ANOMALY][2]
    [23:30:27][ARM ANOMALY][2]
    [23:30:27][ARM ANoMALY][2]
    [23:30:27][ARM ANOMALY][2]
    [23:30:28][ARM ANOMALY][2]
    [23:30:28]V:BK7231Nr�r�j
    [23:30:28][ARM ANOMALY][2]
    [23:30:28][ARM ANOMALY][2]
    [23:30:28][ARM ANOMALY][2]
    [23:30:28][ARM ANOMALY][2]
    [23:30:28][ARM ANOMALY][2]
    [23:30:28][ARM ANOMALY][2]
    [23:30:28][ARM ANOMALY][2]
    [23:30:28][ARM ANOMALY][2]
    [23:30:28][ARM ANOMALY][2]
    [23:30:28]SYS:000000df� <       00401=rc 00�����j
    [23:30:28][ARM ANOMALY][2]
    [23:30:28][ARM ANOMALY][2]
    [23:30:29][ARM ANOMALY][2]
    [23:30:29][ARM ANOMALY][2]
    [23:30:29][ARM ANOMALY][2]
    [23:30:29][ARM AnOMALY][2]
    [23:30:29][ARM ANOMALY][2]
    [23:30:29][ARM ANOMALY][2]
    [23:30:29][ARM ANOMALY][2]
    [23:30:29]SYS:000000df          0040192c 0000�LMj
    [23:30:29]IRQ:000000d2 00000010 00401e0c 00005374 
    [23:30:29][ARM ANOMALY][2]
    [23:30:29][ARM ANOMALY][2]
    [23:30:29][ARM ANOMALY][2]
    [23:30:30][ARM ANOMALY][2]
    [23:30:30][ARM ANOMALY][2]
    [23:30:30][ARM ANOMALY][2�
    [23:30:30][ARM ANOMALY][2]
    [23:30:30][ARM ANOMALY][2]
    [23:30:30][ARM ANOMALY][2]
    [23:30:30][ARM ANOMALY][2]
    [23:30:30][ARM ANOMALY][2]
    [23:30:30][ARM ANOMALY][2]
    [23:30:30]IRQ:000000d2 00000010 00401e0c 00005&&j
    [23:30:30][ARM ANOMALY][2]
    [23:30:31][ARM A�OMAOY][2]
    [23:30:31][ARM ANOMALY][2]
    [23:30:31][ARM ANOMALY][2]
    [23:30:31][ARM ANOMALY][2]
    


    So either I am specifying chunks wrong or this way its not possible to flash.
  • ADVERTISEMENT
  • #4 21332041
    spin55
    Level 17  
    Battery-powered devices that have a TuyaMCU chip control the power of the Wi-Fi module (in this case CBU).

    To prolong the activity time of the Wi-Fi module you have to press and hold the pairing button. This will prolong uptime and will probably allow you to flash the wifi module without having to cut tracks or desolder it.
  • ADVERTISEMENT
  • #5 21332058
    divadiow
    Level 34  
    or solder power directly to CBU too so the TuyaMCU has no control over it?
  • #6 21332490
    viktorpot
    Level 2  
    >>21332041

    Nice one! It helped even though I had to keep pressing the button and letting it go every second in order to see the flash to finish.
    After reboot I can connect to device AP, but it has some problem to keep up, I think it might be in some reboot loop. It stays up for few seconds then disconnects and the pairing button has to be pressed in order to bring it back online. So I have to reconnect every x seconds to configure it.

    Logs from the web app

    
    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 119 #######
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 2 changes count.
    Error:CMD:lfs is absent
    Info:GEN:PIN_SetupPins pins have been set up.
    Info:MAIN:Main_Init_Before_Delay done
    Info:MAIN:Main_Init_Delay
    Info:MAIN:Main_Init_Delay done
    Info:MAIN:Main_Init_After_Delay
    Info:MAIN:Using SSID [Cottage]
    Info:MAIN:Using Pass [****]
    Info:MQTT:MQTT_RegisterCallback called for bT obk50C00822/ subT obk50C00822/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT bekens_n/ subT bekens_n/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/obk50C00822/ subT cmnd/obk50C00822/+
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/bekens_n/ subT cmnd/bekens_n/+
    Info:MQTT:MQTT_RegisterCallback called for bT obk50C00822/ subT obk50C00822/+/get
    Error:CMD:LFS_ReadFile: lfs is absent
    Info:CMD:CMD_StartScript: failed to get file autoexec.bat
    Info:MAIN:Main_Init_After_Delay done
    Info:MAIN:Time 1, idle 267457/s, free 80664, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 2, idle 191211/s, free 80664, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 3, idle 189233/s, free 80664, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 4, idle 189215/s, free 80664, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 5, idle 190308/s, free 80664, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Registered for wifi changes
    Info:MAIN:Connecting to SSID [Cottage]
    Info:MAIN:ssid:Cottage key:****
    Info:MAIN:Time 6, idle 181037/s, free 74720, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:Time 7, idle 182831/s, free 74720, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 8, idle 85176/s, free 74192, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 9, idle 0/s, free 74192, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 10, idle 0/s, free 74192, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=18:de:50:c0:08:22
    Info:GEN:sta: 0, softap: 0, b/g/n
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Main_Init_Before_Delay
    Info:CFG:####### Boot Count 128 #######
    Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 2 changes count.
    Error:CMD:lfs is absent
    Info:GEN:PIN_SetupPins pins have been set up.
    Info:MAIN:Main_Init_Before_Delay done
    Info:MAIN:Main_Init_Delay
    Info:MAIN:Main_Init_Delay done
    Info:MAIN:Main_Init_After_Delay
    Info:MAIN:Using SSID [Cottage]
    Info:MAIN:Using Pass [*****]
    Info:MQTT:MQTT_RegisterCallback called for bT obk50C00822/ subT obk50C00822/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT bekens_n/ subT bekens_n/+/set
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/obk50C00822/ subT cmnd/obk50C00822/+
    Info:MQTT:MQTT_RegisterCallback called for bT cmnd/bekens_n/ subT cmnd/bekens_n/+
    Info:MQTT:MQTT_RegisterCallback called for bT obk50C00822/ subT obk50C00822/+/get
    Error:CMD:LFS_ReadFile: lfs is absent
    Info:CMD:CMD_StartScript: failed to get file autoexec.bat
    Info:MAIN:Main_Init_After_Delay done
    Info:MAIN:Time 1, idle 265636/s, free 80664, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 2, idle 191290/s, free 80664, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 3, idle 189128/s, free 80664, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 4, idle 189202/s, free 80664, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 5, idle 190337/s, free 80664, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Registered for wifi changes
    Info:MAIN:Connecting to SSID [Cottage]
    Info:MAIN:ssid:Cottage key:*****
    Info:MAIN:Time 6, idle 181251/s, free 74712, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:Time 7, idle 186755/s, free 74712, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 8, idle 85246/s, free 74176, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 9, idle 0/s, free 74176, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 10, idle 0/s, free 74176, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=18:de:50:c0:08:22
    Info:GEN:sta: 0, softap: 0, b/g/n
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 11, idle 92232/s, free 75112, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:Time 12, idle 188653/s, free 75152, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38 
    
  • #7 21332495
    insmod
    Level 24  
    >>21332490 That is not a reboot loop, this it the MCU cutting power to wifi module. Connect GND directly to CBU, this should prevent any reboots until you configure the OBK settings.

Topic summary

The discussion revolves around difficulties in flashing a sensor with a green PCB and white CBU module, specifically a TuyaMCU device. The user initially attempted to flash the device using a method that worked for a similar sensor with a blue PCB but encountered random errors during the process. Suggestions included directly connecting RX and TX to the module, resoldering connections, and keeping the pairing button pressed to maintain power to the Wi-Fi module during flashing. The user reported partial success in flashing the bootloader but faced issues with the device entering a reboot loop, which was identified as the MCU cutting power to the Wi-Fi module. Recommendations were made to connect GND directly to the CBU to stabilize the device during configuration.
Summary generated by the language model.
ADVERTISEMENT