Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Keychain with chip ST17H66B (iSearching) #94

Open
pvvx opened this issue Dec 9, 2024 · 90 comments
Open

Keychain with chip ST17H66B (iSearching) #94

pvvx opened this issue Dec 9, 2024 · 90 comments
Labels
documentation Improvements or additions to documentation

Comments

@pvvx
Copy link
Owner

pvvx commented Dec 9, 2024

Key fob on chip ST17H66B with firmware "KEY2"

image

iSearching - BLE, Flash

iSearching2 - BLE, Flash

iSearching3 - BLE, OTP (!)

There are a large number of variations of this device.

Switching to “FindMy” mode

FindMy

image


  • To find a device in the connection list, press or hold the button on the key fob.
    Select "Connect" and press the button on the key fob again.

  • Set the "FindMy" key:
    image

  • Set the “FindMy” mode and the desired beacon transmission interval:
    image

  • Disconnect...
@pvvx pvvx added the documentation Improvements or additions to documentation label Dec 9, 2024
@Hunter32R
Copy link

I have such key fobs, but they have ST17H66T chip. Is support planned?

@pvvx
Copy link
Owner Author

pvvx commented Dec 9, 2024

ST17H66T is a chip without the ability to reflash. It uses one-time programmable memory, which is produced at the factory.

@pvvx pvvx changed the title Keychain with chip ST17H66 (iSearching) Keychain with chip ST17H66B (iSearching) Dec 9, 2024
@Hunter32R
Copy link

Thanks for the information.

@biemster
Copy link

biemster commented Dec 9, 2024

This looks great, going to try this as soon as I find my Lenze programming jig. Do you mind if I link to this on biemster/FindMy?

@pvvx
Copy link
Owner Author

pvvx commented Dec 9, 2024

Программирование брелка с ST17H66B

Потребуется адаптер USB-COM с выходами на 3.3В

Талица соединений:

USB-COM PCB брелка
GND GND
+3.3V +3.3V
TX P10
RX P9

Пример строки запуска скрипта:

python rdwr_phy62x2.py -p COM5 -e -r wh BOOT_KEY2_v20.hex

Остальные варианты описаны в README

Последовательность программирования.

  1. Включить USB-COM
  2. Произвести соединения согласно таблице.
  3. Запустить скрипт и быстро соединить провод питания +3.3В от USB-COM адаптера. Если прошивка не началась, отключить и снова подключить провод питания. Возможны и другие варианты – при старте скрипта кратковременно отключать провод GND от адаптера к брелку.

@pvvx
Copy link
Owner Author

pvvx commented Dec 10, 2024

Интеграция в Home Assistant.

После прошивки брелка прошивкой “KEY2” в Home Assistant отобразится новое устройство:

image

Добавляем и нажимаем кнопку на брелке – появится новое Событие: “Button”.

image

Брелок зарегистрирован.

Переключение на шифрованную рекламу BTHome BLE v2 (encrypted).

  1. Производим соединение с брелком в PHY62x2BTHome.html.
  2. В меню “Service” назначаем BindKey. Можно использовать изначально сгенерированный прошивкой случайный BindKey - тогда используем “Прочитать” BindKey. Копируем BindKey в буфер обмена.
  3. В меню “Config” жмем Прочитать, включаем галку “Шифрованная реклама”, далее Записать.
  4. Отключаем соединение: кнопка Отключение.
  5. Жмем кнопку на брелке – в Home Assistant появится предложение установить BindKey. Копируем BindKey из буфера обмена.

image

На этом всё – теперь брелок работает с шифрованной рекламой.

@olivluca
Copy link

olivluca commented Dec 10, 2024

My advertisement keys are 28 bytes (see here) but when I try your flasher it complains that it must be 22 bytes.

@olivluca
Copy link

olivluca commented Dec 10, 2024

In fact nrf connect shows 28 bytes, the first six are 38 1f 8d 09 af 89 and the remaining 22 are the ones I put in your flasher (edit: the mac of the device is f8 1f 8d 09 af 89)

@pvvx
Copy link
Owner Author

pvvx commented Dec 10, 2024

Firmware (v2.0 beta4) and PHY62x2BTHome.html program (v1.8) have been updated.
The key is entered in the "Base64" format. When you enter the key, the MAC will be changed automatically.

FindMy key Base64: EiM0RVZneImaq7zN3u/+7dzLuqmYh3ZlVEMyIQ==
= 12233445566778899aabbccddeeffeeddccbbaa99887766554433221

The FindMy beacon has been supplemented with battery status transmission.

Byte Value Description
1 0x19 Length of payload
2 Bits 0..1: Reserved.
Bit 2: Maintained
Bits 3..4: Reserved
Bits 5: 0b1
Bits 6..7: Battery state.
Maintained
Set if owner connected within current key rotation period (15 minutes)
0= Full
1 = Medium
2= Low
3 = Critically low

So far, no new information about the FindMy bacon format has been found. There are no publications or descriptions from the creators of the “reverse engineering” of FindMy on the Internet.

@olivluca
Copy link

Really nice, with the latest firmware flashed I actually got a report from Apple 👍 .
How does it compare to @biemster's implementation (regarding battery life and reach of the beacon)?

@pvvx
Copy link
Owner Author

pvvx commented Dec 11, 2024

Depends heavily on the beacon transmission interval.
With the same interval, there is no difference with the firmware https://github.com/biemster/FindMy/tree/main/Lenze_ST17H66.

image

Average current consumption as a function of beacon period. With a 3.0 V source.
The graph corresponds to measurements when working in the BTHome format. For FindMy it will be slightly less - up to a couple of percent at short intervals.
In FindMy mode, the key fob does not track the connection request, but the length of the transmitted data is greater.This gives a difference of 1..3% only at short intervals.

At longer intervals the chip sleep current (chip leakage) has a greater effect. Average sleep current - 2.8..3.5 uA - depends on the chip quality.

At short intervals there is a large dependence on the set transmitter power in dBm.
The graph is given for a setting of 0 dBm.

@olivluca
Copy link

Cool, I set a 3s advertising interval but I see @biemster's code uses 5s, I'll change it.
Besides, I see that the device can do double duty (working both as a bthome button in ha and as a findmy tracker). Not that I'm going to use it that way but it's really cool nevertheless.

@biemster
Copy link

Is there a way to protect OTA access, with a password or something? I would not like if someone else passes by and changes the key..

@pvvx
Copy link
Owner Author

pvvx commented Dec 12, 2024

If the button is not pressed, it is impossible to connect. The FindMy beacon does not have a connection request reception...

@biemster
Copy link

If the button is not pressed, it is impossible to connect. The FindMy beacon does not have a connection request reception...

ah sorry, I missed that! I just flashed an E2XT2319, as mentioned in the issue above, which went fine. But it does not have a button :D

@pvvx
Copy link
Owner Author

pvvx commented Dec 12, 2024

Button processing (FindMy mode):

When the button is pressed, LED turns on, the FindMy beacon switches to transmitting BLE advertising with the AdvEventType = LL_ADV_CONNECTABLE_UNDIRECTED_EVT attributes. A first packet of BLE advertising events is transmitted in the quantity specified in "Number of event transmissions". The period of advertising events is 95 ms. Data in the packet is in BTHome format with "Button" = "1".

If the button is released, the LED goes out.

After the packet has been transmitted N*95ms, the speaker quietly clicks, the LED turns off regardless of the button (saving battery). If the button is still pressed, the first packet is transmitted again. If the button is released, the second packet of BLE "Number of Event Transmissions" announcements is transmitted, but with "Button" = "0".

After the second packet is transmitted, the FindMy beacon with the AdvEventType attribute = LL_ADV_NONCONNECTABLE_UNDIRECTED_EVT begins to be transmitted.

PS: I barely wrote it in English - Google translate is terrible :)

@pvvx
Copy link
Owner Author

pvvx commented Dec 12, 2024

@biemster - Now, to support "Find My" in Home Assistant, you'll have to fight with the writers of "Bluetooth" integration. But there you'll be sent to "Bluez", and there you'll be sent to the kernel, and there's Linus Torvalds :P

@omarkhali
Copy link

omarkhali commented Dec 12, 2024

@pvvx @biemster
https://github.com/malmeloo/hass-FindMy

@biemster
Copy link

@biemster - Now, to support "Find My" in Home Assistant, you'll have to fight with the writers of "Bluetooth" integration. But there you'll be sent to "Bluez", and there you'll be sent to the kernel, and there's Linus Torvalds :P

😭

@omarkhali
Copy link

@pvvx @biemster https://github.com/malmeloo/hass-FindMy

This integration works beautifully and I use it with hass. Many thanks to @biemster @pvvx @malmeloo On this hard work

@pvvx
Copy link
Owner Author

pvvx commented Dec 12, 2024

This integration does not receive the Find My beacon.
There is no way to determine that the Find My carrier has appeared at home or in the yard, in a specific room ...
The "bluetooth" integration does not accept beacons without "flags" in the PDU. At the same time, in the standard, unspecified flag keys are accepted as the value 0 by default. But Bluez and kernel (Linus Torvalds) have their own standards.
This also involves "D-Bus"... And it is impossible to move this entire chain. Especially since Linus Torvalds has gone into politics and imposed sanctions on the Russians :)
In Linux, in "Bluez", in "Bleak" Bluetooth version 5.0+ is still not supported since 2016.


For the BTHome mode option, an addition is planned - a key fob search. Upon request, when connected, it will give a sound signal...

@biemster
Copy link

I forgot how frustrating it is to program these chips, I'm on it for three hours now and managed a grand total of 2!

The third one I flashed only half, @pvvx your OTA bootloader does not replace the entire bootloader right?

@pvvx
Copy link
Owner Author

pvvx commented Dec 12, 2024

your OTA bootloader does not replace the entire bootloader right?

The question is not clear.

Firmware installation via USB-COM adapter takes several minutes with soldering of wires.

OTA:

17:29:16: Starting programming...
17:30:04: Programming completed in 47.069 seconds
17:30:08: Device disconnected.

@biemster
Copy link

I'm just installing BOOT_KEY2_v20.hex. Getting the chip to start in firmware upload mode has always been an issue for me, probably due to the hacky setup I'm using. When the flasher gets to cmd>> it actually finishes in seconds, but getting to that is very finicky.

The question was if flashing BOOT_KEY2_v20.hex only partially due to lost connection will brick the chip?

@pvvx
Copy link
Owner Author

pvvx commented Dec 12, 2024

Flash writing on PHY62x2/ST17H66B chips is always available.
UART Boot is in ROM.

@khongpt
Copy link

khongpt commented Jan 23, 2025

Option with OTP on PHY6230. Has one-time programming by the manufacturer.

IMG_20250107_204544 I have one with a similar layout, but the pinout seems slightly different. There is no marking on the chip. Did you read the data from the SOP8 one over uart, and if so, what pins did you use?

Looking at the PCB, it seems similar to the one I have. It looks like it's the OTP type that can't be re-flashed.

Image

@pvvx
Copy link
Owner Author

pvvx commented Jan 26, 2025

прошивка BOOT_KEY2_v20 через адаптер USB-COM заливаеться и все работает как описано у вас
но после заливки через веб страницу KEY2_v20 брелок перестаёт работать

Что "заливается" через веб страницу?

Кроме "BOOT" для брелоков ничего не требуется, т.е. не обязательно. Функционал "BOOT" и "APP" для них одинаков.

@rif63
Copy link

rif63 commented Jan 26, 2025

конекчусь через блютус

20:45:54: Waiting for connection to KEY-B27243
20:45:59: Model: KEY
20:45:59: Firmware: github.com/pvvx
20:45:59: Hardware: 0020
20:45:59: Software: B2.0
20:46:00: Device info # hw: 0020, sw: 0020, services: 00600009, sd: 0000
20:46:00: OTA ver: 01
20:46:00: Connected.
20:46:00: Set device time...
20:46:00: Set device time (23089F9667)...

далее ота app firmware : key2_v20.bin start

20:45:59: Model: KEY
20:45:59: Firmware: github.com/pvvx
20:45:59: Hardware: 0020
20:45:59: Software: B2.0
20:46:00: Device info # hw: 0020, sw: 0020, services: 00600009, sd: 0000
20:46:00: OTA ver: 01
20:46:00: Connected.
20:46:00: Set device time...
20:46:00: Set device time (23089F9667)...
20:48:21: Download firmware file 'KEY2_v20.bin'...
20:48:22: File: bin/KEY2_v20.bin
20:48:22: File id:PHY6, Segments: 3, Start: 0x"1FFF1838, : 46560
20:48:22: Filesize: 46564 bytes
20:48:22: Counter: 2911 blocks
20:48:25: Download firmware file 'KEY2_v20.bin'...
20:48:25: File: bin/KEY2_v20.bin
20:48:25: File id:PHY6, Segments: 3, Start: 0x"1FFF1838, : 46560
20:48:25: Filesize: 46564 bytes
20:48:25: Counter: 2911 blocks
20:48:27: Download firmware file 'KEY2_v20.bin'...
20:48:27: File: bin/KEY2_v20.bin
20:48:27: File id:PHY6, Segments: 3, Start: 0x"1FFF1838, : 46560
20:48:27: Filesize: 46564 bytes
20:48:27: Counter: 2911 blocks
20:50:00: Start OTA flashing...
20:50:47: Flash finished in 46.39 seconds
20:50:51: Device is disconnected.

и все тухнет
сканер не видит брелок
хотя с прошивкой воот видел

@pvvx
Copy link
Owner Author

pvvx commented Jan 26, 2025

Проверил только что:

18:55:42: Поиск устройств
18:55:57: Ожидание соединения с KEY-C84EB4
18:56:18: Model: KEY
18:56:18: Firmware: github.com/pvvx
18:56:18: Hardware: 0020
18:56:18: Software: V2.0
18:56:18: Device info # hw: 001E, sw: 0020, services: 00600008, sd: 0000
18:56:18: Устройство подключено.
18:56:43: Загрузка firmware файла 'KEY2_v20.bin'...
18:56:43: Файл: bin/KEY2_v20.bin
18:56:43: Файл id:PHY6, Сегментов: 3, Старт: 0x"1FFF1838, : 46560
18:56:43: Размер файла: 46564 байт
18:56:43: Счетчик: 2911 блоков
18:56:48: Переключение на...
18:56:48: Переподключение
18:56:48: Устройство отключено.
18:56:48: Ожидание соединения с KEY-C84EB4
18:56:52: Устройство отключено.
18:56:52: NetworkError: GATT Server is disconnected. Cannot retrieve services. (Re)connect first with `device.gatt.connect`.
18:56:52: Переподключение 0 / 5
18:56:52: Ожидание соединения с KEY-C84EB4
18:56:56: Model: KEY
18:56:56: Firmware: github.com/pvvx
18:56:56: Hardware: 0020
18:56:56: Software: B2.0
18:56:56: Device info # hw: 001E, sw: 0020, services: 00600009, sd: 0000
18:56:56: OTA ver: 01
18:56:56: Устройство подключено.
18:56:59: Старт программирования...
18:57:46: Программирование завершено за 45.449 секунды
18:57:50: Устройство отключено.
18:57:54: Переподключение
18:57:54: Ожидание соединения с KEY-C84EB4
18:57:57: Model: KEY
18:57:57: Firmware: github.com/pvvx
18:57:57: Hardware: 0020
18:57:57: Software: V2.0
18:57:57: Device info # hw: 0020, sw: 0020, services: 00600008, sd: 0000
18:57:57: Устройство подключено.

Всё ok.

сканер не видит брелок
хотя с прошивкой воот видел

Может что-то не то с чипом. Не пишите в него "APP", оставьте только "BOOT"

@rif63
Copy link

rif63 commented Jan 26, 2025

я прошиваю воот прошивку отсоединяю адаптер com-ttl и прошивка сбрасываеться
батарейка не вставлена
правильно я понимаю что при смене батарейки нужно заново шить?

@pvvx
Copy link
Owner Author

pvvx commented Jan 26, 2025

Ничего заново не надо.
Приведите что пишет программатор - какой тип Flash и модель чипа.

@rif63
Copy link

rif63 commented Jan 26, 2025

C:\Python311>python rdwr_phy62x2.py -p COM3 -e -r wh BOOT_KEY2_v20.hex
=========================================================
PHY62x2/ST17H66B Utility version 20.12.24
---------------------------------------------------------
Connecting...
PHY62x2: Release RST_N if RTS is not connected...
ST17H66B: Turn on the power...
Chip Reset Ok. Response: b'cmd>>:'
Revision: b'01124485 6222M005'
FlashID: 1124485, size: 256 kbytes
PHY62x2 - connected Ok
---- Segments Table -------------------------------------
Segment: 11003000 <- Flash addr: 00003000, Size: 00008db4
Segment: 1fff0000 <- Flash addr: 0000bdb4, Size: 00000400
Segment: 1fff1838 <- Flash addr: 0000c1b4, Size: 00002be6
----------------------------------------------------------
Erase Flash work area... ok
Segment Table[03] <- Flash addr: 00002000, Size: 00000130
Write 0x00000130 bytes to Flash at 0x00002000... ok
Segment: 11003000 <- Flash addr: 00003000, Size: 00008db4
Write 0x00002000 bytes to Flash at 0x00003000... ok
Write 0x00002000 bytes to Flash at 0x00005000... ok
Write 0x00002000 bytes to Flash at 0x00007000... ok
Write 0x00002000 bytes to Flash at 0x00009000... ok
Write 0x00000db4 bytes to Flash at 0x0000b000... ok
Segment: 1fff0000 <- Flash addr: 0000bdb4, Size: 00000400
Write 0x00000400 bytes to Flash at 0x0000bdb4... ok
Segment: 1fff1838 <- Flash addr: 0000c1b4, Size: 00002be6
Write 0x00002000 bytes to Flash at 0x0000c1b4... ok
Write 0x00000be6 bytes to Flash at 0x0000e1b4... ok
----------------------------------------------------------
Write Flash from file: BOOT_KEY2_v20.hex - ok.
Send command 'reset' - ok

@pvvx
Copy link
Owner Author

pvvx commented Jan 26, 2025

Странный какой-то Flash ID: 1124485, но всё остальное нормальное...
Flash пишет программа в ROM чипа. Влиять на это невозможно.

Перед сканированием или последующим соединением кнопку нажимаете?

  • To find a device in the connection list, press or hold the button on the key fob.
    Select "Connect" and press the button on the key fob again.

  • Чтобы найти устройство в списке подключений, нажмите или удерживайте кнопку на брелоке.
    Выберите «Подключиться» и нажмите кнопку на брелоке еще раз.

Устаревшие адаптеры BT плохо видят устройства BLE с большим интервалом маяка.

@rif63
Copy link

rif63 commented Jan 26, 2025

вот прям сейчас залил воот
сразу брелок залетел в Home Assistant
данные передаёт кнопка появляется светодиод на брелке при нажатии на кнопку пыхает
но стоит отсоединить питание брелка и снова подсоединить все тухнет и в HA больше не доступен

@pvvx
Copy link
Owner Author

pvvx commented Jan 26, 2025

Windows и прочие ОС вообще не помещают FindMy устройства в список соединения. У него нет атрибута в маяке для соединения.
Только по нажатию кнопки происходит временное переключение для соединения, если установлен режим FindMy.
BOOT по первому старту 80 секунд передает маяк с возможностью соединения и в формате BTHome.

Нажатие кнопки аналогично – временно, на 80 секунд переключает в режим BTHome с коротким интервалом передачи для соединения.

@rif63
Copy link

rif63 commented Jan 26, 2025

я не устанавливал FindMy
при нажатии на кнопку брелка он больше не пыхает

@pvvx
Copy link
Owner Author

pvvx commented Jan 26, 2025

Значит битый чип. Больше нечего предположить.

Пробуйте записать в него оригинальную прошивку - https://pvvx.github.io/iSearching2/bin/fullflash.bin

rdwr_phy62x2.py -p COM3 -r we 0 fullflash.bin

Repository owner deleted a comment from rif63 Jan 26, 2025
@rif63
Copy link

rif63 commented Jan 26, 2025

а её лить после бот или сразу её

@pvvx
Copy link
Owner Author

pvvx commented Jan 26, 2025

а её лить после бот или сразу её

Описано выше
Повтор:

rdwr_phy62x2.py -p COM3 -r we 0 fullflash.bin

Может там неподдерживаемая в SDK Flash... Это последнее предположение...

@rif63
Copy link

rif63 commented Jan 26, 2025

три раза это

C:\Python311>rdwr_phy62x2.py -p COM3 -r we 0 fullflash.bin
=========================================================
PHY62x2/ST17H66B Utility version 20.12.24
---------------------------------------------------------
Connecting...
PHY62x2: Release RST_N if RTS is not connected...
ST17H66B: Turn on the power...
Chip Reset Ok. Response: b'cmd>>:'
Revision: b'01124485 6222M005'
FlashID: 1124485, size: 256 kbytes
PHY62x2 - connected Ok
Write Flash data 0x00000000 to 0x00040000 from file: fullflash.bin ...
Erase block 64k Flash at 0x00000000... ok
Erase block 64k Flash at 0x00010000... ok
Erase block 64k Flash at 0x00020000... ok
Erase block 64k Flash at 0x00030000... ok
Write 0x00002000 bytes to Flash at 0x00000000... error!
Error: Write Flash!

@pvvx
Copy link
Owner Author

pvvx commented Jan 26, 2025

rdwr_phy62x2.py -p COM3 -a -r we 0 fullflash.bin

И при вставке log заключайте его в три обратные кавычки "```".

@rif63
Copy link

rif63 commented Jan 26, 2025

три раза

=========================================================
PHY62x2/ST17H66B Utility version 20.12.24
---------------------------------------------------------
Connecting...
PHY62x2: Release RST_N if RTS is not connected...
ST17H66B: Turn on the power...
Chip Reset Ok. Response: b'cmd>>:'
Revision: b'01124485 6222M005'
FlashID: 1124485, size: 256 kbytes
PHY62x2 - connected Ok
Erase All Chip Flash... ok
Write Flash data 0x00000000 to 0x00040000 from file: fullflash.bin ...
Write 0x00002000 bytes to Flash at 0x00000000... error!
Error: Write Flash!

@pvvx
Copy link
Owner Author

pvvx commented Jan 26, 2025

Чип не хочет стирать разметку в начале Flash или снять флаг защиты начальных секторов Flash. Что-то с ним не то. Или очередная ревизия чипа...

rdwr_phy62x2.py -p COM3 ea
rdwr_phy62x2.py -p COM3 -r we 0 fullflash.bin
rdwr_phy62x2.py -p COM3 -e -r we 0 fullflash.bin

@rif63
Copy link

rif63 commented Jan 26, 2025

=========================================================
PHY62x2/ST17H66B Utility version 20.12.24
---------------------------------------------------------
Connecting...
PHY62x2: Release RST_N if RTS is not connected...
ST17H66B: Turn on the power...
Chip Reset Ok. Response: b'cmd>>:'
Revision: b'01124485 6222M005'
FlashID: 1124485, size: 256 kbytes
PHY62x2 - connected Ok
Erase All Chip Flash... ok

C:\Python311>rdwr_phy62x2.py -p COM3 -e -r we 0 fullflash.bin
=========================================================
PHY62x2/ST17H66B Utility version 20.12.24
---------------------------------------------------------
Connecting...
PHY62x2: Release RST_N if RTS is not connected...
ST17H66B: Turn on the power...
Chip Reset Ok. Response: b'cmd>>:'
Revision: b'01124485 6222M005'
FlashID: 1124485, size: 256 kbytes
PHY62x2 - connected Ok
Erase Flash work area... ok
Write Flash data 0x00000000 to 0x00040000 from file: fullflash.bin ...
Write 0x00002000 bytes to Flash at 0x00000000... error!
Error: Write Flash!

@rif63
Copy link

rif63 commented Jan 26, 2025

ну ладно вроде все понятно фокус с двумя чипами не удался
Спасибо Вам большое
эх где бы взять нормальные чипы?

@pvvx
Copy link
Owner Author

pvvx commented Jan 26, 2025

Желательно всё доделывать до конца. Необходимо выяснить тип Flash по ID. Может есть PDF...

@rif63
Copy link

rif63 commented Jan 26, 2025

PDF есть только такой

ST17H66B2_BLE_SoC_Datasheet_v1.1.2.pdf

но тут я ничего не вижу про ID чипа

мой чип

Image

@pvvx
Copy link
Owner Author

pvvx commented Jan 26, 2025

У меня в ST17H66B кристалл SPI-Flash имеет ID: 0B6012. "0B60" -> spi-Flash XT25W02E "12" -> 256KB

Image

В PHY6222 чипах обычно установлена Flash GD25WD40C (ID: C86413)

@rif63
Copy link

rif63 commented Jan 26, 2025

ну моих знаний тут не хватает
я даже не понимаю почему BOOT_KEY2_v20.hex шьётся но слетает при обесточивании
а ещё у вас есть BOOT_KEY2_v20.bin но для неё нужно указывать вроде начальный адрес флеш и она не шьётся

@pvvx
Copy link
Owner Author

pvvx commented Jan 26, 2025

https://aliexpress.ru/item/1005007131402237.html
Это SP002E с чипом ST17H66B по 129 руб?

ну моих знаний тут не хватает

Тогда ждать когда придут и я посмотрю что там за чип ST17H66B.

@rif63
Copy link

rif63 commented Jan 26, 2025

@pvvx
Copy link
Owner Author

pvvx commented Jan 26, 2025

нет я брал SP621E по 164р

Я уже заказал все, на всякий случай :)

@rif63 - Я кое что нарыл. В ST17H66B не инициализируется интерфейс кеширования Flash, названый у РНY как "spifs".
Чипов PHY6222 назаказывали многие под свой бренд, наверно и программу в ROM изменили.
Cmostek также "выпустил" PHY6222, но с маркировкой CMT4501... И т.д. Кто их там разберет...
Добавил команду инициализации 'spifs 0 1 3 0 ' в "rdwr_phy62x2.py".
По идее теперь должна cработать запись fullflash.bin и других *.bin.

rdwr_phy62x2.py -p COM3 -e -r we 0 fullflash.bin

@rif63
Copy link

rif63 commented Jan 27, 2025

C:\Python311>rdwr_phy62x2.py -p COM3 -e -r we 0 fullflash.bin
=========================================================
PHY62x2/ST17H66B Utility version 27.01.25
---------------------------------------------------------
Connecting...
PHY62x2: Release RST_N if RTS is not connected...
ST17H66B: Turn on the power...
Chip Reset Ok. Response: b'cmd>>:'
Revision: b'01124485 6222M005'
FlashID: 1124485, size: 256 kbytes
PHY62x2 - connected Ok
Erase Flash work area... ok
Write Flash data 0x00000000 to 0x00040000 from file: fullflash.bin ...
Write 0x00002000 bytes to Flash at 0x00000000... ok
Write 0x00002000 bytes to Flash at 0x00002000... ok
Write 0x00002000 bytes to Flash at 0x00004000... ok
Write 0x00002000 bytes to Flash at 0x00006000... ok
Write 0x00002000 bytes to Flash at 0x00008000... ok
Write 0x00002000 bytes to Flash at 0x0000a000... ok
Write 0x00002000 bytes to Flash at 0x0000c000... ok
Write 0x00002000 bytes to Flash at 0x0000e000... ok
Write 0x00002000 bytes to Flash at 0x00010000... ok
Write 0x00002000 bytes to Flash at 0x00012000... ok
Write 0x00002000 bytes to Flash at 0x00014000... ok
Write 0x00002000 bytes to Flash at 0x00016000... ok
Write 0x00002000 bytes to Flash at 0x00018000... ok
Write 0x00002000 bytes to Flash at 0x0001a000... ok
Write 0x00002000 bytes to Flash at 0x0001c000... ok
Write 0x00002000 bytes to Flash at 0x0001e000... ok
Write 0x00002000 bytes to Flash at 0x00020000... ok
Write 0x00002000 bytes to Flash at 0x00022000... ok
Write 0x00002000 bytes to Flash at 0x00024000... ok
Write 0x00002000 bytes to Flash at 0x00026000... ok
Write 0x00002000 bytes to Flash at 0x00028000... ok
Write 0x00002000 bytes to Flash at 0x0002a000... ok
Write 0x00002000 bytes to Flash at 0x0002c000... ok
Write 0x00002000 bytes to Flash at 0x0002e000... ok
Write 0x00002000 bytes to Flash at 0x00030000... ok
Write 0x00002000 bytes to Flash at 0x00032000... ok
Write 0x00002000 bytes to Flash at 0x00034000... ok
Write 0x00002000 bytes to Flash at 0x00036000... ok
Write 0x00002000 bytes to Flash at 0x00038000... ok
Write 0x00002000 bytes to Flash at 0x0003a000... ok
Write 0x00002000 bytes to Flash at 0x0003c000... ok
Write 0x00002000 bytes to Flash at 0x0003e000... ok
----------------------------------------------------------
Write Flash data 0x00000000 to 0x00040000 from file: fullflash.bin - ok.
Send command 'reset' - ok

залил оригинальную прошивку. брелок не сканиться. на кнопку не реагирует

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests