-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LYWSD002MMC - TLSR8250 based! #5
Comments
Minimal programmer (Telink Swire emulator via USB-COM port) A programmer using a bootloader loaded via the Telink Swire interface, then running via UART Normal programmer using Telink Swire hardware interface First you need to read the entire Flash (512 kilobytes) and save it for recovery. It is impossible to block programming (reading - writing) of the chip. If the programmer is working properly - then you can always restore the program. This chip does not have protection against reading and writing firmware. |
Thanks.
This is using only SWS and RESET pins on the board, and I need to connect those by your drawing, I assume, please correct me if I'm wrong. One more thing: I need to send BLE Ads, and official Telink SDK doesn't seem to know this chip: https://wiki.telink-semi.cn/wiki/chip-series/TLSR825x-Series/ Do you have any idea where can we access the SDK for this TLSR8250? |
All Chips TLSR8250, 8251, 8253, 8258 have the same crystal and volume RAM = 64 kilobytes, and a built -in Flash crystal from 512 kilobytes. And only one of several versions of TLSR8258 one megabyte Flash. Use TLSR8258 settings with 512 KB Flash. |
What is the correct reading command? The chip involved is TLSR8250F512ET32. It has internal 512K memory. Command
Chip pinoutWiring
What am I doing wrong? |
Okay, I added a 1K resistor and attached everything as your wiring (and VCC and GND):
|
Another test with "-t 2000":
|
And another with "-t 5000":
|
In case I manually skip 0x000100:
I got error at 0x000400. |
I used a 1K resistor between RX and TX as per your wiring. |
You have problems with your USB-COM adapter. SWS is a Single Wire Slave. It works on the Telink SWire hardware protocol. It has nothing in common with UART.
The hardware version of the Telink SWire protocol, without emulation, is only possible on Telink chips.
Programmer from Telink - Telink EVK:
This is just code encryption. It has nothing to do with reading the firmware. |
CP2102 seems working (even with LEDs installed). |
Perfect. (Anyway, without Now, for a very basic, simple hello-world example, which sdk would you suggest?
Thank you! |
Ok, managed to make:
Todo:
|
You need to:
Then load the resulting firmware and use the "60" function to create a map of screen segments. |
Thx! Will 60 work even when it's an epd with (most probably) spi controller? |
Where shall I set device_type? in app_config I did, but app.c complains |
okay, app.c and also app_att.c also have to be modified |
my_HardStr, my_SerialStr needs to be adjusted in app_att.c. Where are those data coming from? Besides of this, compiled, and flashing now. Bluetooth seems working, sensor seems working. Need to play more with gpios for the EPD.
|
SPI_DO, SPI_CK seems matching, but how can I know which is EPD_BUSY, EPD_SHD, EPD_RST and EPD_CSB? PA0, PA1, PB1, PC3 is connected to the FPC (among SPI_DO and SPI_CK). So I need to match PA0, PA1, PB1, PC3 to BUSY, SHD, RST, CSB. I have oscilloscope, but some guidance would be great to know what to check. |
All data from other thermometers was obtained using a logic analyzer. The original firmware was not decompiled, and there was no documentation for the EPD drivers. There were closely matching datasheets, and everything was selected by similarity and by examining protocol dumps. |
Configured GPIO like below:
But screen doesn't change at all. Any suggestion? |
ping? |
Do you have some idea what shall I check/log to get some results on the screen? |
anything? :) |
For example, the CGG1 protocol was obtained as follows: Scans Saleae Logic If you find the TLSR8250 difficult to work with, follow jonathonlui example: |
Okay, thank you. I understand every bit of your CGG1 protocol obtaining process. However this device has some really uncommon waveforms, please take a look at this attachment. Done with Logic, with my USBee AX PRO Mini Logic Analyzer (24MHz). But SPI's signals are weird: |
Nothing strange. Regular soft SPI on 9 bits by means of GPIO operation. The first CLK cycles are extended when calling a procedure from Flash while loading code into cache. Perhaps the code is written in such a way - the first bit indicates a command or data. And the processing of the first bit is described by a separate procedure... Similar to the controller used in epd_mho_c401n.c or epd_cgg1n.c. The main table T_LUT_init[] is completely identical: That is, you are lucky - the driver is already ready. |
YESSSS! Can you tell me: is there a way in Logic, to start and SPI decoder from a certain marker (without deleting that data)? In the beginning of my recording there were some noise (IMHO), which ruined my SPI decoder, and it dumped invalid data (until You point my attention on what exactly shall I see). Also, I kindof see But last byte is 00E instead of 008. Are these numbers coming from display controller's datasheet? In epd_mho_c401n.c, T_LUT_ping is the first data being sent to the display. But in my recording there are 10 bytes before this ping pattern:
Are these bytes not needed? |
There are two types of EPD. Old ones - they need to be regenerated - for this, the controller is temporarily reprogrammed and a cycle with reverse polarity is performed (sometimes flashes a negative image or completely black and then white) ... For this, another T_LUT_init[] and settings are used. If you do not occasionally perform regenerations - the display degrades - it will become gray forever. New ones - they do not need to be regenerated. I don't know what display you have. |
Okay thanks. And do you know what are those 10bytes before ping LUT? |
Don't know. If the display works correctly, then why this additional initialization? |
Nah, I have mapped all segments :)
It only works correctly, in case I have this setup:
However, if I remove the Logic Analyzer, it stops working:
I also tried getting rid of the FPC_to_PINHEADERs:
But it is not initializing the screen. Only way to make it work is to connect the logic analyzer to it and also to PC. Note: same PC is used to power the original pcb. Do you maybe have any idea what is causing this? |
I have done some voltage measurements on all of the 10pins of the FPC:
This seems some GPIO issue to me. I'm using your original repo, with minor mods for this screen only (copied the epd_mho_c401n.c to epd_mjwsd02.c). In case you have any ideas, please share with me. It seems I'll have to dig myself into your custom gpio setting in main.c. It's pretty strange it works with logic analyzer attached, and not without it. |
You're looking in the wrong place.
PS: I don't speak English and it's difficult and time-consuming for me to describe everything through Google Translate - it doesn't understand Russian well.
Teach everything about electronics and microcontroller programming in a "github issue"? |
I appreciate your inputs and help.
I copied this from other devices (and corrected the numbers for this board):
But, for SCL and SDA we need PULLUP to work correctly. Thank you! |
Hi.
I found many articles only about the LYWSD002MMC. It was based on DA14585 from Dialog (Renesas).
But now I opened mine and it is now a new version (seems like), and this is based on the TLSR8250.
I wish to create a new firmware which prints the temperature onto the large display segments.
But I'm a little bit stucked: pins available are:
Is it possible to flash this device via these pins? If so - what programmer is needed? (J-Segger?)
By any chance can I do OTA?
Any help would be much appreciated.
The text was updated successfully, but these errors were encountered: