Code Monkey home page Code Monkey logo

Comments (30)

kuba2k2 avatar kuba2k2 commented on August 18, 2024 1

You should use generic-bk7231t-qfn32-tuya, not the N variant. T is the closest to your chip.

from ltchiptool.

kuba2k2 avatar kuba2k2 commented on August 18, 2024

Try running Get chip info.

It might be falsely detecting the chip type (T/N/etc) which could cause incorrect reading options.

Also, please post the full log of the flash operation (even better with enabled debug log level).

from ltchiptool.

I-hate-2FA avatar I-hate-2FA commented on August 18, 2024

image

W: PyInstaller\loader\pyimod02_importers.py:419: UserWarning: ltchiptool.gui.base.zc is deprecated, migrate to ltchiptool.gui.mixin.zc

I: Loaded settings from C:\Users\Admin\AppData\Roaming\ltchiptool\gui.json
I: Found new device: COM11 - Silicon Labs CP210x USB to UART Bridge - Silicon Labs (10C4/EA60)
D: Log level changed
D: Started FlashThread
D: Starting READ_INFO operation; file = C:\Users\Admin\Downloads\ltchiptool_bk72xx_2024-07-31_03-11-32.bin, port = COM11 @ 115200
D: Connecting
D: Connecting
D: Connecting
D: Connecting
D: Reading 4k page at 0x000000 (0.00%)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 0)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 1)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 2)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 3)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 4)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 5)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 6)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 7)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 8)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 9)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 10)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 11)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 12)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 13)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 14)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 15)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 16)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 17)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 18)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 19)
W: Reading failure @ 0x0 (Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))), retrying (attempt 20)
E: An error has occurred
E: ValueError: Non-zero status code: BkFlashRead4KResp(status=6, start=0x0, data=bytes(1))
E: |-- File "ltchiptool\gui\work\base.py", line 24, in run
E: |-- File "ltchiptool\gui\work\flash.py", line 69, in run_impl
E: |-- File "ltchiptool\gui\work\flash.py", line 109, in _link
E: |-- File "ltchiptool\soc\bk72xx\flash.py", line 102, in flash_connect
E: |-- File "bk7231tools\serial\linking.py", line 28, in connect
E: |-- File "bk7231tools\serial\linking.py", line 91, in detect_chip
E: |-- File "bk7231tools\serial\cmd_hl_flash.py", line 100, in flash_read_bytes
E: |-- File "bk7231tools\serial\cmd_hl_flash.py", line 85, in flash_read
E: |-- File "bk7231tools\serial\cmd_ll_flash.py", line 105, in flash_read_4k
E: |-- File "bk7231tools\serial\protocol.py", line 196, in command
D: Stopped FlashThread
D: Started TerminalThread
D: Terminal opened

from ltchiptool.

I-hate-2FA avatar I-hate-2FA commented on August 18, 2024

so is this chip supported by libretiny platform, or did i just wasted my money , i thought all 7231 is supported so i bought too much of them at once

from ltchiptool.

kuba2k2 avatar kuba2k2 commented on August 18, 2024

It can be supported, don't give up yet.

Apparently this bootloader could be locking readout from 0x0.

Try using bk7231tools to read the flash chip contents:
https://github.com/tuya-cloudcutter/bk7231tools

bk7231tools read_flash -d COM11 -s 0x11000 -l 0x200000 dump.bin

from ltchiptool.

I-hate-2FA avatar I-hate-2FA commented on August 18, 2024
C:\Users\Admin>bk7231tools read_flash -d COM11 -s 0x11000 -l 0x200000 dump.bin
Unknown bootloader CRC - 0xBEFD79D6 - please report this on GitHub issues!
Reading 4k page at 0x011000 (0.00%)
BK72xx connected - protocol: BASIC_BEKEN, chip: None, bootloader: None, chip ID: None, boot version: None
Flash size - detecting...
 - Checking wraparound at 0x211000
Flash size detected - 0x200000
Connected! Chip info: Unknown / Flash ID: None / Flash size: 0x200000 / Protocol: BASIC_BEKEN
Reading 0x200000 bytes at 0x11000 would go past the flash memory end

from ltchiptool.

kuba2k2 avatar kuba2k2 commented on August 18, 2024

Right, so it seems it detects the flash size correctly.
Try with -s 0x0.

from ltchiptool.

I-hate-2FA avatar I-hate-2FA commented on August 18, 2024

dump.bin.txt
it seems to work, i used a brand new chip for this, cuz idk if delid have damaged it

from ltchiptool.

kuba2k2 avatar kuba2k2 commented on August 18, 2024

Just curious, where did you find these BK7231S chips? We've never seen this particular model before, are these available to buy somewhere as bare chips?

from ltchiptool.

I-hate-2FA avatar I-hate-2FA commented on August 18, 2024

Just curious, where did you find these BK7231S chips? We've never seen this particular model before, are these available to buy somewhere as bare chips?

https://fcc.report/FCC-ID/2AR7VC-8133U/4225568.pdf
i bought 15 smart bulb for $4, it have this chip,isolated mains driver, pwm controlled RGBCCT

from ltchiptool.

I-hate-2FA avatar I-hate-2FA commented on August 18, 2024

IMG_20240731_175917

IMG_20240731_175906

from ltchiptool.

I-hate-2FA avatar I-hate-2FA commented on August 18, 2024

is there any chance for this to work

from ltchiptool.

kuba2k2 avatar kuba2k2 commented on August 18, 2024

Yes. You can probably just flash ESPHome, provided that you use this in your YAML:

esphome:
  name: my-device-name
  platformio_options:
    board_build.bkcrypt_coeffs: 00000000000000000000000000000000
    board_build.bkota.key: 0123456789ABCDEF0123456789ABCDEF
    board_build.bkota.iv: 0123456789ABCDEF
    board_flash.calibration: 0x1F3000+0x1000

Note that the bootloader on this device is the oldest we've seen, it looks very much different from all the standard bootloaders.
Because of this, I'm not sure if this device will support OTA as-is.

After compiling ESPHome, try flashing the image_bk7231t_app.0x011000.rbl file from the build directory to offset 0x11000, using the tool that works for you.

As long as you don't flash anywhere in between 0x0 and 0x11000, you should be fine.

from ltchiptool.

I-hate-2FA avatar I-hate-2FA commented on August 18, 2024

what cpu should i select in esphome
is board: generic-bk7231n-qfn32-tuya correct

from ltchiptool.

I-hate-2FA avatar I-hate-2FA commented on August 18, 2024

it cannot compile
image

from ltchiptool.

kuba2k2 avatar kuba2k2 commented on August 18, 2024

Hm, maybe YAML is converting the coeffs to integer. Try wrapping it in quotes, like board_build.bkcrypt_coeffs: "00000000000000000000000000000000".

from ltchiptool.

I-hate-2FA avatar I-hate-2FA commented on August 18, 2024

what version do i download for cli tool

from ltchiptool.

kuba2k2 avatar kuba2k2 commented on August 18, 2024

the Beken Application Image for direct flashing

from ltchiptool.

I-hate-2FA avatar I-hate-2FA commented on August 18, 2024

didnt work still unfortunately
image
or maybe i messed up

from ltchiptool.

I-hate-2FA avatar I-hate-2FA commented on August 18, 2024

it is not very easy to flash this because the cp2102 code not have auto reset, and i lost my ch340

from ltchiptool.

kuba2k2 avatar kuba2k2 commented on August 18, 2024

Unfortunately I don't have a fix for that. It's not possible for me to fix such low-level issues without physically owning such a chip.

You could try flashing the same RBL file using other software, such as BkWriter. It should only be used as a last resort.

from ltchiptool.

I-hate-2FA avatar I-hate-2FA commented on August 18, 2024

how can i send you one of these

from ltchiptool.

kuba2k2 avatar kuba2k2 commented on August 18, 2024

If you don't live anywhere near Poland, I think it would be much more expensive than the entire device is worth 😄

from ltchiptool.

I-hate-2FA avatar I-hate-2FA commented on August 18, 2024

it is def more expensive then this is worth, but if you cant buy it there its the only option
it is only 1.5RMB per unit i bought from china

from ltchiptool.

I-hate-2FA avatar I-hate-2FA commented on August 18, 2024

https://item.taobao.com/item.htm?id=749971518349

from ltchiptool.

I-hate-2FA avatar I-hate-2FA commented on August 18, 2024

beken writer erase flash also fail

from ltchiptool.

divadiow avatar divadiow commented on August 18, 2024

what version of bkwriter was it?

from ltchiptool.

I-hate-2FA avatar I-hate-2FA commented on August 18, 2024

1.60

from ltchiptool.

divadiow avatar divadiow commented on August 18, 2024

could try 1.7.5

https://images.tuyacn.com/smart/electronic/component/infomation/cfxjtyy7me4g.zip

from ltchiptool.

I-hate-2FA avatar I-hate-2FA commented on August 18, 2024

same problem
image

from ltchiptool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.