Skip to content

Small correction and fixes - #64

Open
Ntemis wants to merge 2 commits into
X360Tools:masterfrom
Ntemis:master
Open

Small correction and fixes#64
Ntemis wants to merge 2 commits into
X360Tools:masterfrom
Ntemis:master

Conversation

@Ntemis

@Ntemis Ntemis commented Aug 31, 2026

Copy link
Copy Markdown

No description provided.

Ntemis added 2 commits August 31, 2026 13:41
Added a default: case that returns ERR_UNKNOWN_COMMAND instead of silently dropping unrecognized opcodes (previously the host could hang forever waiting for a reply that would never come).
WRITE_FLASH, EMMC_WRITE, ISD1200_WRITE_FLASH now send ERR_SHORT_READ on a truncated payload instead of a bare return; that left the host blocked.
New finding I hadn't caught in the first pass: EMMC_WRITE's 0x200-byte payload was never accounted for in the needed_data pre-check (only WRITE_FLASH and ISD1200_WRITE_FLASH were), so the dispatcher could fire before the eMMC write payload had actually arrived. Fixed.
READ_FLASH/WRITE_FLASH now refuse to touch the NAND if flash_config reads back as 0 (undetected/uninitialized state) rather than issuing SPI transactions blind — see the comment in the file for exactly why I stopped short of a full capacity bounds-check (I don't have enough of the flash_config bit layout to derive total NAND size safely, and guessing at that number for a flasher is exactly the kind of "fix" that causes real damage).
Fixed the available_data typo and the unchecked tud_cdc_peek() return.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant