GithubHelp home page GithubHelp logo

libretiny-eu / ltchiptool Goto Github PK

View Code? Open in Web Editor NEW
61.0 3.0 4.0 977 KB

Universal, easy-to-use GUI flashing/dumping tool for BK7231, RTL8710B and RTL8720C.

License: MIT License

Python 96.53% C 3.47%
bk7231 bk7231t firmware hacktoberfest rtl8710bn libretiny rtl8710 rtl8720cf

ltchiptool's Introduction

ltchiptool

Universal, easy-to-use GUI flashing/dumping tool for BK7231, RTL8710B and RTL8720C. Also contains some CLI utilities for binary firmware manipulation.

Code style: black PyPI

GitHub release (latest by date including pre-releases)

Screenshot

What is this?

This repository is a collection of tools, used in the LibreTiny project, that perform some chip-specific tasks, like packaging binary images or uploading firmware to the chip.

Since v2.0.0, it contains a common, chip-independent CLI and API for interacting with supported chips in download mode (reading/writing flash).

Since v3.0.0, it contains a beginner-friendly GUI for flashing firmware or dumping flash contents.

Usage/documentation

License

MIT License

Copyright (c) 2022 Kuba Szczodrzyński

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

ltchiptool's People

Contributors

afflux avatar alufers avatar kuba2k2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ltchiptool's Issues

Error running ltchiptool gui under macOS 13.6.1

I'm trying to use ltchiptool as part of following this guide but I'm having trouble getting ltchiptool to run on my Mac (I see it's "untested" according to the docs, so perhaps this is useful feedback). FWIW, I'm on macOS 13.6.1 (22G313), I have python 3.11.6 via homebrew, and I installed wxPython and ltchiptool, but got this error when starting the gui. I tried both 4.2.3 as used in the guide, and then the current latest version (4.7.0), and got two different errors. The full output is below.

Any ideas how to get the GUI to work under macOS?

Thanks a lot in advance!

OhmBookPro13:~/Downloads > pip3 install wxpython
Collecting wxpython
  Using cached wxPython-4.2.1-cp311-cp311-macosx_10_10_universal2.whl.metadata (2.9 kB)
Requirement already satisfied: pillow in /usr/local/lib/python3.11/site-packages (from wxpython) (10.1.0)
Requirement already satisfied: six in /usr/local/lib/python3.11/site-packages (from wxpython) (1.16.0)
Requirement already satisfied: numpy in /usr/local/lib/python3.11/site-packages (from wxpython) (1.26.1)
Using cached wxPython-4.2.1-cp311-cp311-macosx_10_10_universal2.whl (31.5 MB)
Installing collected packages: wxpython
Successfully installed wxpython-4.2.1
OhmBookPro13:~/Downloads > pip3 install ltchiptool==4.2.3
Collecting ltchiptool==4.2.3
  Using cached ltchiptool-4.2.3-py3-none-any.whl.metadata (3.8 kB)
Requirement already satisfied: bitstruct<9.0.0,>=8.17.0 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool==4.2.3) (8.19.0)
Requirement already satisfied: bk7231tools<2.0.0,>=1.3.6 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool==4.2.3) (1.4.0)
Requirement already satisfied: click<9.0.0,>=8.1.3 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool==4.2.3) (8.1.7)
Requirement already satisfied: colorama<0.5.0,>=0.4.5 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool==4.2.3) (0.4.6)
Requirement already satisfied: hexdump<4.0,>=3.3 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool==4.2.3) (3.3)
Requirement already satisfied: importlib-metadata<5.0.0,>=4.12.0 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool==4.2.3) (4.13.0)
Requirement already satisfied: prettytable<4.0.0,>=3.3.0 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool==4.2.3) (3.9.0)
Requirement already satisfied: py-datastruct<0.5.0,>=0.4.0 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool==4.2.3) (0.4.0)
Requirement already satisfied: pycryptodomex<4.0.0,>=3.15.0 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool==4.2.3) (3.19.0)
Requirement already satisfied: semantic-version<3.0.0,>=2.10.0 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool==4.2.3) (2.10.0)
Requirement already satisfied: xmodem<0.5.0,>=0.4.6 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool==4.2.3) (0.4.7)
Requirement already satisfied: pyserial<4.0,>=3.5 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from bk7231tools<2.0.0,>=1.3.6->ltchiptool==4.2.3) (3.5)
Requirement already satisfied: zipp>=0.5 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from importlib-metadata<5.0.0,>=4.12.0->ltchiptool==4.2.3) (3.17.0)
Requirement already satisfied: wcwidth in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from prettytable<4.0.0,>=3.3.0->ltchiptool==4.2.3) (0.2.9)
Using cached ltchiptool-4.2.3-py3-none-any.whl (159 kB)
Installing collected packages: ltchiptool
Successfully installed ltchiptool-4.2.3
OhmBookPro13:~/Downloads > python3 -m ltchiptool gui
22:34:42: Debug: Adding duplicate image handler for 'Windows bitmap file'
22:34:42: Debug: Adding duplicate animation handler for '1' type
22:34:42: Debug: Adding duplicate animation handler for '2' type
Fatal Python error: PyGILState_Release: thread state 0x105888d28 must be current when releasing
Python runtime state: initialized

Current thread 0x00007ff84f543700 (most recent call first):
  File "/usr/local/lib/python3.11/site-packages/ltchiptool/gui/colors.py", line 128 in apply
  File "/usr/local/lib/python3.11/site-packages/ltchiptool/gui/panels/log.py", line 206 in OnPaletteChanged
  File "/usr/local/lib/python3.11/site-packages/ltchiptool/gui/main.py", line 324 in palette
  File "/usr/local/lib/python3.11/site-packages/ltchiptool/gui/main.py", line 187 in SetSettings
  File "/usr/local/lib/python3.11/site-packages/ltchiptool/gui/main.py", line 242 in OnShow
  File "/usr/local/lib/python3.11/site-packages/ltchiptool/util/../../ltchiptool/gui/__main__.py", line 30 in gui_entrypoint
  File "/usr/local/lib/python3.11/site-packages/ltchiptool/util/../../ltchiptool/gui/__main__.py", line 48 in cli
  File "/Users/cohm/Library/Python/3.11/lib/python/site-packages/click/core.py", line 783 in invoke
  File "/Users/cohm/Library/Python/3.11/lib/python/site-packages/click/core.py", line 1434 in invoke
  File "/Users/cohm/Library/Python/3.11/lib/python/site-packages/click/core.py", line 1688 in invoke
  File "/Users/cohm/Library/Python/3.11/lib/python/site-packages/click/core.py", line 1078 in main
  File "/Users/cohm/Library/Python/3.11/lib/python/site-packages/click/core.py", line 1157 in __call__
  File "/usr/local/lib/python3.11/site-packages/ltchiptool/__main__.py", line 112 in cli
  File "/usr/local/lib/python3.11/site-packages/ltchiptool/__main__.py", line 119 in <module>
  File "<frozen runpy>", line 88 in _run_code
  File "<frozen runpy>", line 198 in _run_module_as_main

Extension modules: wx._core, wx._adv, wx._xml, wx._xrc, wx._dataview (total: 5)
Abort trap: 6
OhmBookPro13:~/Downloads > python3 --version
Python 3.11.6
OhmBookPro13:~/Downloads > pip3 uninstall ltchiptool       
Found existing installation: ltchiptool 4.2.3
Uninstalling ltchiptool-4.2.3:
  Would remove:
    /usr/local/bin/ltchiptool
    /usr/local/lib/python3.11/site-packages/ltchiptool-4.2.3.dist-info/*
    /usr/local/lib/python3.11/site-packages/ltchiptool/*
    /usr/local/lib/python3.11/site-packages/ltctplugin/base/*
    /usr/local/lib/python3.11/site-packages/uf2tool/*
Proceed (Y/n)? Y
  Successfully uninstalled ltchiptool-4.2.3
OhmBookPro13:~/Downloads > pip3 install ltchiptool       
Collecting ltchiptool
  Using cached ltchiptool-4.7.0-py3-none-any.whl.metadata (3.8 kB)
Requirement already satisfied: bitstruct<9.0.0,>=8.1.1 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool) (8.19.0)
Requirement already satisfied: bk7231tools<2.0.0,>=1.3.6 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool) (1.4.0)
Requirement already satisfied: click<9.0.0,>=8.1.3 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool) (8.1.7)
Requirement already satisfied: colorama<0.5.0,>=0.4.5 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool) (0.4.6)
Requirement already satisfied: hexdump<4.0,>=3.3 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool) (3.3)
Requirement already satisfied: importlib-metadata in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool) (4.13.0)
Requirement already satisfied: prettytable<4.0.0,>=3.3.0 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool) (3.9.0)
Requirement already satisfied: py-datastruct<0.5.0,>=0.4.0 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool) (0.4.0)
Requirement already satisfied: pycryptodomex<4.0.0,>=3.9.9 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool) (3.19.0)
Requirement already satisfied: semantic-version<3.0.0,>=2.10.0 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool) (2.10.0)
Requirement already satisfied: xmodem<0.5.0,>=0.4.6 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool) (0.4.7)
Requirement already satisfied: zeroconf<1,>=0 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from ltchiptool) (0.123.0)
Requirement already satisfied: pyserial<4.0,>=3.5 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from bk7231tools<2.0.0,>=1.3.6->ltchiptool) (3.5)
Requirement already satisfied: wcwidth in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from prettytable<4.0.0,>=3.3.0->ltchiptool) (0.2.9)
Requirement already satisfied: ifaddr>=0.1.7 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from zeroconf<1,>=0->ltchiptool) (0.2.0)
Requirement already satisfied: zipp>=0.5 in /Users/cohm/Library/Python/3.11/lib/python/site-packages (from importlib-metadata->ltchiptool) (3.17.0)
Using cached ltchiptool-4.7.0-py3-none-any.whl (163 kB)
Installing collected packages: ltchiptool
Successfully installed ltchiptool-4.7.0
OhmBookPro13:~/Downloads > python3 -m ltchiptool gui
22:41:08: Debug: Adding duplicate image handler for 'Windows bitmap file'
22:41:08: Debug: Adding duplicate animation handler for '1' type
22:41:08: Debug: Adding duplicate animation handler for '2' type
Fatal Python error: PyGILState_Release: thread state 0x10617dd28 must be current when releasing
Python runtime state: initialized

Thread 0x0000700004db5000 (most recent call first):
  File "/usr/local/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/selectors.py", line 566 in select
  File "/usr/local/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 1884 in _run_once
  File "/usr/local/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 607 in run_forever
  File "/Users/cohm/Library/Python/3.11/lib/python/site-packages/zeroconf/_core.py", line 223 in _run_loop
  File "/usr/local/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 982 in run
  File "/usr/local/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1045 in _bootstrap_inner
  File "/usr/local/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1002 in _bootstrap

Current thread 0x00007ff84f543700 (most recent call first):
  File "/usr/local/lib/python3.11/site-packages/ltchiptool/gui/colors.py", line 128 in apply
  File "/usr/local/lib/python3.11/site-packages/ltchiptool/gui/panels/log.py", line 247 in OnPaletteChanged
  File "/usr/local/lib/python3.11/site-packages/ltchiptool/gui/main.py", line 334 in palette
  File "/usr/local/lib/python3.11/site-packages/ltchiptool/gui/main.py", line 194 in SetSettings
  File "/usr/local/lib/python3.11/site-packages/ltchiptool/gui/main.py", line 252 in OnShow
  File "/usr/local/lib/python3.11/site-packages/ltchiptool/util/../../ltchiptool/gui/__main__.py", line 32 in gui_entrypoint
  File "/usr/local/lib/python3.11/site-packages/ltchiptool/util/../../ltchiptool/gui/__main__.py", line 50 in cli
  File "/Users/cohm/Library/Python/3.11/lib/python/site-packages/click/core.py", line 783 in invoke
  File "/Users/cohm/Library/Python/3.11/lib/python/site-packages/click/core.py", line 1434 in invoke
  File "/Users/cohm/Library/Python/3.11/lib/python/site-packages/click/core.py", line 1688 in invoke
  File "/Users/cohm/Library/Python/3.11/lib/python/site-packages/click/core.py", line 1078 in main
  File "/Users/cohm/Library/Python/3.11/lib/python/site-packages/click/core.py", line 1157 in __call__
  File "/usr/local/lib/python3.11/site-packages/ltchiptool/__main__.py", line 122 in cli
  File "/usr/local/lib/python3.11/site-packages/ltchiptool/__main__.py", line 129 in <module>
  File "<frozen runpy>", line 88 in _run_code
  File "<frozen runpy>", line 198 in _run_module_as_main

Extension modules: wx._core, wx._adv, wx._xml, wx._xrc, zeroconf._utils.time, zeroconf._dns, zeroconf._protocol.outgoing, zeroconf._protocol.incoming, zeroconf._cache, zeroconf._record_update, zeroconf._updates, zeroconf._handlers.record_manager, zeroconf._services, zeroconf._services.info, zeroconf._services.registry, zeroconf._listener, zeroconf._handlers.answers, zeroconf._handlers.multicast_outgoing_queue, zeroconf._history, zeroconf._handlers.query_handler, zeroconf._services.browser, wx._dataview (total: 22)
Abort trap: 6
OhmBookPro13:~/Downloads > /usr/local/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 3 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '

Chip Type - Unrecognized (0x48405F31)

I bought some switches with CB2S chips and BK7231N's on them but am unable to flash them.

Trying to ID the chips it sends back the following.....

ltchiptool -v flash info bk72xx

: |-- Success! Chip info: None
I: Reading chip info...
I: Chip: None
I: +--------------------+---------------------------+
I: | Name               | Value                     |
I: +--------------------+---------------------------+
I: | Chip Type          | Unrecognized (0x48405F31) |
I: | Bootloader Version | Unspecified               |
I: | Protocol Type      | BASIC_BEKEN               |
I: +--------------------+---------------------------+
I: |-- Finished in 5.271 s

9F21D9F6-F432-4CDF-8B99-D36055810003_1_105_c

Help with a Midea SmartKit Dongle

My Midea dehumidifier came with a WiFi dongle, the case reads EU-SK-105.
It has a USB connector, but the data lines are just UART TTL lines to another board. Those are apparently 5V.

It's rather tiny, not that readable and I don't have a nice cam around, but apparently it has a RTL8720C:
Midea SmartKit back
Midea SmartKit front
Midea SmartKit mcu

If I attach a 3.3V CH341 UART TTL to LOG_TX/RX I can read from and write to it:

== Rtl8710c IoT Platform ==
Chip VID: 5, Ver: 3
ROM Version: v3.0

== Boot Loader ==
Nov 30 2020:20:11:23

Boot Loader <==

== RAM Start ==
Build @ 17:50:15, Dec  2 2022

$8710c>
Initializing WIFI ...
WIFI initialized
count:15, interval:8

init_thread(57), Available heap 0x154c0

#
#
#help

WLAN AT COMMAND SET:
==============================
1. Wlan Scan for Network Access Point
   # ATWS
2. Connect to an AES AP
   # ATW0=SSID
   # ATW1=PASSPHRASE
   # ATWC
3. Create an AES AP
   # ATW3=SSID
   # ATW4=PASSPHRASE
   # ATW5=CHANNEL
   # ATWA
4. Ping
   # ATWI=xxx.xxx.xxx.xxx

(note that the initial prompt reads 8710c)

But I'm not sure how to enter download mode, the flash info ambz2 help reads strapping pin (GPIO 0 / PA00) has to be pulled *to 3.3V*. Since that a current and I try to salvage that thing instead of destroying it.... any idea which contacts I have to short?

Thanks!

Problems using ltchiptool 4.6.0 to write kickstart-bk7231t-2023-08-29.uf2

Get following error when writing flash with ltchiptool 4.6.0 and file : kickstart-bk7231t-2023-08-29.uf2

S [ 13.255] (+0.000s) -> RX: FF .
S [ 13.255] (+0.000s) -> RX: b'\x01'
S [ 13.255] (+0.000s) -> RX: E0 .
S [ 13.255] (+0.000s) -> RX: FC .
S [ 13.255] (+0.000s) -> RX: F4 .
S [ 13.255] (+0.000s) -> RX: b'\x06\x00\x07'
S [ 13.255] (+0.000s) -> RX: b'\x00\x00\x10!\x00'
S [ 13.553] (+0.299s) <- TX: 01 E0 FC FF F4 06 00 0F 20 00 20 21 00 ........ . !.
E [ 14.563] (+1.009s) ValueError: No response received
E [ 59.191] (+44.628s) |-- File "ltchiptool\gui\work\base.py", line 24, in run
E [ 59.191] (+0.000s) |-- File "ltchiptool\gui\work\flash.py", line 58, in run_impl
E [ 59.191] (+0.000s) |-- File "ltchiptool\gui\work\flash.py", line 109, in do_write
E [ 59.191] (+0.000s) |-- File "ltchiptool\soc\bk72xx\flash.py", line 204, in flash_write_uf2
E [ 59.191] (+0.000s) |-- File "ltchiptool\util\streams.py", line 156, in update_from
E [ 59.191] (+0.000s) |-- File "bk7231tools\serial_init
.py", line 149, in program_flash
E [ 59.191] (+0.000s) |-- File "bk7231tools\serial\cmd_flash.py", line 216, in flash_erase_block
E [ 59.191] (+0.000s) |-- File "bk7231tools\serial\protocol.py", line 210, in command

programing setup works tested with bk_writer1.60 and there firmware works but i like to test kickstart.
only deference i see is the communication speed of 1000000 and not 115200

Problems flashing a new rtl8710bx board

I'm working on a plug HPPA11SW that has a board in it with a rtl8710bx chip. I was able to use the ltchiptool to read the flash no problem. But writing the flash sends information and then errors "Failed to write to 0x80000000" or whatever address I am writing to. I ran it with --dump-serial the last lines are:

S: <- TX: FF FF FF FF FF FF FF 1A                           ........
S: -> RX: b'\x15'
E: ValueError: Failed to write to 0x8000000
E: |-- File "/usr/local/lib/python3.10/dist-packages/ltchiptool/soc/ambz/flash.py", line 148, in flash_write_raw

Note: I can write using the amebaz-image-tool-v2.2.

The board is an unsupported one, that I am trying to get working. If it is helpful it is shown in FCC ID filings 2AB2QHPPA11SZ and 2AB2QHPPA11SZ (it is the same internal board different plug) with markings RL-M, E350220. M-LWK32F510D. Later I was going to look for help adding it to libretiny, but first I wanted to get the ltchiptool working.

v4.0.0a2 'NoneType' object has no attribute 'get-uf2_ctx' (Windows 10)

I am working with RTL8710BN (AmebaZ) and get this error when using the ltchiptool in Windows 10 with FTDI serial cable connected.
Unable to get this working, so I'll move back to my Linux machine and update the tools there.

I [      0.150] (+0.135s) Loaded settings from C:\Users\brade\AppData\Roaming\ltchiptool\config.json
D [      0.152] (+0.002s) Started PortWatcher
I [      0.360] (+0.208s) Found new device: COM9 - USB Serial Port (COM9) - VID=0403 (FTDI), PID=6001 
I [      0.365] (+0.005s) Found new device: COM3 - Intel(R) Active Management Technology - SOL (COM3) - HWID=PCI\VEN_8086&DEV_8C3D&SUBSYS_221117AA&REV_04\3&33FD14CA&0&B3
E [     33.374] (+33.009s) AttributeError: 'NoneType' object has no attribute 'get_uf2_ctx'
E [    285.473] (+252.100s) |-- File "ltchiptool\gui\utils.py", line 23, in <lambda>
E [    285.474] (+0.001s) |-- File "ltchiptool\gui\panels\flash.py", line 485, in on_start_click

image

Error when creating uf2 file from OpenBK firmware

Hi,

I have a device that I will like to flash with OpenBK firmware.
On my Ubuntu I have downloaded ltchiptool and did:

python3 -m ltchiptool uf2 write -b cb2s -o openbkt.uf2 OpenBK7231N_1.17.205.rbl=device:download

and a few other variants of that command. I always get this error:

Error: Invalid value for '-b' / '--board': Board cb2s does not exist

I am not sure what I am doing wrong. Can you please help?

Segmentation fault in Fedora 39

Hi, thanks for your hard work. It is appreciated.

I am wanting to flash a module using my linux laptop. But I am hitting an assertion here.

[bouke@Slimbook ~]$ ltchiptool -vvv gui
22:31:53: Debug: Adding duplicate image handler for 'Windows bitmap file'
22:31:53: Debug: Adding duplicate animation handler for '1' type
22:31:53: Debug: Adding duplicate animation handler for '2' type
D: Found Local data snapshot (v1.4.1) - /home/bouke/.local/lib/python3.12/site-packages/ltchiptool
D: Using v1.4.1 (/home/bouke/.local/lib/python3.12/site-packages/ltchiptool) as default
D: Using selector: EpollSelector

(ltchiptool:58704): Gtk-CRITICAL **: 22:31:53.843: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar
D: Started DeviceWatcher
Segmentation fault (core dumped)

Using Fedora 39 and using all pypi packages. The GUI first starts normally, but gets this segmentation fault when switching tabs.
Using v4.10.1

Would appreciate if you could take a look. (As a suggestion maybe consider a flatpak in the future?)

Avast detects virus in ltchiptool-v4.6.0.exe

The exe is detected as containing Win64:Evo-gen trojen. Couldnt find any other cases with quick google search.

Avast 23.8.6078 (build 23.8.8416.794)
Definition database: 231002-0

Flashing Tuya WR2

Hello!

I see WR2 module is supported by this project; but has anyone succeeded flashing it ? I've tried everything but failed to put it in flashing mode.

So far, the described procedure is:

  1. Connect CEN to ground
  2. Connect TXD to ground
  3. Release CEN
  4. Release TXD

And no success! As soon as i release CEN the module simply boots up into stock firmware. I determine this by the fact that the smart plug reacts on button press (it should frob the relay, it does).

While playing i've noticed that CEN is only obeyed on powerup. If i short it to GND, then powerup, the device will sit idle until i release CEN. If i connect it to GND after the bootup, simply nothing happens, the module doesn't reset.

Am i doing something wrong ? I've re-read the official flashing procedure; they suggest to power up the module while the pins are held to ground; i did; again no response.

Microsoft Defender detects trojan in newest Release

Hello,

I wanted to try your newest release, but my Microsoft Defender immediatly raised an alarm and deleted the downloadet file.

It shows the following:

image

The previous Release download shows no problems at all.

Just wanted to make you aware of this. Maybe it is false positive but maybe not. I will always trust defender first ;)

Unable to convert some datapoints.

Hi,
Thanks for the amazing software.
I have a 2 channel tuya device with built-in rf module. https://www.primezen.in/products/zen-2c5w/
I successfully extracted the firmware from the device.
While analyzing using ltchiptool, it says tuyamcu found and needs to download schema.
It downloads a schema which is unable to convert few datapoints.
Attached is an image for better understanding.
Screenshot (326)

3 datapoints viz,
102 - sends a pairing command to internal mcu which puts rf device in pairing mode to pair a rf switch.
103 - sends a clear pairing command to internal mcu which clears pairing information from rf device.
116 - switches on both relays at once.

I have two questions.

  1. How do i make above three work.
  2. How to get new schema since the schema used by ltchiptool to poll data differs from the schema available in my device as stated in the image.

Attached below is the firmware binary for your reference.
ltchiptool_dump_2023-12-20_23-13-00.zip

Kindly help.
Thanks.

Failed to read flash WR3L module

I have a couple of WR3L modules. I've tried reading the flash from them using ltchiptool , but get a funny error once the chip is in download mode:

[ENV: ltchiptool-venv] jrosenth ~ % ltchiptool --verbose flash read ambz ~/bak-009s.bin
D: Found PlatformIO Package (v1.0.2) - /home/jrosenth/.platformio/platforms/libretiny
D: Found Local data snapshot (v1.1.0) - /home/jrosenth/ltchiptool-venv/lib/python3.10/site-packages/ltchiptool
I: Available COM ports:
I: |-- ttyUSB0 - FT232R USB UART - FT232R USB UART - FTDI (0403/6001)
I: |   |-- Selecting this port. To override, use -d/--device
I: |-- ttyS4 - n/a
I: Connecting to 'Realtek AmebaZ' on /dev/ttyUSB0 @ 1500000
D: Linking: stage 0
D: Linking: stage 1
D: Linking: stage 2
D: Linking: stage 3
I: Connect UART2 of the Realtek chip to the USB-TTL adapter:
I: 
I:     --------+        +-------------------------------
I:          PC |        | RTL8710B                      
I:     --------+        +-------------------------------
I:          RX | ------ | TX2 (Log_TX / PA30)           
I:          TX | ------ | RX2 (Log_RX / PA29)           
I:         RTS | ------ | CEN (or RST, optional)        
I:         DTR | ------ | TX2 (Log_TX / PA30, optional) 
I:             |        |                               
I:         GND | ------ | GND                           
I:     --------+        +-------------------------------
I:  
I: Make sure to use a good 3.3V power supply, otherwise the adapter might
I: lose power during chip reset. Usually, the adapter's power regulator
I: is not enough and an external power supply is needed (like AMS1117).
I:  
I: If you didn't connect RTS and DTR, you need to put the chip in download
I: mode manually. This is done by connecting CEN to GND, while holding TX2 (Log_TX)
I: to GND as well. After doing that, you need to disconnect TX2 from GND.
I:  
I: If the download mode is enabled, you'll see a few garbage characters
I: printed to the serial console every second.
I: |-- Success! Chip info: Realtek RTL87xxB
I: Reading 2 MiB @ 0x0 to '/home/jrosenth/bak-009s.bin'
  [----------------------------------------------------------------]    0%
E: ValueError: Failed to read from 0x0
E: |-- File "/home/jrosenth/ltchiptool-venv/lib/python3.10/site-packages/ltchiptool/soc/ambz/flash.py", line 132, in flash_read_raw

This is using an external 3.3V supply. For adapters, I've tried an FTDI 2142C, and a FTDI 2242C. Any advice?

I'm using GPIO_A29 and GPIO_A30 for the UART.

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.