Skip to content

Commit

Permalink
Add support for CH32V002/004/005/006/007
Browse files Browse the repository at this point in the history
  • Loading branch information
basilhussain authored and andelf committed Nov 23, 2024
1 parent 96cc7a4 commit d8d76fb
Showing 1 changed file with 60 additions and 8 deletions.
68 changes: 60 additions & 8 deletions devices/0x21-CH32V00x.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ device_type: 0x21
support_net: false
support_usb: false
support_serial: true
description: CH32V00x (RISC-V2A) Series
description: CH32V00x (RISC-V2A/V2C) Series
config_registers:
# Ref: section "16.5 User Option Bytes" of RM manual
# Ref: section 16.5 (CH32V003) & 18.5 (CH32V00x) "User Option Bytes" of RM manual
- offset: 0x00
name: RDPR_USER
description: RDPR, nRDPR, USER, nUSER
Expand All @@ -16,7 +16,7 @@ config_registers:
fields:
- bit_range: [7, 0]
name: RDPR
description: Read Protection. 0xA5 for unprotected, otherwise read-protected (ignoring WRP)
description: Read Protection. 0xA5 for unprotected, otherwise read-protected (ignoring WRPR)
explaination:
0xa5: Unprotected
_: Protected
Expand Down Expand Up @@ -58,24 +58,76 @@ config_registers:
name: DATA1
- offset: 0x08
name: WRPR
# Each bit is used to control the write-protect status of 1 sector (1K bytes/sector)
# Each bit is used to control the write-protect status of sectors as follows:
# CH32V003: 1 sector (1K/sector), max 16K (WRPR3/4 reserved)
# CH32V002/004/005/006/007: 2 sectors (1K/sector), max 64K
description: Flash memory write protection status
type: u32
reset: 0xFFFFFFFF
explaination:
0xFFFFFFFF: Unprotected
_: Some 1K sections are protected
variants:
- name: CH32V002A4M6
chip_id: 0x22
flash_size: 16K
- name: CH32V002D4U6
chip_id: 0x23
flash_size: 16K
- name: CH32V002F4P6
chip_id: 0x20
flash_size: 16K
- name: CH32V002F4U6
chip_id: 0x21
flash_size: 16K
- name: CH32V002J4M6
chip_id: 0x24
flash_size: 16K
- name: CH32V003A4M6
chip_id: 0x32
flash_size: 16K
- name: CH32V003F4P6
chip_id: 0x30
flash_size: 16K
- name: CH32V003F4U6
chip_id: 0x31
flash_size: 16K
- name: CH32V003A4M6
chip_id: 0x32
flash_size: 16K
- name: CH32V003J4M6
chip_id: 0x33
flash_size: 16K
# TODO: add CH32V002, 004 & 006 - chip IDs unknown at present
- name: CH32V004F6P1
chip_id: 0x40
flash_size: 32K
- name: CH32V004F6U1
chip_id: 0x41
flash_size: 32K
- name: CH32V005D6U6
chip_id: 0x53
flash_size: 32K
- name: CH32V005E6R6
chip_id: 0x50
flash_size: 32K
- name: CH32V005F6P6
chip_id: 0x52
flash_size: 32K
- name: CH32V005F6U6
chip_id: 0x51
flash_size: 32K
- name: CH32V006E8R6
chip_id: 0x61
flash_size: 62K
- name: CH32V006F8P6
chip_id: 0x63
flash_size: 62K
- name: CH32V006F8U6
chip_id: 0x62
flash_size: 62K
- name: CH32V006K8U6
chip_id: 0x60
flash_size: 62K
- name: CH32V007E8R6
chip_id: 0x71
flash_size: 62K
- name: CH32V007K8U6
chip_id: 0x72
flash_size: 62K

0 comments on commit d8d76fb

Please sign in to comment.