-
Notifications
You must be signed in to change notification settings - Fork 8
Add ch32v307 into 'devices.h' and some other changes #4
base: master
Are you sure you want to change the base?
Conversation
…size. For example in ch32v203rb flash is 224k, but cached (R0WAIT) only 128, 144 or 160 kbytes depending on USER option bits
hi, thanks for submitting this pull-request.
|
From datasheet (4.3.9, table 4-18 for v307). I read that page_size (minimal programming size) is 256 bytes (except v003, v103 etc) and sector size is 4K (maximal erase size).
From datasheet: overview and 'model camparison' table, notes: As I understand these controllers has external flash chip (480K) and internal RAM that splits into program cache (192- 288K) and user RAM (32-128K). |
Ok, i've found the same info in the "CH32FV2x_V3x Reference Manual"
As I understand these controllers has external flash chip (480K) and internal RAM that splits into program cache (192- 288K) and user RAM (32-128K). From "CH32FV2x_V3x Reference Manual" sec 1.2.2 Memory allocation:
I think there is at least two version, one with 480K and one with 224K, we can see this in "Figure 1-3 Storage mapping" from http://www.jc-net.co.jp/pdf/CH32V307DS0-EN.pdf the CH32V303 V305 and V307, V208 series all have 480K of flash (aka Code Flash) CH32V303 480K CH32V203 224K CH32F203 224K It's very unclear to me what's the actual flash size. For instance the website doesn't advertise a flash size of 480K for CH32V307 but the datasheet does... it's confusing. For the wch-isp use case the exact flash size doesn't really matter, it is only used to refuse to flash if the binary file is too big. |
I've create a new branch |
I tried my version on v307 before writing the pull-request. I have not another controllers yet. |
Looks like I was wrong. In the 'rust' version, the sector size is always calculated at 1k. The GUI utility from WCH, also erases by 1k. For 792 byte firmware, 0x08 sectors are erased, for 12.5k - 0x0D. |
… Add Optionbytes read and write
…n ; Add defines for MacOS assuming sameness with Linux version(not tested)
…thon ; add device info in 'list' command
…pplication area + non-zero-wait data area).
Towards ALT packaging
These branches can be automatically merged.
wch-isp.1 is generated from wch-isp.man, remove it
Add ch32v307 into 'devices.h', change page_size (1k -> 4k) and flash_size. For example in ch32v203rb flash is 224k, but cached (R0WAIT) only 128, 144 or 160 kbytes depending on USER option bits