I would like to present a simple teardown of a "USB Smart Adapter HC-S050-WIFI". It's a small device to control power to a USB socket built around a BK7231N. To open the case, apply some gentle force around the edge to open the lid.
For flashing via UART connect TP5 as RX and TP4 as TX.
I tried flashing it using BekenWriter V1.60 and BK7231 Easy UART Flasher with the latest BK7231N UART firmware. I have successfully used these programs to flash other Tuya devices in the past, so it should have worked.
Using BK7231 Easy UART Flasher, I was able to "successfully" flash the device on my first try. However, even though the software said flashing has been successful, the device was still running the default firmware and was even controllable through the Tuya smart app. But I was able to read the OBK / Tuya config, which is identical to the one posted above.
After trying this multiple times with different firmware versions and replugging it multiple times, I tried using Beken Writer V1.60. It managed to write the new firmware, but failed verifying it, and it was still running the default firmware and usable from the app.
I then used BK7231 Easy... to "Erase all", once again this software was able to "successfully" flash the device, and Beken Writer... now also successfully verifies the written binary. The device now finally doesn't load its default firmware, but sadly now does nothing when powered on.
I'd say it's impossible for original firmware to "come back", but maybe, just maybe, you had somehow something in the OTA partition and it had OTA'ed back to Tuya... who knows...
Did you pair it with Tuya before flashing?
Anyway, that's very strange.
Are you sure that you've chosen correct platform (N or T)?
What does the UART 2 (TX2) log say now? Can you capture the log data so we can tell where the firmware is failing?
Flashed. Original firmware is 1.3.10 so can't be exploited via cloudcutter.
I tried flasher v 1.1.1 but it kept crashing. Went back to 1.0.6 which worked.
Took a few attempts at disconnecting and turning on/off to get it to flash but got there eventually.
Seems to have held its flash for me with no issue.
Integrated into Home Assistant with no issues.
The cover is glued on, but easy to removed without damage. When you put it back together be careful not to push the device out of the case when plugging in a USB device if you haven't put some glue back on the cover.