How to flash TR6260 with open source Tasmota/Esphome style firmware? Guide, pinout, booting

Here's a detailed flashing guide for new TR6260 WiFi chips that can be found in some Tuya smart devices. TR6260 can be easily flashed and run free from the cloud, fully locally, without Tuya servers. This way you can easily pair TR6260 with Home Assistant via Home Assistant Discovery, add custom sensors (like DHT sensors family series or BMP280/BME280 etc), and run local scripts and automations.
TR6260 is 32-bit, 2.4GHz WiFi-enabled SoC optimized for smart home/IoT applications, featuring 6x PWM, single ADC, flexible IO interfaces and 1MB of Flash.

Where the TR6260 can be found?
TR6260 have been so far observed in multiple devices, here are few of them:
[TR6260S1 Transa Semi] Smart LED strip controller 144W 6A RGB, IR, firmware
[TR6260S1/FL-M61 V2] WiFi Smart Switch how to change the firmware?
ELM327 OBDII Scanner: Transa Semi ESWIN TR6260S1 MCU Details?
[Flashing Tuya A5F-53F1-02 with TR6260S1 Chip
You can also buy a development board with TR6260 called "Hi-Link HLK-M20", that can be ordered directly from China.
Thanks to @insmod efforts in the development topic, those devices can be now flashed with OpenBeken
HLK-M20 development board
This board can be easily found if you search for HLK-M20 Serial Port 2.4G WiFi Wireless Module IOT Serial to WiFi Transparent Transmission Low Power SDK M20 Development Board Kit. It's somewhat similiar to NodeMCU and other ESP boards. You can either buy just a module:


or a full dev board, with module already soldered:




Schematic:

In case of this board, everything needed to flash is already present, but if you're going to flash IoT device with TR6260, you will need to have your own USB to UART converter...
What do I need to flash TR6260?
To flash TR6260 found in IoT device, you need a classic USB to UART converter, similiar to ones used for ESP8266/ESP32/BK7231 flashing.

You will need to make some GPIO connections, so basic soldering skills are required.
If you want to get a basic grasp of how firmware change process looks like, you can visit our Youtube channel:
https://www.youtube.com/@elektrodacom
We don't have TR6260 flashing video yet, but we have covered similiar chips in the past, like BK7231, so this might give you a basic overview of the procedure.
Where to get UART flash tool?
This is not ESP device, so esptool will not work. You will need to download utility called UTP. It can be found here:
https://github.com/openshwprojects/FlashTools/tree/main/TransaSemi-ESWIN
Alternate download/TS info pack:
https://github.com/divadiow/TR6260/tree/main/UTP%20Flash%20Tool
Here's English translation of UTP gui:

Translation of the partition table layout:
https://obrazki.elektroda.pl/5232196400_1732140400.png
And please note that restore of factory backup appears to require the file be split. eg: https://www.elektroda.com/rtvforum/topic4091587.html#21336099
Now, let's focus on read and write procedures for flash...
How to prepare connections and make TR6260 flash dump?
In the case of the TR6260S1-based Hi-Link HLK-M20 module, which can be used as a template for any TR6260S1 device, a backup of the factory firmware can be achieved as follows:
GPIO14/TOUT2 needs to be grounded at power-on. Like LN882H this needs to be before power to USB-TTL. Just resetting the device (RST->GND) with GPIO14 grounded will bring it up in spi-flash boot mode, that being standard boot, NOT UART boot mode:

If you're watching TX then the correct procedure will give this output:

then configure the UTP program as follows, using the boot_nocrc.bin from the same zip file. The flash is 1mb so length is 0x100000
PC Local Filepath is just where you want to save the file

It takes 2-3 mins and it may look like it has stalled.
On the HLK-M20 module GPIO14/TOUT2 pad is the location of EN on ESP-12F, so if using an ESP universal adaptor it's just a case of grounding EN header.


If successful, the resultant backup file will be exactly 1,048,576 bytes.
How to flash new firmware to TR6260?
Before proceeding, make sure that you have a backup of factory flash. Once you are sure that everything is backed up, it's time to proceed with flashing.
Ground GPIO14/TOUT2 as shown in the backup procedure and power-on the device
Set appropriate COM port for your setup and a baud rate. Perhaps start at 921600 baud but reduce if there are issues with stability or connecting at all.
Download the latest OpenTR6260_xxxx.bin firmware from the releases page.
Using the partition binaries alongside the UTP program in the zip, configure your file list on the downloader tab to resemble this:

That being:
File_1 : boot_nocrc.bin | Address: 0x0000
File_2 : TR6260_partition_at_diff_0x6000.bin | Address: 0x6000
File_3: OpenTR6260_xxxx.bin | Address: 0x7000
File_4: IGNORE IT, no longer needed.
Click Start.
On completion, power-off and remove GPIO14/TOUT2 from ground. Power on the device and you should see it broadcast an AP like this

Connect to the AP (no password required). When connected browse to 192.168.4.1 where you can configure OpenBK as normal.

For the steps taken on a real TR6260S1 device, where contacts are not so easily accessed as they are on a module, see this post regarding two flavours of ELM327 OBDII car code reader.
Flashing with universal breakout board
HLK-M20 boards have pinout similiar to ESP12F/TYWE3S/CB3S/WB3S/etc, so they can fit to universal ESP breakout. Here is pin mapping for such board:

The following board has been already covered in another topic, see here:
Programming ESP12/TYWE3S/CB3S/WB3S/etc. without soldering - solderless motherboard
OpenTR6260 demo - DHT11 sensor
OpenBeken port for TR6260 supports DHT11, which can be configured just like we've shown on our "Weather station" video for W600:
Sample connection:


Video presentation - there is also a LED on Rel pin, so clicking button toggles it as expected. The read humidity and temperature is also visible on the main page as expected.
OpenTR6260 demo - DME280 sensor
BME280/BMP280 is also supported. For that, you need to create autoexec.bat with script:
//startDriver BMPI2C [CLK] [DATA] [ChannelForTemp] [ChannelForPressure] [ChannelForHumidity] [Addr]
startdriver bmpi2c 0 1 2 3 4
If driver is missing, make sure that it is included in build - check obk_config.h.

Video presentation:
Some extra information
-TR6260S1 has some variations: https://www.elektroda.com/rtvforum/topic3965929-30.html#21315543
-we've put all the known resources I have for TR6260 here inc all datasheets: https://github.com/divadiow/TR6260
Summary
TR6260 can now be flashed via UART with OBK port. OBK build for TR6260 can be customized with our online builds, you can also create a custom driver for that in such way. Thanks to that, your TR6260 devices can now work cloud-free and be paired with Home Assistant!
Special thanks for @divadiow for researching/flashing and @insmod for porting.
Hopefully soon we'll get ported to next platforms as well.
Comments
I didn't consider dropping this file to determine the effect. To see what was at FB000 after flashing without the skylab_user_nv_0xFB000_PSM_by_Oliver.bin file selected, I first erased the whole flash.... [Read more]
Another ESWIN module, the ECR6600. Tuya modules, based on this chip are AXY series, like AXY3L, AXY2S etc. Skylab WG236, which they claim is ECR6600 based, can be bought here: https://www.aliexpress.com/item/1005004281075586.html... [Read more]
What's there? A module image flashes for a second and then I get "not available in my country". I can't view this offer. Btw, some devices can be bought cheaper if you're creating a new aliexpress account.... [Read more]
Huh, now i get it too, both on the page and in the cart. Another one, but much more expensive (1pcs for $18 + $10 shipping): https://www.aliexpress.com/item/1005004846657031.html $26 with free shipping:... [Read more]
rip-off. Some other options maybe: https://obrazki.elektroda.pl/3521407500_1734876702_thumb.jpg https://obrazki.elektroda.pl/8254600900_1734876733_thumb.jpg no welcome deal on those... [Read more]
I've found this module. Some reader must have sent it to me. https://obrazki.elektroda.pl/2621220900_1735084876_thumb.jpg https://obrazki.elektroda.pl/3227004400_1735084876_thumb.jpg https://obrazki.elektroda.pl/4129033800_1735084876_thumb.jpg... [Read more]
https://fcc.report/FCC-ID/2AXJE-LA-WE2S/4937470.pdf https://obrazki.elektroda.pl/2884741100_1735085382_thumb.jpg [Read more]
Nice. Hopefully the firmware on it is ok and you can grab a backup. We've only backups from ELM327 and HLK-M20 so far https://github.com/divadiow/TR6260/tree/main/fw_backups Leadcoo also have another... [Read more]
SSDP on TR6260 observation https://obrazki.elektroda.pl/1255956500_1735472302_thumb.jpg Error:HTTP:http_fn_cmd_tool: len 16 Info:HTTP:DRV_SSDP_Init Error:HTTP:DRV_SSDP_CreateSocket_Receive:... [Read more]
We need to enable multicast in LWIP like we did on Beken Added after 1 [minutes]: https://github.com/openshwprojects/OpenBK7231T/commit/b0f232db5f17b3ac558580767a677f2a2ee6d488 [Read more]
https://github.com/NonPIayerCharacter/OpenTR6260/commit/d8263486a42f88d7a52ee5218c21a598b9470194 [Read more]
just saw you make that. was looking for the TR6260 SDK in openshwprojects initially :) Added after 21 [minutes]: https://obrazki.elektroda.pl/7151870400_1735474238_thumb.jpg Error:HTTP:http_fn_cmd_tool:... [Read more]
@insmod Some useful info on ECR6600 [Read more]
Flashing module XY-WE2S-A Although almost all of the info is already included in some posts in this other thread (read from this post ), I think it's good to order it a bit and put it here in the... [Read more]
it was me who send you 2 of them :) is there a solution for it know. Gues I have to read upon this new thread [Read more]
😀 Do you have more to have a go dumping from? [Read more]
what do you mean? I bought 12 of them. and replaced the modules with esp02 [Read more]
oh wow ok. 12. loads to play with! [Read more]
also worth mentioning that although I said about splitting the file here you can flash the whole backup from 0 as long as you also choose boot_nocrc.bin from 0 first https://obrazki.elektroda.pl/5408715000_1737723338_thumb.jpg... [Read more]