[docs] Add family flashing guides

This commit is contained in:
Kuba Szczodrzyński
2022-07-11 12:03:28 +02:00
parent f9359679ad
commit b6008fc9bb
11 changed files with 107 additions and 18 deletions

View File

@@ -43,14 +43,17 @@
* [uf2ota.h library](docs/ota/library.md)
* [uf2ota.h reference](ltapi/uf2ota_8h.md)
* Families
* [Realtek - notes](docs/platform/realtek/README.md)
* [Beken 72xx - notes](docs/platform/beken-72xx/README.md)
* Beken BK72xx
* [General info](docs/platform/beken-72xx/README.md)
* [Flashing](docs/platform/beken-72xx/flashing.md)
* Realtek AmebaZ Series
* [General info](docs/platform/realtek/README.md)
* [Flashing (AmebaZ)](docs/platform/realtek-ambz/flashing.md)
* [Debugging](docs/platform/realtek/debugging.md)
* [Exception decoder](docs/platform/realtek/exception-decoder.md)
* C library
* [Built-in functions](docs/platform/realtek-ambz/stdlib.md)
* [Memory management](docs/platform/realtek-ambz/memory-management.md)
* [Debugging](docs/platform/realtek/debugging.md)
* [Exception decoder](docs/platform/realtek/exception-decoder.md)
* [All supported boards](boards/)
* [📓 TODO](TODO.md)
* [🔗 Resources](docs/resources.md)

View File

@@ -41,7 +41,7 @@
},
"links": {
"General info": "../../docs/platform/beken-72xx/README.md",
"Flashing (Tuya manual)": "https://developer.tuya.com/en/docs/iot/burn-and-authorize-wb-series-modules?id=Ka78f4pttsytd",
"Flashing guide": "../../docs/platform/beken-72xx/flashing.md",
"BkWriter v1.6.0": "https://images.tuyacn.com/smart/bk_writer1.60/bk_writer1.60.exe"
}
}

View File

@@ -43,7 +43,8 @@
"links": {
"General info": "../../docs/platform/realtek/README.md",
"Debugging": "../../docs/platform/realtek/debugging.md",
"Flashing (Tuya manual)": "https://developer.tuya.com/en/docs/iot/burn-and-authorize-wr-series-modules?id=Ka789pjc581u8"
"Flashing guide": "../../docs/platform/realtek-ambz/flashing.md",
"ImageTool (AmebaZ/AmebaD)": "https://images.tuyacn.com/smart/Image_Tool/Image_Tool.zip"
},
"extra": [
"RDP is most likely not used in Tuya firmwares, as the System Data partition contains an incorrect offset 0xFF000 for RDP, which is in the middle of OTA2 image.",

View File

@@ -6,7 +6,8 @@
- [General info](../../docs/platform/realtek/README.md)
- [Debugging](../../docs/platform/realtek/debugging.md)
- [Flashing (Tuya manual)](https://developer.tuya.com/en/docs/iot/burn-and-authorize-wr-series-modules?id=Ka789pjc581u8)
- [Flashing guide](../../docs/platform/realtek-ambz/flashing.md)
- [ImageTool (AmebaZ/AmebaD)](https://images.tuyacn.com/smart/Image_Tool/Image_Tool.zip)
- [Vendor datasheet](https://docs.ai-thinker.com/_media/rtl8710/hardware/bw12_datasheet_en.pdf)
Parameter | Value

View File

@@ -5,7 +5,7 @@
[Product page](https://developer.tuya.com/en/docs/iot/cb2s-module-datasheet?id=Kafgfsa2aaypq)
- [General info](../../docs/platform/beken-72xx/README.md)
- [Flashing (Tuya manual)](https://developer.tuya.com/en/docs/iot/burn-and-authorize-wb-series-modules?id=Ka78f4pttsytd)
- [Flashing guide](../../docs/platform/beken-72xx/flashing.md)
- [BkWriter v1.6.0](https://images.tuyacn.com/smart/bk_writer1.60/bk_writer1.60.exe)
Parameter | Value

View File

@@ -5,7 +5,7 @@
[Product page](https://developer.tuya.com/en/docs/iot/wb2l-datasheet?id=K9duegc9bualu)
- [General info](../../docs/platform/beken-72xx/README.md)
- [Flashing (Tuya manual)](https://developer.tuya.com/en/docs/iot/burn-and-authorize-wb-series-modules?id=Ka78f4pttsytd)
- [Flashing guide](../../docs/platform/beken-72xx/flashing.md)
- [BkWriter v1.6.0](https://images.tuyacn.com/smart/bk_writer1.60/bk_writer1.60.exe)
Parameter | Value

View File

@@ -6,7 +6,8 @@
- [General info](../../docs/platform/realtek/README.md)
- [Debugging](../../docs/platform/realtek/debugging.md)
- [Flashing (Tuya manual)](https://developer.tuya.com/en/docs/iot/burn-and-authorize-wr-series-modules?id=Ka789pjc581u8)
- [Flashing guide](../../docs/platform/realtek-ambz/flashing.md)
- [ImageTool (AmebaZ/AmebaD)](https://images.tuyacn.com/smart/Image_Tool/Image_Tool.zip)
Parameter | Value
-------------|----------------------------------

5
docs/flashing-uf2ota.md Normal file
View File

@@ -0,0 +1,5 @@
It is possible to upload firmware binaries manually, using the provided command-line tool `uf2upload`. For this, you need the `.uf2` file generated after compilation (usually found in `.pio/build/my_board/`).
1. Open a command prompt/terminal and `cd` into your home directory (`c:\Users\username` on Windows, `/home/username` on Linux).
2. `cd .platformio/platforms/libretuya/tools/upload`
3. `python uf2upload.py my_firmware.uf2 uart COM96` (replace `my_firmware.uf2` with your file name and `COM96` with your upload port).

View File

@@ -0,0 +1,40 @@
# Flashing - Beken 72xx
- [Flashing (Tuya manual)](https://developer.tuya.com/en/docs/iot/burn-and-authorize-wb-series-modules?id=Ka78f4pttsytd)
- [BkWriter v1.6.0](https://images.tuyacn.com/smart/bk_writer1.60/bk_writer1.60.exe)
Downloading is done using UART. For best experience, you should have two USB<->UART adapters plugged in (for UART1 and UART2).
!!! hint
The adapter connected to UART1 (for uploading) can have RTS connected to chip's RESET or CEN - to provide auto-reset during uploading.
If you're not using auto-reset, you'll have to reset the chip manually when upload starts (you have 10 seconds to do that).
## Automatically - using PlatformIO (recommended)
LibreTuya has built-in firmware uploaders. Pressing `Upload` in PlatformIO IDE does all the work for you.
Although the default options work in most cases, it is recommended to configure your PIO project first:
```ini
[env:my_board]
# default baudrate for both UARTs
monitor_speed = 115200
# port connected to UART2
monitor_port = COM60
# port connected to UART1
upload_port = COM96
```
## Manually - using `uf2upload`
{%
include-markdown "../../flashing-uf2ota.md"
%}
## Manually - using raw binaries/BkWriter
A binary file named `bk7231t_app_0x011000.rbl` is generated in `.pio/build/my_board/`. This file can be flashed to offset 0x11000, using BkWriter or other flashing tool of choice (including SPI download or flashrom).
Keep in mind that BkWriter is an extremely buggy and broken tool, and simply does not work in most cases.

View File

@@ -0,0 +1,38 @@
# Flashing - Realtek AmebaZ
- [Flashing (Tuya manual)](https://developer.tuya.com/en/docs/iot/burn-and-authorize-wr-series-modules?id=Ka789pjc581u8)
- [ImageTool (AmebaZ/AmebaD)](https://images.tuyacn.com/smart/Image_Tool/Image_Tool.zip)
Downloading is done using UART. It is required to put the chip into download mode, prior to flashing. This can be done by resetting the chip, while pulling UART2_TX to GND. If successful, the chip should print few garbage characters every second.
## Automatically - using PlatformIO (recommended)
LibreTuya has built-in firmware uploaders. Pressing `Upload` in PlatformIO IDE does all the work for you.
If you have more than one COM port,configure your PIO project first:
```ini
[env:my_board]
monitor_port = COM60
upload_port = COM60
```
## Manually - using `uf2upload`
{%
include-markdown "../../flashing-uf2ota.md"
%}
## Manually - using raw binaries/BkWriter
There are two binary files in `.pio/build/my_board/`:
- `image_0x00B000.ota1.bin`
- `image_0x0D0000.ota2.bin`
They can be flashed using `ImageTool_v2.3.1_AmebaZ(8710b)`. Browse and select one of the files and enter an appropriate address. Select COM port, press `Open` and then `Download`.
This method is not recommended, as it requires you to know the currently enabled OTA index (1 or 2). Flashing the wrong file will either not make any changes, or upload firmware which won't run.
!!! hint
Because the UART uploading code is programmed in the ROM of the chip, it can't be software-bricked, even if you damage the bootloader.

View File

@@ -1,5 +1,13 @@
# Supported boards, modules and CPUs
## Board list
{%
include-markdown "supported_boards.md"
%}
\* I/O count includes GPIOs, ADCs, PWM outputs and UART, but doesn't count CEN/RST and power pins.
## CPU list
Chips currently supported by the project:
@@ -11,14 +19,6 @@ Chips currently supported by the project:
This list is not exhaustive, i.e. a similar chip (but different package) might work just fine, but there's no board definition for it yet.
If you have an unsupported chip, feel free to reach out using Issues or on the Discord server.
## Board list
{%
include-markdown "supported_boards.md"
%}
\* I/O count includes GPIOs, ADCs, PWM outputs and UART, but doesn't count CEN/RST and power pins.
## Families
A list of chip families currently supported by this project.