I just switched microprocessor, switching from a "ch32v307vct6" to a "ch32v305fbp6", expecting the code to break because I was using some pins/peripherals that does not exist on the 305.
With my surprise almost everything compiled, and this was very strange...
So I checked, and I can read/write pins that does not exist on the processors. As an example I am requesting pins PC1, PC2, PC3, PC4, but given the datasheet
Only PC6, PC7, PC8, PC9 should be present.
Checking this repository I found that the 305 processor imports the metadata_0017.rs files, where there are defined this pins.
Also in src/chips/ch32v305fbp6/metadata.rs the flash size is clearly wrong (256KB instead of 128KB).
I think that something went wrong while generating these files, or at least some files ended up switched.
I just switched microprocessor, switching from a "ch32v307vct6" to a "ch32v305fbp6", expecting the code to break because I was using some pins/peripherals that does not exist on the 305.
With my surprise almost everything compiled, and this was very strange...
So I checked, and I can read/write pins that does not exist on the processors. As an example I am requesting pins PC1, PC2, PC3, PC4, but given the datasheet
Only PC6, PC7, PC8, PC9 should be present.
Checking this repository I found that the 305 processor imports the metadata_0017.rs files, where there are defined this pins.
Also in src/chips/ch32v305fbp6/metadata.rs the flash size is clearly wrong (256KB instead of 128KB).
I think that something went wrong while generating these files, or at least some files ended up switched.