p.kaczmarek2 wrote:BK7231 changes - I see you're saying they are checked, but are they really correct? Hardcoded 4 MB flash? Just making sure.
I guess you mean BK7252_MAX_FLASH_SIZE https://github.com/divadiow/BK7231GUIFlashToo...d72fe/BK7231Flasher/Flashers/BK7231Flasher.cs
This was a safety constraint because if flash is blank, wrap-around detection can become ambiguous and keeps wrapping upwards
The known BK7252U variants are 2MB and 4MB, so the detector only considers those sizes and will not infer anything larger from mirrored/blank reads. Worst-case a read will have a mirror at 2mb and likely only when flash is blank anyway.
BK7231T/U are still reset to the existing 2MB size during setup
seems there is an edge case where
FLASH_SIZEcould leak changing between chip modes, which I don't think is likely to be seen:
eg
1. Use BK7252U.
2. Detect a 4MB chip, so FLASH_SIZE becomes 0x400000.
3 .Without restarting the app, switch chip type to BK7231T/U.
etc
I have a fix for that if you think it should be in
Added after 15 [minutes]:
leakage also possible if switching to jedec ID flash size set chips. unlikely to matter much though?