hexeguitar / CH55x_python_flasher

Python based flash/verify tool for the CH55x MCUs
GNU General Public License v3.0
15 stars 3 forks source link

Modify device_erase_size to fix CH559 code flash area #4

Closed toyoshim closed 3 years ago

toyoshim commented 3 years ago

For CH559, device_erase_size was specified as 0x1d. But this is too small to write a larger file. CH559 has 64KB flash ROM and the first 60KB is used for application code. Following 1KB is used for application data or code. And the last 3KB is for boot loader and configuration. As the block size is 1KB, this device_erase_size should be set to 60.

hexeguitar commented 3 years ago

Hi Toyoshim, i was about to dig out my CH559 dev board to test it, but you were faster. Yes, you are correct. More fixes could be required for the v1 of bootloader. Although i'm not sure it the chips with the old bootloader are still available. I'll look into it soon. Not closing the issue yet. Meanwhile, thank you for the fix. Merging.

Piotr

toyoshim commented 3 years ago

Thanks! My dev board has v2.31 bootloader, and some chips bought for my own board have v2.40. So, unfortunately I also din't have any environment to check v1.xx.

Anyway, thank you for sharing a really useful tool!