Skip to content

To adapt the flash driver for WCH's CH32VXX series MCUs, it is necessary to modify the definition of the variable 'uint8_t erase_value' in the existing flash driver. #100490

@Colt-Ma

Description

@Colt-Ma

Is your feature request related to a problem? Please describe.

For most MCUs, the flash memory is 0xFF after erasure. In the flash driver, the content type defined for erased flash is:

struct flash_parameters {
    const size_t write_block_size;
    uint8_t erase_value; /* Byte value of erased flash */
};

The erase_value variable is defined as 8-bit, but for WCH's CH32Vxx series, the flash content after erasure is 16-bit aligned 0xE339. This causes all code in the storage subsystem that relies on this variable to be unsuitable for this series of MCUs, which reduces the usefulness of the Zephyr operating system for applications on these MCUs.

Describe the solution you'd like

Change the definition of the variable 'uint8_t erase_value' and related code to accommodate more flash devices

Describe alternatives you've considered

No response

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions