stm32-rs
stm32-rs copied to clipboard
Buggy SVD files for STM32F4 USB OTG peripherals
I was trying to do some USB OTG programming. However it looks like not all relevant registers are exposed in this crate, or at least they are mislabelled, owing to some dodgy SVD files. For instance, FS_DIEPTXF0
appears to be missing from the crate but it looks like it might appear under the name FS_GNPTXFSIZ
. This might not be the only inconsistency, if I come across any more I'll report them here as well.
Reading the STM32F446xx reference manual I'd expect FS_DIEPTXF0
to appear in the otg_fs_device module, and FS_HNPTXFSIZ
in otg_fs_host. That they have the same offset in the OTG register block and its usage merely depends on the mode in which the core operates - device or host - is a question left to the designers of that peripheral.
FS_DIEPTXF4
and FS_DIEPTXF5
appear to be missing completely; only FS_DIEPTXF{1,2,3}
are exposed and their doc comments are wrong:
<name>FS_DIEPTXF1</name>
<displayName>FS_DIEPTXF1</displayName>
<description>OTG_FS device IN endpoint transmit FIFO size
register (OTG_FS_DIEPTXF2)</description>
From the manual:
(RM0390 pp 1143)
FS_GRXSTSP_Device
- OTG receive status read and pop register - is missing from the SVD. Only FS_GRXSTSR_Device
is present, and that one does not pop the RX FIFO.
(RM0390 pp 1132)
There are more bugs. I have fixed those which i found in https://github.com/stm32-rs/stm32-rs/pull/697, and there are probably even more.
Should we close this issue though?