Skip to content

CH32V003: Once write a sketch, can't write a sketch again #202

@hidori

Description

@hidori

Hi,

In CH32V003, PD1 and SWIO are assigned to the same pin, and whether it behaves as GPIO or SWIO is determined by the setting of the built-in register of muc.

In $/system/CH32V00x/USER/system_ch32v00x.c, PD1 is configured to act as gpio as shown below.

    RCC->APB2PCENR |= RCC_AFIOEN;
    AFIO->PCFR1 |= (1<<15);

Therefore, once you write a sketch to CH32V003, you will never be able to write a sketch to it again.

When developing using the Arduino IDE, most people will likely write sketches multiple times, so this behavior is unacceptable.

I would like this corrected.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions