Fix "DRAM setup failed: unpack requires a buffer of 12 bytes" in mtkclient on Xiaomi Redmi 9A (dandelion, MT6765, 2GB Micron LPDDR4X)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- embedded-iot
Research direction
Read the linked reverse-engineering repository and inspect the MTK_DA_V5.bin comparison at 0x214602 alongside the Xiaomi preloader EMI table entries described in the issue. Determine how the multi-byte MR5 values cause DA1 to reject the RAM configuration; done means the reported Redmi 9A setup no longer halts with the EMI error or freezes in BROM mode.
Written by the indexing model from the issue text.
Description
I recently reverse-engineered MTK_DA_V5.bin (Stage 1) to find the exact root cause of this crash on blossom/dandelion boards.
It turns out that the stock Download Agent bundled with mtkclient performs a strict 32-bit comparison (cmp r3, r2 at 0x214602) against the 8-bit MR5 RAM vendor ID read from the LPDDR4X chip. In Xiaomi's stock preloader EMI table, certain RAM entries (such as Entry 1 with MR5 = 0xff1301 and Entry 3 with MR5 = 0xff01) store multi-byte values in that field, so they get rejected by MTK_DA_V5.bin, causing DA1 to halt with "[EMI] setting failed 0xffffffff" and freeze the phone in BROM mode until the battery is physically disconnected.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 309
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bkerler/mtkclient
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
bkerler/mtkclient#378 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
bkerler/mtkclient#351 · 1 comment ·
Maintainers usually reply within 1 day
All issues in bkerler/mtkclient
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ida-arbeitszeit/workers-control#1578 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
aws-samples/sample-per-model-bedrock#898 ·
Maintainers usually reply within 1 day
-
intake mcp-intake needs-human-review priority:high
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Ikalus1988/MisakaNet#5041 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100