Comments (36)
Hi, please read:
https://docs.libretiny.eu/docs/platform/beken-72xx/keys/
This explains why you're getting the error message.
For dumping the firmware and flashing new one, try using this version of bk7231tools:
https://github.com/tuya-cloudcutter/bk7231tools/tree/feature/flash-refactor
It should correctly identify the chip. Please post a screenshot of the chip info window. If you can, a ROM dump and a firmware dump would be appreciated too.
from ltchiptool.
dump
readResult_BK7231N_QIO_2343_2024-28-1-10-44-05 sber e14.zip
from ltchiptool.
dump2 from other lamp
readResult_BK7231N_QIO_2024-17-3-11-58-59 sber e14-2.zip
from ltchiptool.
Have you flashed anything to the device before dumping that firmware? It has odd data at 0x132000, which look like some firmware which shouldn't be there.
from ltchiptool.
both dump genue from new lamps
from ltchiptool.
I have another new lamp - I can still read from it
from ltchiptool.
e14-2.zip
first file from new lamp which never turned on
second file after ota update to last firmware
from ltchiptool.
ESPHome config for these two devices:
esphome:
name: my-device
platformio_options:
board_build.bkcrypt_coeffs: 7d1ff9b3e3ffefde5d93b57eefefeb8b
board_build.bkota.key: 908f771bac2ff1aa619b897c14c5a88b
board_build.bkota.iv: 1e647fab598d727c
board_flash.download: "0x132000+0xAE000"
from ltchiptool.
friend, maybe i ask stupid question
i create simple yams and for esphome start
esphome:
name: "sber-e14"
platformio_options:
board_build.bkcrypt_coeffs: 7d1ff9b3e3ffefde5d93b57eefefeb8b
board_build.bkota.key: 908f771bac2ff1aa619b897c14c5a88b
board_build.bkota.iv: 1e647fab598d727c
board_flash.download: "0x132000+0xAE000"
bk72xx:
board: generic-bk7231n-qfn32-tuya
logger:
web_server:
captive_portal:
mdns:
api:
reboot_timeout: 15min
encryption:
key: !secret api_encryption_key
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
text_sensor:
- platform: libretiny
version:
name: LibreTiny Version
sensor:
- platform: wifi_signal
name: WiFi_Signal
- platform: uptime
name: uptime_sensor
same as UF2 - program vin ltchiptool and crc error
from ltchiptool.
As I mentioned, you need to use the other branch of bk7231tools:
https://github.com/tuya-cloudcutter/bk7231tools/tree/feature/flash-refactor
First install ltchiptool using Python, with pip install ltchiptool[gui]
. Then download this branch, open a terminal inside the downloaded directory, and run pip install .
. Then start ltchiptool using python -m ltchiptool gui
.
from ltchiptool.
as i understand it not work at windows
tomorrow try install ubuntu.
from ltchiptool.
It does work on Windows. If you install Python 3.10 or newer it will work on Windows.
from ltchiptool.
ok thanks i try
from ltchiptool.
i install python - do what you say
when program UF2 file again CRC error
from ltchiptool.
You didn't run the pip install .
command with downloaded bk7231tools repo. Make sure to download the feature/flash-refactor
branch, not master
.
from ltchiptool.
Now the firmware is written successfully without crc errors, but lamp not start - not connect to wi-fi
from ltchiptool.
You haven't added Wi-Fi AP to the config. Please do that and try again.
Also, in order to troubleshoot this, you'll need to connect UART to TX2 and view the device log output.
from ltchiptool.
wifi session present with my wifi and password
i try recreate yaml and try reprogram again, but now receive it
from ltchiptool.
Please post a screenshot of "get chip info" window. This version of bk7231tools should give more helpful information.
from ltchiptool.
from ltchiptool.
When i return stok - lamp start
After what i try again program UF2 - same error what protected
from ltchiptool.
Worked for me, used OTA image and flashed at 0x132000, now it boots.
from ltchiptool.
Worked for me, used OTA image and flashed at 0x132000, now it boots.
plz more info how you to it. you create ota update file at esphome and program it from 0x132000?
this?
from ltchiptool.
Yes
from ltchiptool.
Yes
Thx. at evening i try
from ltchiptool.
OpenBK7231N_App_1.0.0.zip
OpenBeken, if needed. Flash at 0x132000, doesn't support default OTA packages (need to build manually). Tried QIO, but it doesn't boot.
@kuba2k2 is there a way to build and flash 1.0.1 bootloader? And will it support unencrypted OTA?
from ltchiptool.
Just disassembled another lamp, and this method didn't work. So i erased the flash (either erase fully and flash bootloader only and restore RF, or start flashing backup, and after it wrote sector 0x10000 remove power). Then just flash uf2.
from ltchiptool.
@kuba2k2 is there a way to build and flash 1.0.1 bootloader? And will it support unencrypted OTA?
No. The encryption keys are stored in eFuse and are not changeable.
from ltchiptool.
@kuba2k2 is there a way to build and flash 1.0.1 bootloader? And will it support unencrypted OTA?
No. The encryption keys are stored in eFuse and are not changeable.
I am not talking about keys, but about bootloader itself. AFAIK there are bootloaders, which will allow OTA without encryption, and then flash it while encrypting. Not sure about that it is how it works. What about flashing bootloader? I built OpenBK7231N sdk with correct keys, and tried flashing both bk7231n_bootloader_enc.bin and QIO app at 0x0. Neither booted.
from ltchiptool.
We don't have bootloader sources. All we have are binaries from either Beken SDKs or extracted from devices. The bootloader needs to know the eFuse encryption keys in order to run the OTA update. It is possible to modify an existing bootloader (say, 1.0.1) to change its encryption keys and enable unencrypted OTA, but it would require decompiling and modifying it, as well as packaging the bootloader binary to work with the device's keys.
An easier option is to simply pass the existing keys to LibreTiny in the ESPHome YAML, which generates a firmware binary that can just be flashed to 0x11000.
If that doesn't work, then either you're doing something wrong, or the encryption routines used in LibreTiny are somehow incorrect. It is believed that they could be wrong, because with a particular set of keys (a different SBER device) they were crashing, while working just fine on the device.
If you want us to try and fix it, please:
- compile ESPHome firmware with correct keys for your particular device
- grab the OTA and UF2 files from that particular build
- flash it using the manual OTA method (at 0x132000)
- dump the entire flash firmware (2 MiB)
- attach both the flash dump (2 MiB .bin) and the UF2 file
from ltchiptool.
Understood. I thought, reading build.sh and seeing bootloader encryption, that it is built from source. LibreTiny OTA works normally, i thought that replacing stock bootloader will allow OpenBeken OTA to function, without manually rebuilding it from source.
from ltchiptool.
I'm not familiar with the OpenBeken codebase. I don't know what solutions they use to deal with OTA and encryption.
I also don't know what device you're using. If you have another SBER device, OTA packages are most likely encrypted with a non-default key. LibreTiny allows to change the encryption keys, OpenBeken doesn't, AFAIK.
from ltchiptool.
My device is the same as in the issue, SBER SBDV-00117 (LED C37 E14). Encryption keys are from your earlier reply
ESPHome config for these two devices:
esphome: name: my-device platformio_options: board_build.bkcrypt_coeffs: 7d1ff9b3e3ffefde5d93b57eefefeb8b board_build.bkota.key: 908f771bac2ff1aa619b897c14c5a88b board_build.bkota.iv: 1e647fab598d727c board_flash.download: "0x132000+0xAE000"
LibreTiny works OK with them, as does OpenBeken. But OpenBeken requires to be built manually, while replacing original tuya keys with sber ones, and OTA will work only with manually built binaries, not those, provided in github-actions.
from ltchiptool.
Yes, as I mentioned, OpenBeken uses default keys and not SBER keys, and doesn't allow changing it. If you want to use OpenBeken, you're going to need to manually build it, or reach out to the project author to allow that.
Also note that the OTA key is not related to the encryption key (bkcrypt_coeffs). Your device might use the same OTA key but a different encryption key, in which case flashing UF2 will not work, but flashing manual OTA will.
from ltchiptool.
bkcrypt_coeffs is probably the same. I erased my device fully, then flashed only bootloader and RF, and then flashed UF2. It worked normally.
from ltchiptool.
bkcrypt_coeffs is probably the same. I erased my device fully, then flashed only bootloader and RF, and then flashed UF2. It worked normally.
it work!!!! THANKS
from ltchiptool.
Related Issues (20)
- Avast detects virus in ltchiptool-v4.6.0.exe HOT 24
- Undefined method `Serial.set_buffer_size` method for non windows environment
- Problems flashing a new rtl8710bx board HOT 10
- Error running ltchiptool gui under macOS 13.6.1 HOT 12
- Unable to convert some datapoints. HOT 4
- Segmentation fault in Fedora 39 HOT 3
- Help with a Midea SmartKit Dongle HOT 10
- malware detected ?? HOT 2
- Chip Type - Unrecognized (0x48405F31) HOT 4
- Firmware Dump Analysis HOT 2
- Tuya Storage decryption HOT 13
- v4.11.0 throws errors ... HOT 5
- RuntimeError: Error: 28841002: No permissions. Your subscription to cloud development plan has expired. HOT 7
- ltchiptool-v4.11.1.exe triggers MCAfee Virus threat ti!EBCF3BF55DBF - 4.11.0 does not trigger HOT 1
- Unknown bootloader CRC - 0x2739019F - please report this on GitHub issues! HOT 9
- Unknown bootloader CRC - 0xB7BFA0CE - please report this on GitHub issues HOT 7
- Using Tuya API - subscription cloud development plan has expired. HOT 1
- ltchiptool.gui.base.zc is deprecated ... HOT 2
- Failed to write flash
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ltchiptool.