Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buggy SVD files for STM32F4 USB OTG peripherals #327

Open
FLamparski opened this issue Jan 2, 2020 · 4 comments
Open

Buggy SVD files for STM32F4 USB OTG peripherals #327

FLamparski opened this issue Jan 2, 2020 · 4 comments
Labels

Comments

@FLamparski
Copy link
Contributor

FLamparski commented Jan 2, 2020

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.

@FLamparski
Copy link
Contributor Author

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:

image

(RM0390 pp 1143)

@FLamparski
Copy link
Contributor Author

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.

image

(RM0390 pp 1132)

@Windfisch
Copy link
Contributor

There are more bugs. I have fixed those which i found in #697, and there are probably even more.

Should we close this issue though?

@dbristow-otc
Copy link

I'd like to request that we keep this issue open as a meta-issue for all the bugs in the SVD until we get device/host modes worked out. However, this will be an uphill battle as even the reference manuals seem to be wrong:

image
(Page 1291 REM0090 Rev 19)

Yet ST's official HAL treats this register as writable:

image
(STM32CubeF4/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c; line 1526)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants