Xiaomi mi band processor.
As we can see from teardown articles and photos from web there's DA14580 as a hearth of Xiaomi Mi Band.What interesting can we know that help us in reverting? Let's see documentaion for these mcu.
Here's first interesting thing. On this diagram we can see what memory consist of.
First of all it has ROM. Docs say that it is used for Bluetooth Smart protocol stack. That's cool so developer can forget about trying to delete something from protocol to fit firmware into limited amount of memory - it's yet included. Also boot code sequence is stored there.
Next is 32 kB OTP which is one-time-programmable memory. That means that since you wrote something to it you cannot modify any byte. This type of memory is cheaper than FLASH memory used in controllers like AVR or STM32. Developer has to store his firmware in OTP memory to save it between power loss.
And the last is RAM memory. It consist of system 42 kB SRAM and retention RAMs.
Retention RAM is used for storing data while mcu is in sleep mode. Seems like this memory is low-power or something but now it's not interesting for me.
More interesting is system SRAM description. Documentation tells us that system SRAM is used for mirroring code from OTP after mcu powers up (or wakes after sleep mode).
As we know Mi Band is capable to update it's firmware via bluetooth. Because of FLASH memory lacking all data transferred from smartphone on update process is stored in system SRAM (or may be, but likely not, in retention RAM).
As miband is a battery powered device, it has to can restore it's state after power loss. It has to copy code from OTP to RAM, interract with smartphone app to get firmware update and keep on working. But may be i'm wrong and data that stored in RAM is lost after power down and only way to get device back to work is using some programmer like J-link.
So here are my plans:
1) Disassembly miband with photo report.
2) Find out where i can take debug pins on device.
3) Reverse schematic of miband. I didn't find it in web.
No comments:
Post a Comment