esp32 icon indicating copy to clipboard operation
esp32 copied to clipboard

Remove duplicate peripherals

Open MabezDev opened this issue 5 years ago • 3 comments

Many of the generated (in particular the indexed ones) need to be manually derived.

This is achieved in svdpatch here

When the peripherals are copied it leaves behind the base peripheral, we should remove these.

Example:

In https://docs.rs/esp32/0.2.1/esp32/#structs for example, there is I2C0, I2C1 and I2C, the latter being the base peripherals that we derive the other two from. In this instance we should remove I2C.

MabezDev avatar Jan 23 '20 23:01 MabezDev

I was ultimately able to remove the peripherals in question, but ran into a bit of a snag with svdtools.

When processing it begins with _deletes which means we get errors about peripherals not being found when copying registers. Moving the _delete to the final step allows our SVD to be patched successfully, but results in errors when patching the stm32-rs repository.

I will see if I can do to get svdtools working for both repositories.

jessebraham avatar Jan 25 '20 16:01 jessebraham

Hmm, maybe we could get way with copying however many we need, and then renaming that last one, instead of deleting it?

MabezDev avatar Jan 25 '20 16:01 MabezDev

I think some for peripherals we can probably make that work.

Where I foresee issues are with peripherals such as I2C. I2C_EXT and I2C1_EXT are renamed to I2C0 and I2C1 respectively, whereas their registers are being copied from I2C.

jessebraham avatar Jan 25 '20 16:01 jessebraham