Skip to content

Add NUCLEO-H7S3L8 BSP #2960

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

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Add NUCLEO-H7S3L8 BSP #2960

wants to merge 16 commits into from

Conversation

HiFiPhile
Copy link
Collaborator

@HiFiPhile HiFiPhile commented Jan 24, 2025

Describe the PR

Add NUCLEO-H7S3L8 support.

Status:

FS port HS port
Device Unknown Working
Host Unknown *Mostly working

Host issues are generic and not limited to STM32H7RS and will be addressed separately

  • Detach is not detected, resulting _usbh_devices overflow.
    Can be fixed by add GINTSTS_DISCINT

  • Random assert in edpt_find_opened in hcd_edpt_xfer
    Seems like when there are failed transfers events become mismatched. In the end a transfer is called with addr=1 but in received event addr=0.

  • Occasional assert TU_ASSERT(ep_id < CFG_TUH_DWC2_ENDPOINT_MAX); with quickly connection/disconnection.
    A transfer with addr 0 finished after set address, maybe old transfer is not correctly aborted ?

Set Address = 1
[1:0] Set Address: 00 05 01 00 00 00 00 00 
gintsts = 0x20
on EP 00 with 8 bytes: OK
gintsts = 0x2000000
hcint = 0x21
on EP 80 with 8 bytes: OK
gintsts = 0x2000010
hcint = 0x20
gintsts = 0x2000000
hcint = 0x1
gintsts = 0x10
gintsts = 0x2000000
hcint = 0x2

[1:1] Open EP0 with Size = 8
Get Device Descriptor 1
[1:1] Get Descriptor: 80 06 00 01 00 00 12 00 
gintsts = 0x20
on EP 00 with 0 bytes: OK
gintsts = 0x2000000
hcint = 0x21
hcd_edpt_xfer 638: ASSERT FAILED
  • Occasional assert tuh_descriptor_get_device(addr0...) when the port is bouncing, can be resolved by put _dev0.enumerating = 1; after debouncing delay, like in ENUM_ADDR0_DEVICE_DESC
[1:] USBH Device Attach
gintsts = 0x20000000
gintsts = 0x1000000
gintsts = 0x20000000
gintsts = 0x1000000
gintsts = 0x20000000
gintsts = 0x1000000
gintsts = 0x20000000
gintsts = 0x1000000
gintsts = 0x1000000
Full Speed
[1:0] Open EP0 with Size = 8
Get 8 byte of Device Descriptor
process_enumeration 1473: ASSERT FAILED

Additional context
Wasted 2 hours in EXTI as the offset in SVD file is wrong !
Corrected STM32H7S.svd.zip

Signed-off-by: HiFiPhile <[email protected]>
Signed-off-by: HiFiPhile <[email protected]>
Signed-off-by: HiFiPhile <[email protected]>
Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for your PR, I also have this board. I will try to troubleshoot it later. Just merge master to get ci passed.

@lab313ru
Copy link

lab313ru commented Mar 23, 2025

Is it usable for the board in its current state?

@HiFiPhile
Copy link
Collaborator Author

Is it usable for the board in its current state?

If you use it in device mode yes.

@lab313ru
Copy link

Unfortunately I need Host mode:(
ST's usb stub makes me suffer.

@lab313ru
Copy link

As I can say, there are problems with the board itself. Even examples code sometimes doesn't work, because of the device's USB controller state. I think it breaks some state inside itself, that's why it happens. Only powering it off for ~10 seconds helps. I don't know why is that, but it's true. I can prove it on my board.

@HiFiPhile

This comment was marked as outdated.

@HiFiPhile
Copy link
Collaborator Author

HiFiPhile commented Apr 12, 2025

Since hcd_dwc2 and usbh changes are generic I've excluded them from this PR, will address them separately.

@b4shful
Copy link

b4shful commented May 14, 2025

Been testing this on NUCLEO-H7S3L8 along with some of your DWC2 changes in separate PRs.

I left some review comments on those other PRs, just minor things, but I wanted to also comment on this one and say thank you so much for the great work on H7S3L8 and DWC2.

With a few tweaks for my specific requirements, it's working flawlessly and my basic CDC HS single endpoint setup is already hitting 18MB/s in a super quick benchmark task I wrote, with the only real optimisation I've had to do being changing the 512 byte buffers to 2kb! Excited to make some more tweaks and see how fast I can get it to go.

The project I'm using this for is part of my final year project at university - and I had already wasted a lot of time with ST's USB stack before realising it was fundamentally broken and almost unusable (I think its interaction with the state machine is messed up or something) - so I cannot express my appreciation enough, these PRs have allowed me to escape ST's stack and move to TinyUSB, potentially saving my project 😄

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

Successfully merging this pull request may close these issues.

4 participants